Fix unintended unread notification
This commit is contained in:
parent
c126ca1016
commit
c3326b7885
1 changed files with 3 additions and 4 deletions
|
@ -3100,16 +3100,15 @@ export class ConversationModel extends window.Backbone
|
||||||
lastMessage
|
lastMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
const shouldBeUnseen = !options.local && !verified;
|
|
||||||
const timestamp = Date.now();
|
const timestamp = Date.now();
|
||||||
const message: MessageAttributesType = {
|
const message: MessageAttributesType = {
|
||||||
id: generateGuid(),
|
id: generateGuid(),
|
||||||
conversationId: this.id,
|
conversationId: this.id,
|
||||||
local: Boolean(options.local),
|
local: Boolean(options.local),
|
||||||
readStatus: shouldBeUnseen ? ReadStatus.Unread : ReadStatus.Read,
|
readStatus: ReadStatus.Read,
|
||||||
received_at_ms: timestamp,
|
received_at_ms: timestamp,
|
||||||
received_at: incrementMessageCounter(),
|
received_at: incrementMessageCounter(),
|
||||||
seenStatus: shouldBeUnseen ? SeenStatus.Unseen : SeenStatus.Unseen,
|
seenStatus: options.local ? SeenStatus.Seen : SeenStatus.Unseen,
|
||||||
sent_at: lastMessage,
|
sent_at: lastMessage,
|
||||||
timestamp,
|
timestamp,
|
||||||
type: 'verified-change',
|
type: 'verified-change',
|
||||||
|
@ -3128,7 +3127,7 @@ export class ConversationModel extends window.Backbone
|
||||||
);
|
);
|
||||||
|
|
||||||
this.trigger('newmessage', model);
|
this.trigger('newmessage', model);
|
||||||
void this.updateUnread();
|
drop(this.updateUnread());
|
||||||
|
|
||||||
const serviceId = this.getServiceId();
|
const serviceId = this.getServiceId();
|
||||||
if (isDirectConversation(this.attributes) && serviceId) {
|
if (isDirectConversation(this.attributes) && serviceId) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue