mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-18 15:45:39 +01:00
Calls Tab & Group Call Disposition
This commit is contained in:
26
ts/util/onCallLogEventSync.ts
Normal file
26
ts/util/onCallLogEventSync.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents';
|
||||
import * as log from '../logging/log';
|
||||
import { CallLogEvent } from '../types/CallDisposition';
|
||||
import { missingCaseError } from './missingCaseError';
|
||||
|
||||
export async function onCallLogEventSync(
|
||||
syncEvent: CallLogEventSyncEvent
|
||||
): Promise<void> {
|
||||
const { callLogEvent, confirm } = syncEvent;
|
||||
const { event, timestamp } = callLogEvent;
|
||||
|
||||
log.info(
|
||||
`onCallLogEventSync: Processing event (Event: ${event}, Timestamp: ${timestamp})`
|
||||
);
|
||||
|
||||
if (event === CallLogEvent.Clear) {
|
||||
log.info(`onCallLogEventSync: Clearing call history before ${timestamp}`);
|
||||
await window.Signal.Data.clearCallHistory(timestamp);
|
||||
confirm();
|
||||
} else {
|
||||
throw missingCaseError(event);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user