Add unique member count to status command. (#663)

This commit is contained in:
Gnuxie authored and GitHub committed 2025-01-10 17:24:11 +00:00
1 parent fa5ce9ad9c
commit c0d4627c62
1 file changed
+6
+6
View File
@@ -42,6 +42,7 @@ export interface ListInfo {
export interface StatusInfo {
numberOfProtectedRooms: number;
numberOfUniqueMembers: number;
subscribedLists: ListInfo[];
subscribedAndProtectedLists: ListInfo[];
version: string;
@@ -112,6 +113,8 @@ export async function draupnirStatusInfo(
);
return {
numberOfProtectedRooms: draupnir.protectedRoomsSet.allProtectedRooms.length,
numberOfUniqueMembers:
draupnir.protectedRoomsSet.setMembership.currentRevision.uniqueMemberCount(),
subscribedLists: unprotectedListProfiles,
subscribedAndProtectedLists: protectedWatchedLists,
documentationURL: DOCUMENTATION_URL,
@@ -157,6 +160,9 @@ export function renderStatusInfo(info: StatusInfo): DocumentNode {
<b>Protected Rooms: </b>
{info.numberOfProtectedRooms}
<br />
<b>Protected Users: </b>
{info.numberOfUniqueMembers}
<br />
{renderPolicyLists("Subscribed policy rooms", info.subscribedLists)}
{renderPolicyLists(
"Subscribed and protected policy rooms",