fix(breakout-rooms) simplify code

This commit is contained in:
Saúl Ibarra Corretgé 2021-11-24 16:07:41 +01:00 committed by Saúl Ibarra Corretgé
parent ef93584c2b
commit a203a92060
1 changed files with 3 additions and 3 deletions

View File

@ -173,7 +173,7 @@ function broadcast_breakout_rooms(room_jid)
end
end
for breakout_room_jid, breakout_room in pairs(main_room._data.breakout_rooms or {}) do
for breakout_room_jid in pairs(main_room._data.breakout_rooms or {}) do
local room = breakout_rooms_muc_service.get_room_from_jid(breakout_room_jid);
if room then
for _, occupant in room:each_occupant() do
@ -348,7 +348,7 @@ function exist_occupants_in_rooms(main_room)
if exist_occupants_in_room(main_room) then
return true;
end
for breakout_room_jid, breakout_room in pairs(main_room._data.breakout_rooms or {}) do
for breakout_room_jid in pairs(main_room._data.breakout_rooms or {}) do
local room = breakout_rooms_muc_service.get_room_from_jid(breakout_room_jid);
if exist_occupants_in_room(room) then
return true;
@ -395,7 +395,7 @@ function on_main_room_destroyed(event)
local message = 'Conference ended.';
for breakout_room_jid, breakout_room in pairs(main_room._data.breakout_rooms or {}) do
for breakout_room_jid in pairs(main_room._data.breakout_rooms or {}) do
destroy_breakout_room(breakout_room_jid, message)
end
end