Merge commit 'b909d1bea021e1c9c86626981a189d715dfffad5'

This commit is contained in:
Ilya Laktyushin
2024-02-06 17:33:38 +04:00
198 changed files with 11651 additions and 3398 deletions

View File

@@ -274,7 +274,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
private var isLoadingValue: Bool = false
private var isLoadingEarlier: Bool = false
private func updateIsLoading(isLoading: Bool, earlier: Bool, animated: Bool) {
var useLoadingPlaceholder = self.chatLocation.peerId?.namespace != Namespaces.Peer.SecretChat
var useLoadingPlaceholder = self.chatLocation.peerId?.namespace != Namespaces.Peer.CloudUser && self.chatLocation.peerId?.namespace != Namespaces.Peer.SecretChat
if case let .replyThread(message) = self.chatLocation, message.peerId == self.context.account.peerId {
useLoadingPlaceholder = true
}
@@ -3741,6 +3741,8 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
let effectiveInputText = effectivePresentationInterfaceState.interfaceState.composeInputState.inputText
let peerSpecificEmojiPack = (self.controller?.peerView?.cachedData as? CachedChannelData)?.emojiPack
var inlineStickers: [MediaId: Media] = [:]
var firstLockedPremiumEmoji: TelegramMediaFile?
var bubbleUpEmojiOrStickersetsById: [Int64: ItemCollectionId] = [:]
@@ -3751,7 +3753,15 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
if let packId = value.interactivelySelectedFromPackId {
bubbleUpEmojiOrStickersetsById[file.fileId.id] = packId
}
if file.isPremiumEmoji && !self.chatPresentationInterfaceState.isPremium && self.chatPresentationInterfaceState.chatLocation.peerId != self.context.account.peerId {
var isPeerSpecific = false
for attribute in file.attributes {
if case let .CustomEmoji(_, _, _, packReference) = attribute, case let .id(id, _) = packReference {
isPeerSpecific = id == peerSpecificEmojiPack?.id.id
}
}
if file.isPremiumEmoji && !self.chatPresentationInterfaceState.isPremium && self.chatPresentationInterfaceState.chatLocation.peerId != self.context.account.peerId && !isPeerSpecific {
if firstLockedPremiumEmoji == nil {
firstLockedPremiumEmoji = file
}
@@ -4096,7 +4106,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
if self.chatPresentationInterfaceState.inputTextPanelState.mediaRecordingState != nil {
return false
}
if self.chatPresentationInterfaceState.recordedMediaPreview != nil {
if self.chatPresentationInterfaceState.interfaceState.mediaDraftState != nil {
return false
}
if let inputPanelNode = self.inputPanelNode as? ChatTextInputPanelNode {