Skip to content

Commit

Permalink
fix: jicofo_lock is null when restored from storage (#13517)
Browse files Browse the repository at this point in the history
* Fix jicofo_lock is null when restored from storage

* revert

---------

Co-authored-by: hshim432 <[email protected]>
  • Loading branch information
hshim432 and hshim432 authored Jul 7, 2023
1 parent 472c8d7 commit 5ce2bef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/prosody-plugins/mod_muc_meeting_id.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ module:hook('muc-occupant-pre-join', function (event)
local room, stanza = event.room, event.stanza;

-- we skip processing only if jicofo_lock is set to false
if room.jicofo_lock == false or is_healthcheck_room(stanza.attr.from) then
if room._data.jicofo_lock == false or is_healthcheck_room(stanza.attr.from) then
return;
end

local occupant = event.occupant;
if ends_with(occupant.nick, '/focus') then
module:fire_event('jicofo-unlock-room', { room = room; });
else
room.jicofo_lock = true;
room._data.jicofo_lock = true;
if not room.pre_join_queue then
room.pre_join_queue = queue.new(QUEUE_MAX_SIZE);
end
Expand All @@ -108,7 +108,7 @@ end, 8); -- just after the rate limit
function handle_jicofo_unlock(event)
local room = event.room;

room.jicofo_lock = false;
room._data.jicofo_lock = false;
if not room.pre_join_queue then
return;
end
Expand Down

0 comments on commit 5ce2bef

Please sign in to comment.