Don't show Spoiler format option in secret chats

This commit is contained in:
Ilya Laktyushin
2021-12-21 18:48:21 +04:00
parent 80e2fc02ee
commit d60d2beaa4
4 changed files with 24 additions and 6 deletions

View File

@@ -296,7 +296,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
var isMediaDeleted: Bool = false
private let inputMenu = ChatTextInputMenu()
private let inputMenu: ChatTextInputMenu
private var theme: PresentationTheme?
private var strings: PresentationStrings?
@@ -451,6 +451,12 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
init(presentationInterfaceState: ChatPresentationInterfaceState, presentationContext: ChatPresentationContext?, presentController: @escaping (ViewController) -> Void) {
self.presentationInterfaceState = presentationInterfaceState
var hasSpoilers = true
if presentationInterfaceState.chatLocation.peerId.namespace == Namespaces.Peer.SecretChat {
hasSpoilers = false
}
self.inputMenu = ChatTextInputMenu(hasSpoilers: hasSpoilers)
self.clippingNode = ASDisplayNode()
self.clippingNode.clipsToBounds = true