From c3326b78850c874b5dfd758bb910bd7378121358 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:40:39 -0800 Subject: [PATCH] Fix unintended unread notification --- ts/models/conversations.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 7f9c12de73..f714e0254c 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -3100,16 +3100,15 @@ export class ConversationModel extends window.Backbone lastMessage ); - const shouldBeUnseen = !options.local && !verified; const timestamp = Date.now(); const message: MessageAttributesType = { id: generateGuid(), conversationId: this.id, local: Boolean(options.local), - readStatus: shouldBeUnseen ? ReadStatus.Unread : ReadStatus.Read, + readStatus: ReadStatus.Read, received_at_ms: timestamp, received_at: incrementMessageCounter(), - seenStatus: shouldBeUnseen ? SeenStatus.Unseen : SeenStatus.Unseen, + seenStatus: options.local ? SeenStatus.Seen : SeenStatus.Unseen, sent_at: lastMessage, timestamp, type: 'verified-change', @@ -3128,7 +3127,7 @@ export class ConversationModel extends window.Backbone ); this.trigger('newmessage', model); - void this.updateUnread(); + drop(this.updateUnread()); const serviceId = this.getServiceId(); if (isDirectConversation(this.attributes) && serviceId) {