feat(ui): handle PresenceList in lobby — show online users

The lobby now populates from PresenceList signal events:
- Relay broadcasts user list on register/deregister
- JS receives "presence_list" signal-event
- Updates lobbyUsers map (excluding self)
- Renders user rows with identicon, name, fingerprint

Users appear in the lobby as soon as they register their
signal channel — no need to join voice first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-04-14 18:13:45 +04:00
parent 18c204c1ff
commit cc23e829b2

View File

@@ -435,6 +435,20 @@ async function pollStatus() {
listen("signal-event", (event: any) => {
const data = event.payload;
switch (data.type) {
case "presence_list":
// Relay sent updated user list
lobbyUsers.clear();
for (const u of data.users || []) {
if (u.fingerprint === myFingerprint) continue; // don't show self
lobbyUsers.set(u.fingerprint, {
fingerprint: u.fingerprint,
alias: u.alias || null,
inVoice: false,
speaking: false,
});
}
renderLobbyUsers();
break;
case "ringing":
// We placed a call, it's ringing
break;