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.
This commit is contained in:
Kim Alvefur 2021-07-29 20:16:11 +02:00
parent 5d73586b4f
commit 9dd9cb4392

View file

@ -134,5 +134,20 @@ function module.add_host(module)
unlimited(session); unlimited(session);
end end
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
end end