Send choosing sticker activity

This commit is contained in:
Ilya Laktyushin
2021-08-25 18:30:43 +03:00
parent 6e1b35a2e3
commit 9d265ef420
4 changed files with 53 additions and 1 deletions

View File

@@ -121,6 +121,11 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
private(set) var textInputPanelNode: ChatTextInputPanelNode?
private var inputMediaNode: ChatMediaInputNode?
private let choosingStickerPromise = Promise<Bool>(false)
var choosingSticker: Signal<Bool, NoError> {
return self.choosingStickerPromise.get()
}
let navigateButtons: ChatHistoryNavigationButtons
private var ignoreUpdateHeight = false
@@ -832,6 +837,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
}
if let inputMediaNode = inputNode as? ChatMediaInputNode, self.inputMediaNode == nil {
self.inputMediaNode = inputMediaNode
self.choosingStickerPromise.set(inputMediaNode.choosingSticker)
inputMediaNode.requestDisableStickerAnimations = { [weak self] disabled in
self?.controller?.disableStickerAnimations = disabled
}
@@ -1923,6 +1929,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
self?.controller?.disableStickerAnimations = disabled
}
self.inputMediaNode = inputNode
self.choosingStickerPromise.set(inputNode.choosingSticker)
if let (validLayout, _) = self.validLayout {
let _ = inputNode.updateLayout(width: validLayout.size.width, leftInset: validLayout.safeInsets.left, rightInset: validLayout.safeInsets.right, bottomInset: validLayout.intrinsicInsets.bottom, standardInputHeight: validLayout.standardInputHeight, inputHeight: validLayout.inputHeight ?? 0.0, maximumHeight: validLayout.standardInputHeight, inputPanelHeight: 44.0, transition: .immediate, interfaceState: self.chatPresentationInterfaceState, deviceMetrics: validLayout.deviceMetrics, isVisible: false)
}