Fix unintended unread notification

This commit is contained in:
ayumi-signal 2024-01-11 16:40:39 -08:00 committed by GitHub
parent c126ca1016
commit c3326b7885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {