Do not send hidden participants after resume (#1689)
This commit is contained in:
+14
-1
@@ -412,7 +412,8 @@ func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing
|
||||
return err
|
||||
}
|
||||
|
||||
updates := ToProtoParticipants(r.GetParticipants())
|
||||
// include the local participant's info as well, since metadata could have been changed
|
||||
updates := r.getOtherParticipantInfo("")
|
||||
if err := p.SendParticipantUpdate(updates); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -730,6 +731,18 @@ func (r *Room) SimulateScenario(participant types.LocalParticipant, simulateScen
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Room) getOtherParticipantInfo(identity livekit.ParticipantIdentity) []*livekit.ParticipantInfo {
|
||||
participants := r.GetParticipants()
|
||||
pi := make([]*livekit.ParticipantInfo, 0, len(participants))
|
||||
for _, p := range participants {
|
||||
if !p.Hidden() && p.Identity() != identity {
|
||||
pi = append(pi, p.ToProto())
|
||||
}
|
||||
}
|
||||
|
||||
return pi
|
||||
}
|
||||
|
||||
// checks if participant should be autosubscribed to new tracks, assumes lock is already acquired
|
||||
func (r *Room) autoSubscribe(participant types.LocalParticipant) bool {
|
||||
opts := r.participantOpts[participant.Identity()]
|
||||
|
||||
Reference in New Issue
Block a user