From f9f06625581c90ad121a2fc94ce4e3f191e80883 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Fri, 1 Jul 2022 13:59:50 +1000 Subject: [PATCH] Removed an import for file deleted as part of the iOS 13 min version changes Fixed a bug where opening a conversation by tapping a notification wouldn't mark the conversation messages as read --- Session/Conversations/ConversationVC.swift | 9 +++++---- SignalUtilitiesKit/Meta/SignalUtilitiesKit.h | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 59e6c81e0..bddae7992 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -424,7 +424,6 @@ final class ConversationVC: BaseVC, OWSConversationSettingsViewDelegate, Convers } } - viewModel.markAllAsRead() recoverInputView() } @@ -580,8 +579,11 @@ final class ConversationVC: BaseVC, OWSConversationSettingsViewDelegate, Convers snInputView.text = draft } - // Now we have done all the needed diffs, update the viewModel with the latest data + // Now we have done all the needed diffs, update the viewModel with the latest data and mark + // all messages as read (we do it in here as the 'threadData' actually contains the last + // 'interactionId' for the thread) self.viewModel.updateThreadData(updatedThreadData) + self.viewModel.markAllAsRead() /// **Note:** This needs to happen **after** we have update the viewModel's thread data if initialLoad || viewModel.threadData.currentUserIsClosedGroupMember != updatedThreadData.currentUserIsClosedGroupMember { @@ -608,9 +610,8 @@ final class ConversationVC: BaseVC, OWSConversationSettingsViewDelegate, Convers return } - // Mark received messages as read + // Store the 'sentMessageBeforeUpdate' state locally let didSendMessageBeforeUpdate: Bool = self.viewModel.sentMessageBeforeUpdate - self.viewModel.markAllAsRead() self.viewModel.sentMessageBeforeUpdate = false // When sending a message we want to reload the UI instantly (with any form of animation the message diff --git a/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h b/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h index 7863687e9..f76a0cba6 100644 --- a/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h +++ b/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h @@ -17,7 +17,6 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[]; #import #import #import -#import #import #import #import