mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
fix: Fixes notifying vnodes to destroy rooms.
It may happen we receive the disconnect iq after the main room is already destroyed. We now send disconnect on destroy to all vnodes or when receiving disconnect iq per vnode.
This commit is contained in:
@@ -138,6 +138,12 @@ module:hook('iq/host', stanza_handler, 10);
|
||||
-- an event received from visitors component, which receives iqs from jicofo
|
||||
local function disconnect_vnode(event)
|
||||
local room, vnode = event.room, event.vnode;
|
||||
|
||||
if visitors_nodes[event.room.jid] == nil then
|
||||
-- maybe the room was already destroyed and vnodes cleared
|
||||
return;
|
||||
end
|
||||
|
||||
local conference_service = muc_domain_prefix..'.'..vnode..'.meet.jitsi';
|
||||
|
||||
-- we are counting vnode main participants and we should be clearing it there
|
||||
@@ -236,7 +242,17 @@ process_host_module(main_muc_component_config, function(host_module, host)
|
||||
|
||||
-- cleanup cache
|
||||
host_module:hook('muc-room-destroyed',function(event)
|
||||
visitors_nodes[event.room.jid] = nil;
|
||||
local room = event.room;
|
||||
|
||||
-- room is destroyed let's disconnect all vnodes
|
||||
if visitors_nodes[room.jid] then
|
||||
local vnodes = visitors_nodes[room.jid].nodes;
|
||||
for conference_service in pairs(vnodes) do
|
||||
send_visitors_iq(conference_service, room, 'disconnect');
|
||||
end
|
||||
|
||||
visitors_nodes[room.jid] = nil;
|
||||
end
|
||||
end);
|
||||
|
||||
-- detects new participants joining main room and sending them to the visitor nodes
|
||||
|
||||
@@ -128,6 +128,7 @@ local function stanza_handler(event)
|
||||
local room = get_room_from_jid(room_jid_match_rewrite(room_jid));
|
||||
|
||||
if not room then
|
||||
-- this maybe as we receive the iq from jicofo after the room is already destroyed
|
||||
module:log('debug', 'No room found %s', room_jid);
|
||||
return;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user