From 901faa8d7549a8a461957703a32f61238251189c Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 11 Jun 2023 15:52:33 +0400 Subject: [PATCH] Fix input panel hit testing on iPad --- .../Sources/StoryItemSetContainerComponent.swift | 3 +++ submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift index 58146afcf3..b1f0abbd3f 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerComponent.swift @@ -476,6 +476,9 @@ public final class StoryItemSetContainerComponent: Component { } override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + if let inputView = self.inputPanel.view, let inputViewHitTest = inputView.hitTest(self.convert(point, to: inputView), with: event) { + return inputViewHitTest + } return super.hitTest(point, with: event) } diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift index c7a02057d3..ca0ebc1579 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift @@ -1183,8 +1183,10 @@ func peerInfoHeaderActionButtons(peer: Peer?, isSecretChat: Bool, isContact: Boo func peerInfoHeaderButtons(peer: Peer?, cachedData: CachedPeerData?, isOpenedFromChat: Bool, isExpanded: Bool, videoCallsEnabled: Bool, isSecretChat: Bool, isContact: Bool, threadInfo: EngineMessageHistoryThread.Info?) -> [PeerInfoHeaderButtonKey] { var result: [PeerInfoHeaderButtonKey] = [] if let user = peer as? TelegramUser { - if !isOpenedFromChat && isContact { - result.append(.message) + if !isOpenedFromChat { + if isContact || user.botInfo != nil { + result.append(.message) + } } var callsAvailable = false var videoCallsAvailable = false