Calls Tab & Group Call Disposition
This commit is contained in:
parent
620e85ca01
commit
1eaabb6734
139 changed files with 9182 additions and 2721 deletions
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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue