count
This commit is contained in:
@@ -384,15 +384,17 @@ module:hook("muc-occupant-pre-join", function(event)
|
||||
ensure_room_data(room);
|
||||
local participant_limit = get_participant_limit(session);
|
||||
local active_participant_count = table_count(room._data.politictalk_participant_jids);
|
||||
local active_room_occupancy_count = active_participant_count + get_active_host_count(room);
|
||||
if
|
||||
participant_limit
|
||||
and active_participant_count >= participant_limit
|
||||
and active_room_occupancy_count >= participant_limit
|
||||
then
|
||||
module:log(
|
||||
"warn",
|
||||
"Blocking participant %s because PoliticTalk room is full: room=%s active=%s limit=%s",
|
||||
"Blocking participant %s because PoliticTalk room is full: room=%s active=%s participantSeats=%s limit=%s",
|
||||
tostring(user_id),
|
||||
tostring(room and room.jid),
|
||||
tostring(active_room_occupancy_count),
|
||||
tostring(active_participant_count),
|
||||
tostring(participant_limit)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user