From aefdb84ce6e5e5dc911c6e2ac6270848d25075bc Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:50:13 +0900 Subject: [PATCH] fix: allParticipants return identity instead of sid --- Sources/LiveKit/Core/Room+Convenience.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/LiveKit/Core/Room+Convenience.swift b/Sources/LiveKit/Core/Room+Convenience.swift index 747472b0f..07a53e655 100644 --- a/Sources/LiveKit/Core/Room+Convenience.swift +++ b/Sources/LiveKit/Core/Room+Convenience.swift @@ -17,10 +17,11 @@ import Foundation public extension Room { - var allParticipants: [Sid: Participant] { - var result: [Sid: Participant] = remoteParticipants - if !localParticipant.sid.isEmpty { - result.updateValue(localParticipant, forKey: localParticipant.sid) + /// Returns a dictionary containing both local and remote participants. + var allParticipants: [Identity: Participant] { + var result: [Identity: Participant] = remoteParticipants + if !localParticipant.identity.isEmpty { + result.updateValue(localParticipant, forKey: localParticipant.identity) } return result }