Only ring when participating in call end
This commit is contained in:
parent
adc0fb9d0d
commit
ea92bd5f6f
1 changed files with 12 additions and 1 deletions
|
@ -726,7 +726,6 @@ function callStateChange(
|
|||
} = payload;
|
||||
|
||||
if (callState === CallState.Ended) {
|
||||
await callingTones.playEndCall();
|
||||
ipcRenderer.send('close-screen-share-controller');
|
||||
}
|
||||
|
||||
|
@ -748,6 +747,18 @@ function callStateChange(
|
|||
const isOutgoingRemoteHangup = isOutgoing && isRemoteHangup && notAnswered;
|
||||
const isIncomingRemoteHangup = isIncoming && isRemoteHangup && notAnswered;
|
||||
|
||||
// Play the hangup noise if:
|
||||
if (
|
||||
// 1. I hungup (or declined)
|
||||
(isEnded && isLocalHangup) ||
|
||||
// 2. I answered and then the call ended
|
||||
(isEnded && wasAccepted) ||
|
||||
// 3. I called and they declined
|
||||
(isEnded && !wasAccepted && isRemoteHangup)
|
||||
) {
|
||||
await callingTones.playEndCall();
|
||||
}
|
||||
|
||||
if (isIncomingRemoteHangup) {
|
||||
// This is considered just another "missed" event
|
||||
log.info(
|
||||
|
|
Loading…
Reference in a new issue