Comparison

mod_isolate_host/mod_isolate_host.lua @ 5096:16db0a6e868c

mod_isolate_host: Pass context to module:may() (thanks cc)
author Matthew Wild <mwild1@gmail.com>
date Tue, 29 Nov 2022 11:36:28 +0000
parent 5004:bc75fc9400ae
child 5296:0f5657db1cfc
comparison
equal deleted inserted replaced
5095:745c7f4cca40 5096:16db0a6e868c
37 module:default_permission("prosody:admin", "xmpp:federate"); 37 module:default_permission("prosody:admin", "xmpp:federate");
38 38
39 function check_user_isolated(event) 39 function check_user_isolated(event)
40 local session = event.session; 40 local session = event.session;
41 local bare_jid = jid_bare(session.full_jid); 41 local bare_jid = jid_bare(session.full_jid);
42 if module:may("xmpp:federate") or except_users:contains(bare_jid) then 42 if module:may("xmpp:federate", event) or except_users:contains(bare_jid) then
43 session.no_host_isolation = true; 43 session.no_host_isolation = true;
44 end 44 end
45 module:log("debug", "%s is %sisolated", session.full_jid or "[?]", session.no_host_isolation and "" or "not "); 45 module:log("debug", "%s is %sisolated", session.full_jid or "[?]", session.no_host_isolation and "" or "not ");
46 end 46 end
47 47