Expire Timer: If we generated change, don't mark unread

This commit is contained in:
Scott Nonnenberg 2022-09-06 16:52:07 -07:00 committed by GitHub
parent 6a1b6f2e44
commit 56ffd7bc3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 5 deletions

View file

@ -4428,7 +4428,9 @@ export class ConversationModel extends window.Backbone
}
}
source = source || window.ConversationController.getOurConversationId();
const ourConversationId =
window.ConversationController.getOurConversationId();
source = source || ourConversationId;
this.set({ expireTimer });
@ -4442,8 +4444,13 @@ export class ConversationModel extends window.Backbone
// to be above the message that initiated that change, hence the subtraction.
const sentAt = (providedSentAt || receivedAtMS) - 1;
const isFromSyncOperation =
reason === 'group sync' || reason === 'contact sync';
const isFromMe =
window.ConversationController.get(source)?.id === ourConversationId;
const isNoteToSelf = isMe(this.attributes);
const shouldBeRead = isNoteToSelf || isInitialSync;
const shouldBeRead =
(isInitialSync && isFromSyncOperation) || isFromMe || isNoteToSelf;
const model = new window.Whisper.Message({
conversationId: this.id,