diff 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
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Fri Mar 09 13:35:11 2018 +0000
+++ b/mod_firewall/conditions.lib.lua	Fri Mar 09 13:35:44 2018 +0000
@@ -120,6 +120,11 @@
 	       { "rostermanager", "split_to", "bare_to", "bare_from" };
 end
 
+function condition_handlers.PENDING_SUBSCRIPTION_FROM_SENDER()
+	return "(bare_to == bare_from or to_node and rostermanager.is_contact_pending_in(to_node, to_host, bare_from))",
+	       { "rostermanager", "split_to", "bare_to", "bare_from" };	
+end
+
 function condition_handlers.PAYLOAD(payload_ns)
 	return ("stanza:get_child(nil, %q)"):format(payload_ns);
 end