From c85e3ef86b001b17c131e31de02941a83e16baaa Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Fri, 25 Feb 2022 10:57:02 +1100 Subject: [PATCH] clean up unused code --- .../ConversationVC+Interaction.swift | 5 --- Session/Conversations/ConversationVC.swift | 1 - Session/Conversations/ConversationViewModel.h | 2 -- Session/Conversations/ConversationViewModel.m | 31 ------------------- 4 files changed, 39 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index a802e285b..9548fc766 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -591,11 +591,6 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc } func delete(_ viewItem: ConversationViewItem) { - if (!self.isUnsendRequestsEnabled) { - viewItem.deleteAction() - return - } - guard let message = viewItem.interaction as? TSMessage else { return self.deleteLocally(viewItem) } // Handle open group messages the old way diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 990d2de75..fb647285a 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -5,7 +5,6 @@ // • Remaining search glitchiness final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversationSettingsViewDelegate, ConversationSearchControllerDelegate, UITableViewDataSource, UITableViewDelegate { - let isUnsendRequestsEnabled = true // Set to true once unsend requests are done on all platforms let thread: TSThread let focusedMessageID: String? // This is used for global search var focusedMessageIndexPath: IndexPath? diff --git a/Session/Conversations/ConversationViewModel.h b/Session/Conversations/ConversationViewModel.h index d8d1b21ea..d9642ed4d 100644 --- a/Session/Conversations/ConversationViewModel.h +++ b/Session/Conversations/ConversationViewModel.h @@ -122,8 +122,6 @@ static const int kYapDatabaseRangeMaxLength = 250000; - (void)ensureDynamicInteractionsAndUpdateIfNecessary:(BOOL)updateIfNecessary; -- (void)clearUnreadMessagesIndicator; - - (void)loadAnotherPageOfMessages; - (void)viewDidResetContentAndLayout; diff --git a/Session/Conversations/ConversationViewModel.m b/Session/Conversations/ConversationViewModel.m index 949b5a616..c643871ff 100644 --- a/Session/Conversations/ConversationViewModel.m +++ b/Session/Conversations/ConversationViewModel.m @@ -517,37 +517,6 @@ NS_ASSUME_NONNULL_BEGIN } } -- (void)clearUnreadMessagesIndicator -{ - OWSAssertIsOnMainThread(); - - // TODO: Remove by making unread indicator a view model concern. - id _Nullable oldIndicatorItem = [self.viewState unreadIndicatorViewItem]; - if (oldIndicatorItem) { - // TODO ideally this would be happening within the *same* transaction that caused the unreadMessageIndicator - // to be cleared. - [LKStorage writeWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { - [oldIndicatorItem.interaction touchWithTransaction:transaction]; - }]; - } - - if (self.hasClearedUnreadMessagesIndicator) { - // ensureDynamicInteractionsForThread is somewhat expensive - // so we don't want to call it unnecessarily. - return; - } - - // Once we've cleared the unread messages indicator, - // make sure we don't show it again. - self.hasClearedUnreadMessagesIndicator = YES; - - if (self.dynamicInteractions.unreadIndicator) { - // If we've just cleared the "unread messages" indicator, - // update the dynamic interactions. - [self ensureDynamicInteractionsAndUpdateIfNecessary:YES]; - } -} - #pragma mark - Storage access - (void)uiDatabaseDidUpdateExternally:(NSNotification *)notification