diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index 43903cfd93..c28af8e105 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -1158,6 +1158,14 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate { previewing = false } + var isSelectionEnabled = true + if previewing { + isSelectionEnabled = false + } else if case .pinnedMessages = self.chatPresentationInterfaceState.subject { + isSelectionEnabled = false + } + self.historyNode.isSelectionGestureEnabled = isSelectionEnabled + var inputPanelSize: CGSize? var immediatelyLayoutInputPanelAndAnimateAppearance = false var secondaryInputPanelSize: CGSize? diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index 9dae8e276a..c79282227c 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -573,7 +573,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { } } } - + private(set) var isScrollAtBottomPosition = false public var isScrollAtBottomPositionUpdated: (() -> Void)? @@ -589,6 +589,8 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { let isTopReplyThreadMessageShown = ValuePromise(false, ignoreRepeated: true) let topVisibleMessageRange = ValuePromise(nil, ignoreRepeated: true) + var isSelectionGestureEnabled = true + private let clientId: Atomic public init(context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic, tagMask: MessageTags?, source: ChatHistoryListSource = .default, subject: ChatControllerSubject?, controllerInteraction: ChatControllerInteraction, selectedMessages: Signal?, NoError>, mode: ChatHistoryListMode = .bubbles) { @@ -1173,10 +1175,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode { guard let strongSelf = self else { return false } - if case .pinnedMessages = strongSelf.subject { - return false - } - return true + return strongSelf.isSelectionGestureEnabled } self.view.addGestureRecognizer(selectionRecognizer) }