From b5d2472b950a7854f41f921387bacbaf5ee58c5d Mon Sep 17 00:00:00 2001 From: Amardeep Date: Fri, 22 May 2026 02:17:52 +0530 Subject: [PATCH] count --- README.md | 3 ++- prosody-plugins/mod_politictalk_roles.lua | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 15a98b3..76682b2 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,8 @@ The `politictalk_roles` Prosody module should be configured with the PgApi inactive-room and occupancy callbacks from `templates/prosody-token-auth.cfg.lua.example`. The inactive callback clears the 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 diff --git a/prosody-plugins/mod_politictalk_roles.lua b/prosody-plugins/mod_politictalk_roles.lua index 7904268..ea5b426 100644 --- a/prosody-plugins/mod_politictalk_roles.lua +++ b/prosody-plugins/mod_politictalk_roles.lua @@ -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) );