Skip to content

Commit

Permalink
fix: Skips lobby check for jicofo.
Browse files Browse the repository at this point in the history
Skip any lobby check when the occupant is jicofo.
In case of serverside turn on lobby on room creation we do not check and allow jicofo to join.
We check for resource and no is_admin as in default configuration admins is set only for the main muc component.
  • Loading branch information
damencho committed Jul 24, 2023
1 parent f3670ce commit 83196cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/prosody-plugins/mod_muc_lobby_rooms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ local NOTIFY_LOBBY_ACCESS_GRANTED = 'LOBBY-ACCESS-GRANTED';
local NOTIFY_LOBBY_ACCESS_DENIED = 'LOBBY-ACCESS-DENIED';

local util = module:require "util";
local ends_with = util.ends_with;
local get_room_by_name_and_subdomain = util.get_room_by_name_and_subdomain;
local is_healthcheck_room = util.is_healthcheck_room;
local presence_check_status = util.presence_check_status;
Expand Down Expand Up @@ -363,9 +364,9 @@ process_host_module(main_muc_component_config, function(host_module, host)
end);

host_module:hook('muc-occupant-pre-join', function (event)
local room, stanza = event.room, event.stanza;
local occupant, room, stanza = event.occupant, event.room, event.stanza;

if is_healthcheck_room(room.jid) or not room:get_members_only() then
if is_healthcheck_room(room.jid) or not room:get_members_only() or ends_with(occupant.nick, '/focus') then
return;
end

Expand All @@ -392,7 +393,7 @@ process_host_module(main_muc_component_config, function(host_module, host)
if whitelistJoin then
local affiliation = room:get_affiliation(invitee);
if not affiliation or affiliation == 0 then
event.occupant.role = 'participant';
occupant.role = 'participant';
room:set_affiliation(true, invitee_bare_jid, 'member');
room:save();

Expand Down

0 comments on commit 83196cd

Please sign in to comment.