Sync call link call history

This commit is contained in:
ayumi-signal 2024-04-25 10:09:05 -07:00 committed by GitHub
parent ce83195170
commit 2785501f82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 800 additions and 175 deletions

View file

@ -3,22 +3,32 @@
import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents';
import * as log from '../logging/log';
import { updateCallHistoryFromRemoteEvent } from './callDisposition';
import {
peerIdToLog,
updateCallHistoryFromRemoteEvent,
} from './callDisposition';
import { CallMode } from '../types/Calling';
export async function onCallEventSync(
syncEvent: CallEventSyncEvent
): Promise<void> {
const { callEvent, confirm } = syncEvent;
const { callEventDetails, receivedAtCounter } = callEvent;
const { peerId } = callEventDetails;
const conversation = window.ConversationController.get(peerId);
if (
callEventDetails.mode === CallMode.Direct ||
callEventDetails.mode === CallMode.Group
) {
const { peerId } = callEventDetails;
const conversation = window.ConversationController.get(peerId);
if (!conversation) {
log.warn(
`onCallEventSync: No conversation found for conversationId ${peerId}`
);
return;
if (!conversation) {
const peerIdLog = peerIdToLog(peerId, callEventDetails.mode);
log.warn(
`onCallEventSync: No conversation found for conversationId ${peerIdLog}`
);
return;
}
}
await updateCallHistoryFromRemoteEvent(callEventDetails, receivedAtCounter);