bump convo active_at on answered/trigger call

pull/2131/head
Audric Ackermann 3 years ago
parent 9bb19540a9
commit cb8704f9b1
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -491,6 +491,8 @@ export async function USER_callRecipient(recipient: string) {
window.log.info('Sending preOffer message to ', ed25519Str(recipient)); window.log.info('Sending preOffer message to ', ed25519Str(recipient));
const calledConvo = getConversationController().get(recipient); const calledConvo = getConversationController().get(recipient);
calledConvo.set('active_at', Date.now()); // addSingleMessage does the commit for us on the convo
await calledConvo?.addSingleMessage({ await calledConvo?.addSingleMessage({
conversationId: calledConvo.id, conversationId: calledConvo.id,
source: UserUtils.getOurPubKeyStrFromCache(), source: UserUtils.getOurPubKeyStrFromCache(),
@ -820,6 +822,7 @@ export async function USER_acceptIncomingCallRequest(fromSender: string) {
} }
const now = Date.now(); const now = Date.now();
const callerConvo = getConversationController().get(fromSender); const callerConvo = getConversationController().get(fromSender);
callerConvo.set('active_at', now);
await callerConvo?.addSingleMessage({ await callerConvo?.addSingleMessage({
conversationId: callerConvo.id, conversationId: callerConvo.id,
source: UserUtils.getOurPubKeyStrFromCache(), source: UserUtils.getOurPubKeyStrFromCache(),
@ -1130,6 +1133,10 @@ export async function handleMissedCall(
async function addMissedCallMessage(callerPubkey: string, sentAt: number) { async function addMissedCallMessage(callerPubkey: string, sentAt: number) {
const incomingCallConversation = getConversationController().get(callerPubkey); const incomingCallConversation = getConversationController().get(callerPubkey);
if (incomingCallConversation.isActive()) {
incomingCallConversation.set('active_at', Date.now());
}
await incomingCallConversation?.addSingleMessage({ await incomingCallConversation?.addSingleMessage({
conversationId: callerPubkey, conversationId: callerPubkey,
source: callerPubkey, source: callerPubkey,

Loading…
Cancel
Save