Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only play leave sound when a call participant leaves
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Mar 26, 2021
commit 89cc62ce1015fb9a8bc104df4bb85314aec033d1
2 changes: 2 additions & 0 deletions src/utils/webrtc/models/CallParticipantCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ CallParticipantCollection.prototype = {
this._trigger('remove', [callParticipantModel])

callParticipantModel.destroy()
return true
}
return false
},

}
9 changes: 6 additions & 3 deletions src/utils/webrtc/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,16 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) {
disconnectedSessionIds.forEach(function(sessionId) {
console.debug('Remove disconnected peer', sessionId)
webrtc.removePeers(sessionId)
callParticipantCollection.remove(sessionId)

if (callParticipantCollection.remove(sessionId)) {
playLeaveSound = true
}

if (delayedConnectionToPeer[sessionId]) {
clearInterval(delayedConnectionToPeer[sessionId])
delete delayedConnectionToPeer[sessionId]
playLeaveSound = true
}

playLeaveSound = true
})

previousUsersInRoom = arrayDiff(previousUsersInRoom, disconnectedSessionIds)
Expand Down