Use normal shutdown infrastructure to hang up active calls
This commit is contained in:
parent
c4ddd3977d
commit
7e1c147eac
3 changed files with 11 additions and 10 deletions
|
@ -2000,10 +2000,6 @@ app.on('before-quit', () => {
|
||||||
|
|
||||||
systemTrayService?.markShouldQuit();
|
systemTrayService?.markShouldQuit();
|
||||||
windowState.markShouldQuit();
|
windowState.markShouldQuit();
|
||||||
|
|
||||||
if (mainWindow) {
|
|
||||||
mainWindow.webContents.send('quit');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Quit when all windows are closed.
|
// Quit when all windows are closed.
|
||||||
|
|
|
@ -723,6 +723,11 @@ export async function startApp(): Promise<void> {
|
||||||
|
|
||||||
flushMessageCounter();
|
flushMessageCounter();
|
||||||
|
|
||||||
|
// Hangup active calls
|
||||||
|
window.Signal.Services.calling.hangupAllCalls(
|
||||||
|
'background/shutdown: shutdown requested'
|
||||||
|
);
|
||||||
|
|
||||||
// Stop background processing
|
// Stop background processing
|
||||||
void AttachmentDownloads.stop();
|
void AttachmentDownloads.stop();
|
||||||
idleDetector.stop();
|
idleDetector.stop();
|
||||||
|
|
|
@ -359,12 +359,6 @@ export class CallingClass {
|
||||||
reduxInterface.setPresenting();
|
reduxInterface.setPresenting();
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('quit', () => {
|
|
||||||
for (const conversationId of Object.keys(this.callsByConversation)) {
|
|
||||||
this.hangup(conversationId, 'ipcRenderer quit');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
void this.cleanExpiredGroupCallRingsAndLoop();
|
void this.cleanExpiredGroupCallRingsAndLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1166,6 +1160,12 @@ export class CallingClass {
|
||||||
log.info('hangup: Done.');
|
log.info('hangup: Done.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hangupAllCalls(reason: string): void {
|
||||||
|
for (const conversationId of Object.keys(this.callsByConversation)) {
|
||||||
|
this.hangup(conversationId, reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setOutgoingAudio(conversationId: string, enabled: boolean): void {
|
setOutgoingAudio(conversationId: string, enabled: boolean): void {
|
||||||
const call = getOwn(this.callsByConversation, conversationId);
|
const call = getOwn(this.callsByConversation, conversationId);
|
||||||
if (!call) {
|
if (!call) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue