Expect livekit identity not pubkey in 39004

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