Only ring when participating in call end

This commit is contained in:
Jamie Kyle 2023-06-12 17:26:46 -07:00 committed by GitHub
parent adc0fb9d0d
commit ea92bd5f6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(