mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Shutdown: Don't hang up ringing incoming calls
Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
+4
-3
@@ -758,9 +758,10 @@ export async function startApp(): Promise<void> {
|
||||
flushMessageCounter();
|
||||
|
||||
// Hangup active calls
|
||||
window.Signal.Services.calling.hangupAllCalls(
|
||||
'background/shutdown: shutdown requested'
|
||||
);
|
||||
window.Signal.Services.calling.hangupAllCalls({
|
||||
excludeRinging: true,
|
||||
reason: 'background/shutdown: shutdown requested',
|
||||
});
|
||||
|
||||
const attachmentDownloadStopPromise = AttachmentDownloadManager.stop();
|
||||
const attachmentBackupStopPromise = AttachmentBackupManager.stop();
|
||||
|
||||
+27
-4
@@ -2162,7 +2162,15 @@ export class CallingClass {
|
||||
);
|
||||
}
|
||||
|
||||
hangup(conversationId: string, reason: string): void {
|
||||
hangup({
|
||||
conversationId,
|
||||
excludeRinging,
|
||||
reason,
|
||||
}: {
|
||||
conversationId: string;
|
||||
excludeRinging?: boolean;
|
||||
reason: string;
|
||||
}): void {
|
||||
const logId = getLogId({
|
||||
source: 'CallingClass.hangup',
|
||||
conversationId,
|
||||
@@ -2191,7 +2199,16 @@ export class CallingClass {
|
||||
this.videoRenderer.disable();
|
||||
call.setOutgoingAudioMuted(true);
|
||||
call.setOutgoingVideoMuted(true);
|
||||
RingRTC.hangup(call.callId);
|
||||
|
||||
if (
|
||||
excludeRinging &&
|
||||
call.state === CallState.Ringing &&
|
||||
call.isIncoming
|
||||
) {
|
||||
log.info(`${logId}: Refusing to hang up call that is still ringing`);
|
||||
} else {
|
||||
RingRTC.hangup(call.callId);
|
||||
}
|
||||
} else if (call instanceof GroupCall) {
|
||||
// This ensures that we turn off our devices.
|
||||
call.setOutgoingAudioMuted(true);
|
||||
@@ -2205,10 +2222,16 @@ export class CallingClass {
|
||||
log.info(`${logId}: Done.`);
|
||||
}
|
||||
|
||||
hangupAllCalls(reason: string): void {
|
||||
hangupAllCalls({
|
||||
excludeRinging,
|
||||
reason,
|
||||
}: {
|
||||
excludeRinging: boolean;
|
||||
reason: string;
|
||||
}): void {
|
||||
const conversationIds = Object.keys(this.#callsLookup);
|
||||
for (const conversationId of conversationIds) {
|
||||
this.hangup(conversationId, reason);
|
||||
this.hangup({ conversationId, excludeRinging, reason });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1653,7 +1653,7 @@ function hangUpActiveCall(
|
||||
|
||||
const { conversationId } = activeCall;
|
||||
|
||||
calling.hangup(conversationId, reason);
|
||||
calling.hangup({ conversationId, reason });
|
||||
|
||||
dispatch({
|
||||
type: HANG_UP,
|
||||
|
||||
@@ -2700,7 +2700,10 @@ export function cancelConversationVerification(
|
||||
activeCall.conversationId === conversationId &&
|
||||
activeCall.callMode === CallMode.Direct
|
||||
) {
|
||||
calling.hangup(conversationId, 'canceled conversation verification');
|
||||
calling.hangup({
|
||||
conversationId,
|
||||
reason: 'canceled conversation verification',
|
||||
});
|
||||
}
|
||||
conversationJobQueue.resolveVerificationWaiter(conversationId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user