Various fixes

This commit is contained in:
Ilya Laktyushin
2025-03-19 22:03:17 +04:00
parent 5e79ec4b32
commit 66d1aedcb0
3 changed files with 25 additions and 21 deletions

View File

@@ -1946,7 +1946,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn
}
} else {
contentItemAnimation = .None
contentItemLayer = TextContentItemLayer()
contentItemLayer = TextContentItemLayer(displaysAsynchronously: self.displaysAsynchronously)
self.contentItemLayers[contentItem.id] = contentItemLayer
self.layer.addSublayer(contentItemLayer)
}
@@ -2461,8 +2461,9 @@ final class TextContentItemLayer: SimpleLayer {
private var isAnimating: Bool = false
private var currentContentMask: RenderMask?
override init() {
init(displaysAsynchronously: Bool) {
self.renderNode = RenderNode()
self.renderNode.displaysAsynchronously = displaysAsynchronously
super.init()

View File

@@ -112,11 +112,14 @@ public final class DrawingMessageRenderer {
self.wallpaperColor = wallpaperColor
self.messagesContainerNode = ASDisplayNode()
self.messagesContainerNode.displaysAsynchronously = false
self.messagesContainerNode.clipsToBounds = true
self.messagesContainerNode.transform = CATransform3DMakeScale(1.0, -1.0, 1.0)
super.init()
self.displaysAsynchronously = false
self.addSubnode(self.messagesContainerNode)
}

View File

@@ -174,24 +174,6 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
let isTextEmpty = chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0
let hasForward = chatPresentationInterfaceState.interfaceState.forwardMessageIds != nil
if case .scheduledMessages = chatPresentationInterfaceState.subject {
} else {
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 })
var showPremiumGift = false
if !premiumConfiguration.isPremiumDisabled {
if chatPresentationInterfaceState.alwaysShowGiftButton {
showPremiumGift = true
} else if chatPresentationInterfaceState.hasBirthdayToday {
showPremiumGift = true
} else if premiumConfiguration.showPremiumGiftInAttachMenu && premiumConfiguration.showPremiumGiftInTextField {
showPremiumGift = true
}
}
if isTextEmpty, showPremiumGift, let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, !peer.isDeleted && peer.botInfo == nil && !peer.flags.contains(.isSupport) { //&& chatPresentationInterfaceState.suggestPremiumGift {
accessoryItems.append(.gift)
}
}
var extendedSearchLayout = false
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
if case let .contextRequestResult(peer, _) = result, peer != nil {
@@ -210,6 +192,24 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
}
}
if case .scheduledMessages = chatPresentationInterfaceState.subject {
} else {
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 })
var showPremiumGift = false
if !premiumConfiguration.isPremiumDisabled {
if chatPresentationInterfaceState.alwaysShowGiftButton {
showPremiumGift = true
} else if chatPresentationInterfaceState.hasBirthdayToday {
showPremiumGift = true
} else if premiumConfiguration.showPremiumGiftInAttachMenu && premiumConfiguration.showPremiumGiftInTextField {
showPremiumGift = true
}
}
if isTextEmpty, showPremiumGift, let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, !peer.isDeleted && peer.botInfo == nil && !peer.flags.contains(.isSupport) { //&& chatPresentationInterfaceState.suggestPremiumGift {
accessoryItems.append(.gift)
}
}
if isTextEmpty && chatPresentationInterfaceState.hasScheduledMessages && !hasForward {
accessoryItems.append(.scheduledMessages)
}