Disable AI button in secret chats

This commit is contained in:
Isaac 2026-04-03 13:15:06 +08:00
parent 43e41b20d9
commit 1a728382c4
4 changed files with 4 additions and 4 deletions

View file

@ -2226,7 +2226,7 @@ final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate, ASGestureRecog
}
}, makeEntityInputView: self.makeEntityInputView)
if let data = self.context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 {
} else {
} else if let peerId = self.presentationInterfaceState.chatLocation.peerId, peerId.namespace != Namespaces.Peer.SecretChat {
textInputPanelNode.isAIEnabled = true
}
textInputPanelNode.interfaceInteraction = self.interfaceInteraction

View file

@ -83,7 +83,7 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView {
super.init()
if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_attach"] as? Double, value == 1.0 {
} else {
} else if let peerId = chatLocation.peerId, peerId.namespace != Namespaces.Peer.SecretChat {
self.isAIEnabled = true
}

View file

@ -888,7 +888,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
self?.interfaceInteraction?.presentController(controller, nil)
})
if let data = self.context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 {
} else {
} else if let peerId = self.presentationInterfaceState.chatLocation.peerId, peerId.namespace != Namespaces.Peer.SecretChat {
self.textInputPanelNode?.isAIEnabled = true
}
self.textInputPanelNode?.textInputAccessoryPanel = textInputAccessoryPanel

View file

@ -465,7 +465,7 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState
interfaceInteraction?.presentController(controller, nil)
})
if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 {
} else {
} else if let peerId = chatPresentationInterfaceState.chatLocation.peerId, peerId.namespace != Namespaces.Peer.SecretChat {
panel.isAIEnabled = true
}
panel.textInputAccessoryPanel = textInputAccessoryPanel