Ensure that calls ring at more appropriate times

This commit is contained in:
Scott Nonnenberg 2024-11-05 04:05:53 +10:00 committed by GitHub
parent ec9041937f
commit 1620ccf3ab
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, localCallEvent,
'CallingClass.handleAutoEndedIncomingCallRequest' '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( await updateCallHistoryFromLocalEvent(
callEvent, callEvent,
receivedAtCounter ?? null, receivedAtCounter ?? null,

View file

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