mod_snikket_restricted_users: Add some explanatory comments

This commit is contained in:
Matthew Wild 2021-11-09 12:28:50 +00:00
parent 40daaa883b
commit a5084a289e
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,8 @@ local jid_bare = require "util.jid".bare;
local um_get_roles = require "core.usermanager".get_roles;
local function load_main_host(module)
-- Check whether a user should be isolated from remote JIDs
-- If not, set a session flag that allows them to bypass mod_isolate_host
local function check_user_isolated(event)
local session = event.session;
if not session.no_host_isolation then
@ -14,6 +16,8 @@ local function load_main_host(module)
end
end
-- Add low-priority hook to run after the check_user_isolated default
-- behaviour in mod_isolate_host
module:hook("resource-bind", check_user_isolated, -0.5);
end