mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user