File

mod_limits_exception/mod_limits_exception.lua @ 6249:12a2989c7cc1

mod_limits_exception: obsolete diff --git a/mod_limits_exception/README.md b/mod_limits_exception/README.md --- a/mod_limits_exception/README.md +++ b/mod_limits_exception/README.md @@ -1,6 +1,8 @@ --- +labels: +- Stage-Obsolete summary: Allow specified JIDs to bypass rate limits -... +--- This module allows you to configure a list of JIDs that should be allowed to bypass rate limit restrictions.
author Menel <menel@snikket.de>
date Mon, 12 May 2025 10:57:17 +0200
parent 4562:28c16c93d79a
line wrap: on
line source

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);