Fix disableSendAsButton

This commit is contained in:
Kylmakalle
2025-11-18 21:42:42 +02:00
parent f4df512c76
commit d2d99d9df7
3 changed files with 13 additions and 3 deletions

View File

@@ -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",

View File

@@ -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