Ensure that calls ring at more appropriate times

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2024-11-04 13:32:43 -06:00 committed by GitHub
parent 6af74b2fd8
commit 125e1b1003
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 1 deletions

View file

@ -2950,6 +2950,19 @@ export class CallingClass {
localCallEvent,
'CallingClass.handleAutoEndedIncomingCallRequest'
);
if (!this.reduxInterface) {
log.error(
'handleAutoEndedIncomingCallRequest: Unable to update redux for call'
);
}
this.reduxInterface?.callStateChange({
acceptedTime: null,
callEndedReason,
callState: CallState.Ended,
conversationId: conversation.id,
});
await updateCallHistoryFromLocalEvent(
callEvent,
receivedAtCounter ?? null,

View file

@ -38,6 +38,13 @@ export const getRingingCall = (
return false;
}
if (
activeCallState?.state === 'Active' &&
activeCallState.conversationId !== call.conversationId
) {
return false;
}
return isRinging(call.callState) && call.callEndedReason == null;
});
@ -50,11 +57,18 @@ export const getRingingCall = (
return false;
}
if (
activeCallState?.state === 'Active' &&
activeCallState.conversationId !== call.conversationId
) {
return false;
}
// Outgoing - ringerAci is not set for outgoing group calls
if (
activeCallState?.state === 'Active' &&
activeCallState.outgoingRing &&
activeCallState.conversationId === call.conversationId &&
activeCallState.outgoingRing &&
isConnected(call.connectionState) &&
isJoined(call.joinState) &&
!hasRemoteParticipants(call.remoteParticipants)