diff --git a/submodules/ChatPresentationInterfaceState/BUILD b/submodules/ChatPresentationInterfaceState/BUILD index 3ca6b4d9dc..7c97be953d 100644 --- a/submodules/ChatPresentationInterfaceState/BUILD +++ b/submodules/ChatPresentationInterfaceState/BUILD @@ -1,5 +1,9 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") +sgdeps = [ + "//Swiftgram/SGSimpleSettings:SGSimpleSettings" +] + swift_library( name = "ChatPresentationInterfaceState", module_name = "ChatPresentationInterfaceState", @@ -9,7 +13,7 @@ swift_library( copts = [ "-warnings-as-errors", ], - deps = [ + deps = sgdeps + [ "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", "//submodules/AsyncDisplayKit:AsyncDisplayKit", "//submodules/Display:Display", diff --git a/submodules/ChatPresentationInterfaceState/Sources/ChatPresentationInterfaceState.swift b/submodules/ChatPresentationInterfaceState/Sources/ChatPresentationInterfaceState.swift index 6b67783148..b2f7fc134a 100644 --- a/submodules/ChatPresentationInterfaceState/Sources/ChatPresentationInterfaceState.swift +++ b/submodules/ChatPresentationInterfaceState/Sources/ChatPresentationInterfaceState.swift @@ -1,3 +1,4 @@ +import SGSimpleSettings import Foundation import UIKit import SwiftSignalKit @@ -719,8 +720,13 @@ public final class ChatPresentationInterfaceState: Equatable { self.reportReason = reportReason self.showCommands = showCommands self.hasBotCommands = hasBotCommands + if SGSimpleSettings.shared.disableSendAsButton { + self.showSendAsPeers = false + self.sendAsPeers = nil + } else { self.showSendAsPeers = showSendAsPeers self.sendAsPeers = sendAsPeers + } self.botMenuButton = botMenuButton self.showWebView = showWebView self.currentSendAsPeerId = currentSendAsPeerId diff --git a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift index ef37494de1..bfc937c1b7 100644 --- a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift @@ -1635,7 +1635,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg var displaySendAsAvatarButton = false let mediaRecordingState = interfaceState.inputTextPanelState.mediaRecordingState - if !SGSimpleSettings.shared.disableSendAsButton, let sendAsPeers = interfaceState.sendAsPeers, !sendAsPeers.isEmpty && interfaceState.editMessageState == nil { + if let sendAsPeers = interfaceState.sendAsPeers, !sendAsPeers.isEmpty && interfaceState.editMessageState == nil { menuButtonExpanded = false displaySendAsAvatarButton = true @@ -4452,7 +4452,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg } } - if (hasText || keepSendButtonEnabled && !mediaInputIsActive && !hasSlowModeButton || SGSimpleSettings.shared.hideRecordingButton) { + if (hasText || keepSendButtonEnabled && !mediaInputIsActive && !hasSlowModeButton) { if self.sendActionButtons.sendContainerNode.alpha.isZero && self.rightSlowModeInset.isZero { alphaTransition.updateAlpha(node: self.sendActionButtons.sendContainerNode, alpha: 1.0) blurTransitionIn.animateBlur(layer: self.sendActionButtons.sendContainerNode.layer, fromRadius: sendButtonBlurOut, toRadius: 0.0)