"Fossies" - the Fresh Open Source Software Archive 
Member "jitsi-meet-7307/resources/prosody-plugins/mod_limits_exception.lua" (30 May 2023, 1022 Bytes) of package /linux/misc/jitsi-meet-7307.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 -- we use async to detect Prosody 0.10 and earlier
2 local have_async = pcall(require, 'util.async');
3
4 if not have_async then
5 return;
6 end
7
8 local unlimited_jids = module:get_option_inherited_set("unlimited_jids", {});
9
10 -- rises the limit of the stanza size for the unlimited jids, default is 10MB
11 local unlimited_stanza_size_limit = module:get_option_number("unlimited_size", 10*1024*1024);
12
13 if unlimited_jids:empty() then
14 return;
15 end
16
17 module:hook("authentication-success", function (event)
18 local session = event.session;
19 local jid = session.username .. "@" .. session.host;
20 if unlimited_jids:contains(jid) then
21 if session.conn and session.conn.setlimit then
22 session.conn:setlimit(0);
23 elseif session.throttle then
24 session.throttle = nil;
25 end
26
27 if unlimited_stanza_size_limit and session.stream.set_stanza_size_limit then
28 module:log('info', 'Setting stanza size limits for %s to %s', jid, unlimited_stanza_size_limit)
29 session.stream:set_stanza_size_limit(unlimited_stanza_size_limit);
30 end
31 end
32 end);