From df8ee8b13dfa295518838943a687d76c756cb4fc Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:34:05 -0500 Subject: [PATCH] addMessageRequestResponseMessage: Don't update active_at on initial sync Co-authored-by: Scott Nonnenberg --- ts/models/conversations.ts | 3 ++- ts/services/contactSync.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 02f2a8a34b0b..7dd4f0f05376 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -188,6 +188,7 @@ import { explodePromise } from '../util/explodePromise'; import { getCallHistorySelector } from '../state/selectors/callHistory'; import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus'; import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes'; +import { getIsInitialSync } from '../services/contactSync'; /* eslint-disable more/no-then */ window.Whisper = window.Whisper || {}; @@ -2344,7 +2345,7 @@ export class ConversationModel extends window.Backbone ourAci: window.textsecure.storage.user.getCheckedAci(), forceSave: true, }); - if (!this.get('active_at')) { + if (!getIsInitialSync() && !this.get('active_at')) { this.set({ active_at: Date.now() }); await DataWriter.updateConversation(this.attributes); } diff --git a/ts/services/contactSync.ts b/ts/services/contactSync.ts index 715b590552f2..8feb28074d73 100644 --- a/ts/services/contactSync.ts +++ b/ts/services/contactSync.ts @@ -32,6 +32,9 @@ export function setIsInitialSync(newValue: boolean): void { log.info(`setIsInitialSync(${newValue})`); isInitialSync = newValue; } +export function getIsInitialSync(): boolean { + return isInitialSync; +} async function updateConversationFromContactSync( conversation: ConversationModel,