Sync call link call history
This commit is contained in:
parent
ce83195170
commit
2785501f82
26 changed files with 800 additions and 175 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue