diff mod_firewall/mod_firewall.lua @ 2342:6848297cf40a

mod_firewall: Add conditions for testing whether a sender of a stanza is in the recipient's roster (or in a certain roster group)
author Matthew Wild <mwild1@gmail.com>
date Fri, 04 Nov 2016 12:46:11 +0000
parents 9239893a2400
children 17d236129118
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Wed Nov 02 20:42:27 2016 +0100
+++ b/mod_firewall/mod_firewall.lua	Fri Nov 04 12:46:11 2016 +0000
@@ -123,6 +123,11 @@
 			return ("local multi_throttle_%s = rates.%s:multi();"):format(throttle, throttle);
 		end;
 	};
+	roster_entry = {
+		global_code = [[local rostermanager = require "core.rostermanager";]];
+		local_code = [[local roster_entry = (rostermanager.load_roster(to_node, to_host) or {})[bare_from];]];
+		depends = { "split_to", "bare_from" };
+	}
 };
 
 local function include_dep(dependency, code)