mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat: Adds new module to unlimit jicofo and jvb connections.
In case limited those connection will be whitelisted and unlimited. Updates existing configurations to make sure prosody update will not break it by limiting too much. Uses 28c16c93d79a version of the module: https://modules.prosody.im/mod_limits_exception.html Will be available in prosody 0.12.
This commit is contained in:
24
resources/prosody-plugins/mod_limits_exception.lua
Normal file
24
resources/prosody-plugins/mod_limits_exception.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- we use async to detect Prosody 0.10 and earlier
|
||||
local have_async = pcall(require, 'util.async');
|
||||
|
||||
if not have_async then
|
||||
return;
|
||||
end
|
||||
|
||||
local unlimited_jids = module:get_option_inherited_set("unlimited_jids", {});
|
||||
|
||||
if unlimited_jids:empty() then
|
||||
return;
|
||||
end
|
||||
|
||||
module:hook("authentication-success", function (event)
|
||||
local session = event.session;
|
||||
local jid = session.username .. "@" .. session.host;
|
||||
if unlimited_jids:contains(jid) then
|
||||
if session.conn and session.conn.setlimit then
|
||||
session.conn:setlimit(0);
|
||||
elseif session.throttle then
|
||||
session.throttle = nil;
|
||||
end
|
||||
end
|
||||
end);
|
||||
Reference in New Issue
Block a user