Check participant SID also while removing a participant. (#1237)

This commit is contained in:
Raja Subramanian
2022-12-19 22:53:11 +05:30
committed by GitHub
parent e6bbf07089
commit 50e39b9985
6 changed files with 30 additions and 21 deletions
+3 -2
View File
@@ -242,7 +242,7 @@ func (r *RoomManager) StartSession(
} else {
participant.GetLogger().Infow("removing duplicate participant")
// we need to clean up the existing participant, so a new one can join
room.RemoveParticipant(participant.Identity(), types.ParticipantCloseReasonDuplicateIdentity)
room.RemoveParticipant(participant.Identity(), participant.ID(), types.ParticipantCloseReasonDuplicateIdentity)
}
} else if pi.Reconnect {
// send leave request if participant is trying to reconnect without keep subscribe state
@@ -541,7 +541,8 @@ func (r *RoomManager) handleRTCMessage(ctx context.Context, roomName livekit.Roo
return
}
pLogger.Infow("removing participant")
room.RemoveParticipant(identity, types.ParticipantCloseReasonServiceRequestRemoveParticipant)
// remove participant by identity, any SID
room.RemoveParticipant(identity, "", types.ParticipantCloseReasonServiceRequestRemoveParticipant)
case *livekit.RTCNodeMessage_MuteTrack:
if participant == nil {
return