Merge pull request #74 from snikket-im/fix/no-roles-no-isolation

mod_snikket_restricted_users: Don't isolate users with no roles
This commit is contained in:
Matthew Wild 2021-11-10 17:51:14 +00:00 committed by GitHub
commit b57057f809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,8 @@ local function load_main_host(module)
if not session.no_host_isolation then
local bare_jid = jid_bare(session.full_jid);
local roles = um_get_roles(bare_jid, module.host);
if roles and not roles["prosody:restricted"] then
if roles == false then return; end
if not roles or not roles["prosody:restricted"] then
-- Bypass isolation for all unrestricted users
session.no_host_isolation = true;
end