From 05e47ade7c90f2d5ed54e526f24b4a2e116de5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Tue, 16 Dec 2025 08:21:39 -0600 Subject: [PATCH] feat(lobby): Handle disabling lobby. (#16770) * feat(lobby): Handle disabling lobby. * squash: rename field. --- resources/prosody-plugins/README.md | 1 + .../prosody-plugins/mod_muc_lobby_rooms.lua | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/prosody-plugins/README.md b/resources/prosody-plugins/README.md index f6ff75f310..5a38d07c19 100644 --- a/resources/prosody-plugins/README.md +++ b/resources/prosody-plugins/README.md @@ -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. diff --git a/resources/prosody-plugins/mod_muc_lobby_rooms.lua b/resources/prosody-plugins/mod_muc_lobby_rooms.lua index 5d4d6fa858..595c3f0f5a 100644 --- a/resources/prosody-plugins/mod_muc_lobby_rooms.lua +++ b/resources/prosody-plugins/mod_muc_lobby_rooms.lua @@ -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; });