feat(lobby): Handle disabling lobby. (#16770)

* feat(lobby): Handle disabling lobby.

* squash: rename field.
This commit is contained in:
Дамян Минков
2025-12-16 08:21:39 -06:00
committed by GitHub
parent 6c78ec9099
commit 05e47ade7c
2 changed files with 14 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
- breakout_rooms - A table containing breakout rooms created in the main room. The keys are the JIDs of the breakout rooms, and the values are their subjects.
- breakout_rooms_active - Whether there was a breakout room created in the main room.
- breakout_rooms_counter - A counter for breakout rooms created in the main room.
- lobby_disabled - Whether lobby was disabled for the room by the backend.
- flip_participant_nick - Used in mod_muc_flip, when flipping a participant we store the nick of the second device/participant. Same processing as kicked_participant_nick.
- hideDisplayNameForGuests - When set to true, the display name of participants is hidden for guests.
- jicofo_lock - A boolean value, when set to true the room is locked waiting for Jicofo to join. All attempts to join will be queued until Jicofo joins.

View File

@@ -413,11 +413,16 @@ function process_lobby_muc_loaded(lobby_muc, host_module)
host_module:hook('host-disco-info-node', function (event)
local session, reply, node = event.origin, event.reply, event.node;
if node == LOBBY_IDENTITY_TYPE
and session.jitsi_web_query_room
and check_display_name_required then
and session.jitsi_web_query_room then
local room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
if room and room._data.lobbyroom then
if room and room._data.lobby_disabled then
-- we cannot remove the child from the stanza so let's just change the type
local lobby_identity = reply:get_child_with_attr('identity', nil, 'type', LOBBY_IDENTITY_TYPE);
lobby_identity.attr.type = 'DISABLED_'..LOBBY_IDENTITY_TYPE;
end
if check_display_name_required and room and room._data.lobbyroom then
reply:tag('feature', { var = DISPLAY_NAME_REQUIRED_FEATURE }):up();
end
end
@@ -489,6 +494,11 @@ process_host_module(main_muc_component_config, function(host_module, host)
end
local members_only = event.fields['muc#roomconfig_membersonly'] and true or nil;
if members_only then
-- if lobby disabled just ignore and return
if room._data.lobby_disabled then
module:log('warn', 'Lobby is disabled for room %s, cannot enable members only', room.jid);
return;
end
local lobby_created = attach_lobby_room(room, actor);
if lobby_created then
module:fire_event('jitsi-lobby-enabled', { room = room; });