token session added

This commit is contained in:
2026-05-26 23:36:49 +05:30
parent afffe831e4
commit 01994027b6

View File

@@ -229,6 +229,24 @@ local function get_active_host_count(room)
return count;
end
local function get_active_participant_user_ids(room)
if not room then
return {};
end
ensure_room_data(room);
local user_ids = {};
for _, occupant in room:each_occupant() do
if table_contains(room._data.politictalk_participant_jids, occupant.bare_jid) then
user_ids = add_unique(user_ids, room._data.politictalk_jid_user_ids[occupant.bare_jid]);
end
end
return user_ids;
end
local function get_occupant_count(room)
if not room then
return 0;
@@ -326,6 +344,7 @@ local function notify_room_occupancy(room, reason)
ensure_room_data(room);
local participant_count = table_count(room._data.politictalk_participant_jids);
local participant_user_ids = get_active_participant_user_ids(room);
local moderator_count = table_count(room._data.moderators);
local occupant_count = get_occupant_count(room);
local host_count = get_active_host_count(room);
@@ -341,6 +360,7 @@ local function notify_room_occupancy(room, reason)
reason = reason or "occupancy_changed";
roomJid = room.jid;
participantCount = participant_count;
participantUserIds = participant_user_ids;
moderatorCount = moderator_count;
occupantCount = occupant_count;
hostCount = host_count;