Skip to content

Commit 22740c9

Browse files
committed
Don't restrict to Remote?
1 parent db6fe2e commit 22740c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/LiveKit/Agent/Room+Agent.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ import Foundation
1919
let publishOnBehalfAttributeKey = "lk.publish_on_behalf"
2020

2121
public extension Room {
22-
/// All agent participants in the Room
22+
/// Returns a dictionary containing all agent participants.
2323
@objc
24-
var agentParticipants: [Participant.Identity: RemoteParticipant] {
24+
var agentParticipants: [Participant.Identity: Participant] {
2525
// Filter out agents that are replaced by another agent e.g. avatar worker
26-
let onBehalfIdentities = Set(remoteParticipants.compactMap {
26+
let onBehalfIdentities = Set(allParticipants.compactMap {
2727
$0.value.attributes[publishOnBehalfAttributeKey]
2828
})
29-
return remoteParticipants.filter {
29+
return allParticipants.filter {
3030
$0.value.isAgent && !onBehalfIdentities.contains($0.key.stringValue)
3131
}
3232
}
3333

34-
/// The first agent participant in the Room
34+
/// Returns the first agent participant or `nil` if there are no agent participants.
3535
@objc
3636
var agentParticipant: Participant? {
3737
agentParticipants.values.first

0 commit comments

Comments
 (0)