Various improvements

This commit is contained in:
Ilya Laktyushin
2024-10-26 01:25:07 +04:00
parent 38b6555518
commit 4b537a4cd5
24 changed files with 390 additions and 111 deletions

View File

@@ -1431,7 +1431,17 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
var dismissedAdPanelNode: ChatAdPanelNode?
var adPanelHeight: CGFloat?
var displayAdPanel = false
if let _ = self.chatPresentationInterfaceState.adMessage {
if let chatHistoryState = self.chatPresentationInterfaceState.chatHistoryState, case .loaded(false, _) = chatHistoryState {
if let user = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, user.botInfo != nil && !self.chatPresentationInterfaceState.peerIsBlocked && self.chatPresentationInterfaceState.hasAtLeast3Messages {
displayAdPanel = true
}
}
}
if displayAdPanel {
var animateAppearance = false
let adPanelNode: ChatAdPanelNode
if let current = self.adPanelNode {