comparison mod_firewall/conditions.lib.lua @ 2916:b1cdcbcd1c90

mod_firewall: Add PENDING SUBSCRIPTION FROM SENDER? condition
author Matthew Wild <mwild1@gmail.com>
date Fri, 09 Mar 2018 13:35:44 +0000
parents 165d2877eeac
children b0d92332b87f
comparison
equal deleted inserted replaced
2915:b8f2e86df7ce 2916:b1cdcbcd1c90
116 end 116 end
117 117
118 function condition_handlers.SUBSCRIBED() 118 function condition_handlers.SUBSCRIBED()
119 return "(bare_to == bare_from or 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_to", "bare_from" }; 120 { "rostermanager", "split_to", "bare_to", "bare_from" };
121 end
122
123 function condition_handlers.PENDING_SUBSCRIPTION_FROM_SENDER()
124 return "(bare_to == bare_from or to_node and rostermanager.is_contact_pending_in(to_node, to_host, bare_from))",
125 { "rostermanager", "split_to", "bare_to", "bare_from" };
121 end 126 end
122 127
123 function condition_handlers.PAYLOAD(payload_ns) 128 function condition_handlers.PAYLOAD(payload_ns)
124 return ("stanza:get_child(nil, %q)"):format(payload_ns); 129 return ("stanza:get_child(nil, %q)"):format(payload_ns);
125 end 130 end