Skip to content

Commit

Permalink
fix(breakout-rooms) fix race condition in timer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yilmazesrahatice authored Oct 5, 2023
1 parent b4d12d7 commit 09c0854
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/prosody-plugins/mod_muc_breakout_rooms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ function on_occupant_joined(event)
return;
end

local main_room = get_main_room(room.jid);
local main_room, main_room_jid = get_main_room(room.jid);

if main_room and main_room._data.breakout_rooms_active then
if jid_node(event.occupant.jid) ~= 'focus' then
broadcast_breakout_rooms(room.jid);
broadcast_breakout_rooms(main_room_jid);
end

-- Prevent closing all rooms if a participant has joined (see on_occupant_left).
Expand Down Expand Up @@ -411,14 +411,14 @@ function on_occupant_left(event)
return;
end

local main_room = get_main_room(room_jid);
local main_room, main_room_jid = get_main_room(room_jid);

if not main_room then
return;
end

if main_room._data.breakout_rooms_active and jid_node(event.occupant.jid) ~= 'focus' then
broadcast_breakout_rooms(room_jid);
broadcast_breakout_rooms(main_room_jid);
end

-- Close the conference if all left for good.
Expand Down

0 comments on commit 09c0854

Please sign in to comment.