Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
fix(visitors): Destroy visitors room earlier on main=0.
damencho8d8e83cdfd88
diff --git a/resources/prosody-plugins/mod_fmuc.lua b/resources/prosody-plugins/mod_fmuc.luaindex cc99ac8686..ee617486a6 100644--- a/resources/prosody-plugins/mod_fmuc.lua+++ b/resources/prosody-plugins/mod_fmuc.lua@@ -211,6 +211,20 @@ local function cancel_destroy_timer(room)endend+local function destroy_with_conference_ended(room)+ -- if the room is being destroyed, ignore+ if room.destroying then+ return;+ end++ cancel_destroy_timer(room);++ local main_count, visitors_count = get_occupant_counts(room);+ module:log('info', 'Will destroy:%s main_occupants:%s visitors:%s', room.jid, main_count, visitors_count);+ room:destroy(nil, 'Conference ended.');+ return true;+end+-- schedules a new destroy timer which will destroy the room if there are no visitors after the timeoutlocal function schedule_destroy_timer(room)cancel_destroy_timer(room);@@ -271,6 +285,10 @@ module:hook('muc-occupant-left', function (event)if visitors_count == 0 thenschedule_destroy_timer(room);end++ if main_count == 0 then+ destroy_with_conference_ended(room);+ endend);-- forward visitor presences to jicofo@@ -407,7 +425,6 @@ local function stanza_handler(event)local room = get_room_from_jid(room_jid_match_rewrite(room_jid));if not room then- module:log('warn', 'No room found %s in stanza_handler', room_jid);return;end@@ -619,12 +636,7 @@ local function iq_from_main_handler(event)respond_iq_result(origin, stanza);if process_disconnect then- cancel_destroy_timer(room);-- local main_count, visitors_count = get_occupant_counts(room);- module:log('info', 'Will destroy:%s main_occupants:%s visitors:%s', room.jid, main_count, visitors_count);- room:destroy(nil, 'Conference ended.');- return true;+ return destroy_with_conference_ended(room);end-- if there is password supplied use it