Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

mod_limits_exception.lua 594B

123456789101112131415161718192021222324
  1. -- we use async to detect Prosody 0.10 and earlier
  2. local have_async = pcall(require, 'util.async');
  3. if not have_async then
  4. return;
  5. end
  6. local unlimited_jids = module:get_option_inherited_set("unlimited_jids", {});
  7. if unlimited_jids:empty() then
  8. return;
  9. end
  10. module:hook("authentication-success", function (event)
  11. local session = event.session;
  12. local jid = session.username .. "@" .. session.host;
  13. if unlimited_jids:contains(jid) then
  14. if session.conn and session.conn.setlimit then
  15. session.conn:setlimit(0);
  16. elseif session.throttle then
  17. session.throttle = nil;
  18. end
  19. end
  20. end);