Skip to content

Commit

Permalink
Remove pins when user leaves the call
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Nov 15, 2023
1 parent 394d505 commit a518f18
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,24 @@ public class CallState(
}

is ParticipantLeftEvent -> {
removeParticipant(event.participant.session_id)
val sessionId = event.participant.session_id
removeParticipant(sessionId)

// clean up - stop screen-sharing session if it was still running
val current = _screenSharingSession.value
if (current?.participant?.sessionId == event.participant.session_id) {
if (current?.participant?.sessionId == sessionId) {
_screenSharingSession.value = null
}
if (_localPins.value.containsKey(sessionId)) {
// Remove any pins for the participant
unpin(sessionId)
}

if (_serverPins.value.containsKey(sessionId)) {
scope.launch {
call.unpinForEveryone(sessionId, event.participant.user_id)
}
}
}

is SubscriberOfferEvent -> {
Expand Down

0 comments on commit a518f18

Please sign in to comment.