From 9dd9cb43927a6d29e4df1c857b80ff3475410b3d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 29 Jul 2021 20:16:11 +0200 Subject: mod_limits: Extend unlimited_jids to s2s sessions (for Ge0rG) This makes unlimited_jids also work for s2s connections, assuming the remote server has been identified. --- plugins/mod_limits.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/mod_limits.lua b/plugins/mod_limits.lua index 9905dded..4f1b618e 100644 --- a/plugins/mod_limits.lua +++ b/plugins/mod_limits.lua @@ -134,5 +134,20 @@ function module.add_host(module) unlimited(session); end end); + + module:hook("s2sout-established", function (event) + local session = event.session; + if unlimited_jids:contains(session.to_host) then + unlimited(session); + end + end); + + module:hook("s2sin-established", function (event) + local session = event.session; + if session.from_host and unlimited_jids:contains(session.from_host) then + unlimited(session); + end + end); + end end -- cgit v1.2.3