mod_firewall: Remove reliance on full_sessions being a global
While it exists as a global now, we want to move away from these globals
eventually.
--- a/mod_firewall/conditions.lib.lua Wed Jun 30 14:33:06 2021 +0200
+++ b/mod_firewall/conditions.lib.lua Wed Jun 30 14:48:59 2021 +0200
@@ -304,7 +304,7 @@
-- TO FULL JID?
function condition_handlers.TO_FULL_JID()
- return "not not full_sessions[to]", { "to" };
+ return "not not full_sessions[to]", { "to", "full_sessions" };
end
-- CHECK LIST: spammers contains $<@from>
--- a/mod_firewall/mod_firewall.lua Wed Jun 30 14:33:06 2021 +0200
+++ b/mod_firewall/mod_firewall.lua Wed Jun 30 14:48:59 2021 +0200
@@ -216,6 +216,9 @@
return ("local multi_throttle_%s = rates.%s:multi();"):format(throttle, throttle);
end;
};
+ full_sessions = {
+ global_code = [[local full_sessions = prosody.full_sessions;]];
+ };
rostermanager = {
global_code = [[local rostermanager = require "core.rostermanager";]];
};