From cb8704f9b15afc0ca9e7ef41b19541360d6b9cd6 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 6 Jan 2022 11:22:54 +1100 Subject: [PATCH] bump convo active_at on answered/trigger call --- ts/session/utils/calling/CallManager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/session/utils/calling/CallManager.ts b/ts/session/utils/calling/CallManager.ts index b8f5e4a10..75c4f231d 100644 --- a/ts/session/utils/calling/CallManager.ts +++ b/ts/session/utils/calling/CallManager.ts @@ -491,6 +491,8 @@ export async function USER_callRecipient(recipient: string) { window.log.info('Sending preOffer message to ', ed25519Str(recipient)); const calledConvo = getConversationController().get(recipient); + calledConvo.set('active_at', Date.now()); // addSingleMessage does the commit for us on the convo + await calledConvo?.addSingleMessage({ conversationId: calledConvo.id, source: UserUtils.getOurPubKeyStrFromCache(), @@ -820,6 +822,7 @@ export async function USER_acceptIncomingCallRequest(fromSender: string) { } const now = Date.now(); const callerConvo = getConversationController().get(fromSender); + callerConvo.set('active_at', now); await callerConvo?.addSingleMessage({ conversationId: callerConvo.id, source: UserUtils.getOurPubKeyStrFromCache(), @@ -1130,6 +1133,10 @@ export async function handleMissedCall( async function addMissedCallMessage(callerPubkey: string, sentAt: number) { const incomingCallConversation = getConversationController().get(callerPubkey); + if (incomingCallConversation.isActive()) { + incomingCallConversation.set('active_at', Date.now()); + } + await incomingCallConversation?.addSingleMessage({ conversationId: callerPubkey, source: callerPubkey,