Ensure that calls ring at more appropriate times
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
6af74b2fd8
commit
125e1b1003
2 changed files with 28 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue