Comparison

mod_firewall/conditions.lib.lua @ 2857:ff1666716d10

mod_firewall: Make SUBSCRIBED match for stanzas sent to self (fixes #1052)
author Kim Alvefur <zash@zash.se>
date Sat, 30 Dec 2017 23:53:41 +0100
parent 2618:c6652d055ba3
child 2859:22e11645a895
comparison
equal deleted inserted replaced
2856:08f6b9d37a49 2857:ff1666716d10
114 function condition_handlers.IN_ROSTER_GROUP(group) 114 function condition_handlers.IN_ROSTER_GROUP(group)
115 return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" }; 115 return ("not not (roster_entry and roster_entry.groups[%q])"):format(group), { "roster_entry" };
116 end 116 end
117 117
118 function condition_handlers.SUBSCRIBED() 118 function condition_handlers.SUBSCRIBED()
119 return "(to_node and rostermanager.is_contact_subscribed(to_node, to_host, bare_from))", 119 return "(bare_to == bare_from or to_node and rostermanager.is_contact_subscribed(to_node, to_host, bare_from))",
120 { "rostermanager", "split_to", "bare_from" }; 120 { "rostermanager", "split_to", "bare_to", "bare_from" };
121 end 121 end
122 122
123 function condition_handlers.PAYLOAD(payload_ns) 123 function condition_handlers.PAYLOAD(payload_ns)
124 return ("stanza:get_child(nil, %q)"):format(payload_ns); 124 return ("stanza:get_child(nil, %q)"):format(payload_ns);
125 end 125 end