Make an IsDisconnected interface and use it (#1278)

This commit is contained in:
Raja Subramanian
2022-12-31 12:53:02 +05:30
committed by GitHub
parent 9b8311ffcb
commit 4ba7e57683
7 changed files with 86 additions and 81 deletions
+1 -6
View File
@@ -398,7 +398,7 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
}
// send broadcast only if it's not already closed
sendUpdates := p.State() != livekit.ParticipantInfo_DISCONNECTED
sendUpdates := !p.IsDisconnected()
p.OnTrackUpdated(nil)
p.OnTrackPublished(nil)
@@ -873,11 +873,6 @@ func (r *Room) broadcastParticipantState(p types.LocalParticipant, opts broadcas
func (r *Room) sendParticipantUpdates(updates []*livekit.ParticipantInfo) {
for _, op := range r.GetParticipants() {
// skip closed participants
if op.State() == livekit.ParticipantInfo_DISCONNECTED {
continue
}
err := op.SendParticipantUpdate(updates)
if err != nil {
r.Logger.Errorw("could not send update to participant", err,