[rooms] keep invited roles on the roles endpoint for the permissions list

This commit is contained in:
Devin Zuczek
2026-10-26 18:25:06 -04:00
parent f2c16f198a
commit 207138ef97
3 changed files with 31 additions and 35 deletions
-12
View File
@@ -304,18 +304,6 @@ function holdsRole(entry: unknown): boolean {
return Number((entry as Partial<RoomRole>).Role ?? Role.None) !== Role.None
}
/**
* A room's HELD roles — {@link roomRoles} without the pending invites. What the client is
* shown as the room's role list: an invited player has no standing in the room until they
* accept, and listing them as a member with `Role` 0 showed them on the room's member list
* before they had agreed to anything. The offer reaches them as a `RoomCoOwnerInvited`
* message instead, and the entry itself stays in the stored room for
* {@link answerRoomRoleInvite} to promote.
*/
export function confirmedRoomRoles(room: Room): RoomRole[] {
return roomRoles(room).filter((r) => r.Role !== Role.None)
}
/**
* The room as SERVED, with pending invites dropped from its `Roles` — a shallow copy; the
* room passed in is untouched, so a caller can keep writing from it. Entries are kept in the