Skip to content

Commit

Permalink
fix: allParticipants return identity instead of sid
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Dec 11, 2023
1 parent be48ea9 commit aefdb84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/LiveKit/Core/Room+Convenience.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit aefdb84

Please sign in to comment.