Expect livekit identity not pubkey in 39004

This commit is contained in:
mplorentz
2026-03-13 10:54:19 -04:00
parent 451a5d5130
commit b54ec90b33
+7 -6
View File
@@ -4,7 +4,7 @@
*/ */
import {DisconnectReason, Room, RoomEvent, Track} from "livekit-client" import {DisconnectReason, Room, RoomEvent, Track} from "livekit-client"
import {derived, get, writable} from "svelte/store" import {derived, get, writable} from "svelte/store"
import {uniqBy} from "@welshman/lib" import {map, removeUndefined, uniqBy} from "@welshman/lib"
import type {TrustedEvent} from "@welshman/util" import type {TrustedEvent} from "@welshman/util"
import {makeHttpAuth, makeHttpAuthHeader, getTags} from "@welshman/util" import {makeHttpAuth, makeHttpAuthHeader, getTags} from "@welshman/util"
import {signer} from "@welshman/app" import {signer} from "@welshman/app"
@@ -117,11 +117,12 @@ export const deriveVoiceParticipants = (url: string, h: string) =>
} else { } else {
const latestEvent = $publishedParticipantList as TrustedEvent | undefined const latestEvent = $publishedParticipantList as TrustedEvent | undefined
if (!latestEvent) return [] if (!latestEvent) return []
const participants = getTags("participant", latestEvent.tags).map((tag: string[]) => { const participants = removeUndefined(
const pubkey = tag[1] map(
const identity = tag[2] ?? pubkey (tag: string[]) => (tag[1] ? participantFromLiveKitIdentity(tag[1]) : undefined),
return pubkey ? {pubkey, identity} : {identity} getTags("participant", latestEvent.tags),
}) ),
)
return uniqBy((p: VoiceParticipant) => participantKey(p), participants) return uniqBy((p: VoiceParticipant) => participantKey(p), participants)
} }
}, },