diff --git a/ts/messageModifiers/ViewSyncs.ts b/ts/messageModifiers/ViewSyncs.ts index 21838542a..4a5a3cba6 100644 --- a/ts/messageModifiers/ViewSyncs.ts +++ b/ts/messageModifiers/ViewSyncs.ts @@ -90,8 +90,10 @@ export class ViewSyncs extends Collection { notificationService.removeBy({ messageId: found.id }); const message = window.MessageController.register(found.id, found); + let didChangeMessage = false; if (message.get('readStatus') !== ReadStatus.Viewed) { + didChangeMessage = true; message.set(markViewed(message.attributes, sync.get('viewedAt'))); const attachments = message.get('attachments'); @@ -102,6 +104,7 @@ export class ViewSyncs extends Collection { const giftBadge = message.get('giftBadge'); if (giftBadge) { + didChangeMessage = true; message.set({ giftBadge: { ...giftBadge, @@ -112,6 +115,10 @@ export class ViewSyncs extends Collection { }); } + if (didChangeMessage) { + window.Signal.Util.queueUpdateMessage(message.attributes); + } + this.remove(sync); } catch (error) { log.error('ViewSyncs.onSync error:', Errors.toLogFormat(error));