From 65f369909332b81780a607bd0c1281ce1ed29f7d Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Fri, 14 May 2021 14:47:03 +1000 Subject: [PATCH 1/2] fix expiration timer not starting in conversation screen --- Session/Conversations/ConversationVC.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index b048216b8..f0aeb67fc 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -354,6 +354,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat // the previous value when the keyboard is shown. self.messagesTableView.reloadData() } + self.markAllAsRead() } if shouldAnimate { messagesTableView.performBatchUpdates(batchUpdates, completion: batchUpdatesCompletion) From d7a7abc11e004ff9a946987f8d05ab9f4d037a24 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Fri, 14 May 2021 15:38:06 +1000 Subject: [PATCH 2/2] start expiration timer after attachments downloaded --- .../Messages/Signal/TSIncomingMessage.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SessionMessagingKit/Messages/Signal/TSIncomingMessage.m b/SessionMessagingKit/Messages/Signal/TSIncomingMessage.m index e452327b3..908d53f42 100644 --- a/SessionMessagingKit/Messages/Signal/TSIncomingMessage.m +++ b/SessionMessagingKit/Messages/Signal/TSIncomingMessage.m @@ -144,6 +144,17 @@ NS_ASSUME_NONNULL_BEGIN return; } + BOOL isAllAttachmentDownloaded = YES; + for (NSString *attachmentId in self.attachmentIds) { + TSAttachment *attachment = [TSAttachment fetchObjectWithUniqueID:attachmentId transaction:transaction]; + isAllAttachmentDownloaded = isAllAttachmentDownloaded && attachment.isDownloaded; + if (!isAllAttachmentDownloaded) break; + } + + if (!isAllAttachmentDownloaded) { + return; + } + _read = YES; [self saveWithTransaction:transaction];