Expire Timer: If we generated change, don't mark unread
This commit is contained in:
parent
6a1b6f2e44
commit
56ffd7bc3f
4 changed files with 16 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -2663,7 +2663,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
// point and these calls will return early.
|
||||
if (dataMessage.expireTimer) {
|
||||
conversation.updateExpirationTimer(dataMessage.expireTimer, {
|
||||
source,
|
||||
source: sourceUuid || source,
|
||||
receivedAt: message.get('received_at'),
|
||||
receivedAtMS: message.get('received_at_ms'),
|
||||
sentAt: message.get('sent_at'),
|
||||
|
@ -2676,7 +2676,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
!isEndSession(message.attributes)
|
||||
) {
|
||||
conversation.updateExpirationTimer(undefined, {
|
||||
source,
|
||||
source: sourceUuid || source,
|
||||
receivedAt: message.get('received_at'),
|
||||
receivedAtMS: message.get('received_at_ms'),
|
||||
sentAt: message.get('sent_at'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue