(feat): update room metadata

(qol): update todos
This commit is contained in:
Alois 2026-05-01 15:02:05 +02:00
commit b49e96a458
5 changed files with 8 additions and 7 deletions

View file

@ -48,7 +48,7 @@ function Overlay({
user: User;
participant: Participant;
}) {
const isAdmin = getRoomMetadata()?.admin === user.user_id;
const isAdmin = getRoomMetadata()?.admins.includes(user.user_id) === true;
const isDeafened = participant.attributes["deafened"] === "true";
return (

View file

@ -470,12 +470,11 @@ function requireRuntime(runtime: Runtime | null): Runtime {
export function getRoomMetadata() {
const roomMetadata = room.metadata;
log(3, "call", "purple", "Room metadata:", { roomMetadata });
try {
const data = JSON.parse(roomMetadata || '{"admin": 0}');
return data as { admin: number };
const data = JSON.parse(roomMetadata || '{"admins": []}');
return data as { admins: number[] };
} catch {
return { admin: 0 };
return { admins: [] };
}
}

View file

@ -8,3 +8,6 @@
- Save call invite in `calls` array
- Sounds
- Fullscreen button for screenshares
- Admin call actions
- Timeout
- Disconnect

1
packages/chat/todo.md Normal file
View file

@ -0,0 +1 @@
- Mobile message box broken

View file

@ -1,2 +0,0 @@
- Handle live messages in notification context
- Mobile message box broken