fix(persistent_lobby): properly destroy main room when empty

This commit is contained in:
Shawn 2022-10-19 17:32:07 +01:00 committed by Дамян Минков
parent a9f5829e58
commit 7249406960
1 changed files with 3 additions and 5 deletions

View File

@ -84,12 +84,10 @@ local function has_persistent_lobby(room)
end
-- Helper method to trigger main room destroy if room is persistent (no auto-delete) and destroy not yet triggered
-- Helper method to trigger main room destroy
local function trigger_room_destroy(room)
if room.get_persistent(room) and room._data.room_destroy_triggered == nil then
room._data.room_destroy_triggered = true;
main_muc_module:fire_event("muc-room-destroyed", { room = room; });
end
room:set_persistent(false);
room:destroy(nil, 'main room and lobby now empty');
end