Calls Tab & Group Call Disposition
This commit is contained in:
parent
620e85ca01
commit
1eaabb6734
139 changed files with 9182 additions and 2721 deletions
|
@ -3,47 +3,24 @@
|
|||
|
||||
import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents';
|
||||
import * as log from '../logging/log';
|
||||
import { CallMode } from '../types/Calling';
|
||||
import { updateCallHistoryFromRemoteEvent } from './callDisposition';
|
||||
|
||||
export async function onCallEventSync(
|
||||
syncEvent: CallEventSyncEvent
|
||||
): Promise<void> {
|
||||
const { callEvent, confirm } = syncEvent;
|
||||
const {
|
||||
peerUuid,
|
||||
callId,
|
||||
wasIncoming,
|
||||
wasVideoCall,
|
||||
wasDeclined,
|
||||
acceptedTime,
|
||||
endedTime,
|
||||
receivedAtCounter,
|
||||
} = callEvent;
|
||||
const { callEventDetails, receivedAtCounter } = callEvent;
|
||||
const { peerId } = callEventDetails;
|
||||
|
||||
const conversation = window.ConversationController.get(peerUuid);
|
||||
const conversation = window.ConversationController.get(peerId);
|
||||
|
||||
if (!conversation) {
|
||||
log.warn(`onCallEventSync: No conversation found for peerUuid ${peerUuid}`);
|
||||
log.warn(
|
||||
`onCallEventSync: No conversation found for conversationId ${peerId}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
log.info(
|
||||
`onCallEventSync: Queuing job to add call history (Call ID: ${callId})`
|
||||
);
|
||||
await conversation.queueJob('onCallEventSync', async () => {
|
||||
await conversation.addCallHistory(
|
||||
{
|
||||
callId,
|
||||
callMode: CallMode.Direct,
|
||||
wasDeclined,
|
||||
wasIncoming,
|
||||
wasVideoCall,
|
||||
acceptedTime: acceptedTime ?? undefined,
|
||||
endedTime: endedTime ?? undefined,
|
||||
},
|
||||
receivedAtCounter
|
||||
);
|
||||
|
||||
confirm();
|
||||
});
|
||||
await updateCallHistoryFromRemoteEvent(callEventDetails, receivedAtCounter);
|
||||
confirm();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue