# HG changeset patch # User Kim Alvefur # Date 1625057339 -7200 # Node ID 4e8fa75cc67869ab2db26add9da3e7aa0cf33ced # Parent c8ccaac78f64a495fa9f1cac1b29b0b52120f756 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. diff -r c8ccaac78f64 -r 4e8fa75cc678 mod_firewall/conditions.lib.lua --- 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> diff -r c8ccaac78f64 -r 4e8fa75cc678 mod_firewall/mod_firewall.lua --- 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";]]; };