Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: Fixes notifying vnodes to destroy rooms.

damenchoac8e4d98280d
diff --git a/resources/prosody-plugins/mod_visitors.lua b/resources/prosody-plugins/mod_visitors.lua
index 2bbe579ae9..148be429e1 100644
--- a/resources/prosody-plugins/mod_visitors.lua
+++ b/resources/prosody-plugins/mod_visitors.lua
@@ -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
diff --git a/resources/prosody-plugins/mod_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.lua
index 38128f6723..1365e8e2b7 100644
--- a/resources/prosody-plugins/mod_visitors_component.lua
+++ b/resources/prosody-plugins/mod_visitors_component.lua
@@ -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