comparison mod_firewall/conditions.lib.lua @ 2564:240985f7d1f7

mod_firewall: SUBSCRIBED: Only check roster if 'to' address has a nodepart (fixes traceback)
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Feb 2017 09:51:43 +0000
parents 2f1e25706f81
children 214b49d05ea1
comparison
equal deleted inserted replaced
2563:2f1e25706f81 2564:240985f7d1f7
112 function condition_handlers.IN_ROSTER_GROUP(group) 112 function condition_handlers.IN_ROSTER_GROUP(group)
113 return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" }; 113 return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" };
114 end 114 end
115 115
116 function condition_handlers.SUBSCRIBED() 116 function condition_handlers.SUBSCRIBED()
117 return "rostermanager.is_contact_subscribed(to_node, to_host, bare_from)", 117 return "(to_node and rostermanager.is_contact_subscribed(to_node, to_host, bare_from))",
118 { "rostermanager", "split_to", "bare_from" }; 118 { "rostermanager", "split_to", "bare_from" };
119 end 119 end
120 120
121 function condition_handlers.PAYLOAD(payload_ns) 121 function condition_handlers.PAYLOAD(payload_ns)
122 return ("stanza:get_child(nil, %q)"):format(payload_ns); 122 return ("stanza:get_child(nil, %q)"):format(payload_ns);