count
This commit is contained in:
@@ -146,7 +146,8 @@ The `politictalk_roles` Prosody module should be configured with the PgApi
|
|||||||
inactive-room and occupancy callbacks from
|
inactive-room and occupancy callbacks from
|
||||||
`templates/prosody-token-auth.cfg.lua.example`. The inactive callback clears the
|
`templates/prosody-token-auth.cfg.lua.example`. The inactive callback clears the
|
||||||
event `meetingCode` when the last host leaves, and the occupancy callback keeps
|
event `meetingCode` when the last host leaves, and the occupancy callback keeps
|
||||||
the platform room cards updated with the current participant count.
|
the platform room cards updated with the current room occupancy count, including
|
||||||
|
the host.
|
||||||
|
|
||||||
## Token Auth Rollout
|
## Token Auth Rollout
|
||||||
|
|
||||||
|
|||||||
@@ -384,15 +384,17 @@ module:hook("muc-occupant-pre-join", function(event)
|
|||||||
ensure_room_data(room);
|
ensure_room_data(room);
|
||||||
local participant_limit = get_participant_limit(session);
|
local participant_limit = get_participant_limit(session);
|
||||||
local active_participant_count = table_count(room._data.politictalk_participant_jids);
|
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
|
if
|
||||||
participant_limit
|
participant_limit
|
||||||
and active_participant_count >= participant_limit
|
and active_room_occupancy_count >= participant_limit
|
||||||
then
|
then
|
||||||
module:log(
|
module:log(
|
||||||
"warn",
|
"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(user_id),
|
||||||
tostring(room and room.jid),
|
tostring(room and room.jid),
|
||||||
|
tostring(active_room_occupancy_count),
|
||||||
tostring(active_participant_count),
|
tostring(active_participant_count),
|
||||||
tostring(participant_limit)
|
tostring(participant_limit)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user