changeset 2529:3fe4ca2b55c2

mod_firewall: Add 'SENT DIRECTED PRESENCE TO SENDER?'
author Matthew Wild <mwild1@gmail.com>
date Mon, 20 Feb 2017 09:32:48 +0000
parents 44a71584521d
children 84e103fd8039
files mod_firewall/conditions.lib.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Mon Feb 20 09:31:30 2017 +0000
+++ b/mod_firewall/conditions.lib.lua	Mon Feb 20 09:32:48 2017 +0000
@@ -252,6 +252,12 @@
 	return ("not not session.firewall_marked_"..idsafe(name));
 end
 
+function condition_handlers.SENT_DIRECTED_PRESENCE_TO_SENDER(jid)
+	local meta_deps = {};
+	jid = meta(("%q"):format(jid), meta_deps);
+	return "not not session.directed[jid]", meta_deps;
+end
+
 -- CHECK LIST: spammers contains $<@from>
 function condition_handlers.CHECK_LIST(list_condition)
 	local list_name, expr = list_condition:match("(%S+) contains (.+)$");