fix(persistent_lobby): Fix main room lookup.

The change about keeping jid was introduced in 5580301.
This commit is contained in:
damencho
2025-10-08 14:33:11 -05:00
committed by Дамян Минков
parent 50bad7bbca
commit 698aa8db3e

View File

@@ -11,6 +11,7 @@
module:depends('room_destroy');
local util = module:require "util";
local get_room_from_jid = util.get_room_from_jid;
local is_healthcheck_room = util.is_healthcheck_room;
local main_muc_component_host = module:get_option_string('main_muc');
local lobby_muc_component_host = module:get_option_string('lobby_muc');
@@ -144,9 +145,13 @@ run_when_component_loaded(lobby_muc_component_host, function(host_module, host_n
lobby_module:hook("muc-occupant-left", function(event)
-- Check if room should be destroyed when someone leaves the lobby
local lobby_room = event.room;
local main_room = lobby_room.main_room;
if not lobby_room.main_room_jid then
return;
end
local main_room = get_room_from_jid(lobby_room.main_room_jid);
if not main_room or is_healthcheck_room(main_room.jid) or not has_persistent_lobby(main_room) then
return;