view mod_limits_exception/mod_limits_exception.lua @ 4869:c3bf568e3977

mod_http_xep227: Initialize XEP-0227 XML mod_storage_xep0227 only writes if there is XML already for a user (it uses the presence of an existing <user> element as an indicator that an account exists, although technically this is not something Prosody itself does, so it's a little weird).
author Matthew Wild <mwild1@gmail.com>
date Sat, 15 Jan 2022 14:25:27 +0000
parents 28c16c93d79a
children
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);