From c46249178d4316dee86498becc0cf6bf80a65450 Mon Sep 17 00:00:00 2001 From: isaac <> Date: Tue, 2 Jun 2026 21:18:17 +0200 Subject: [PATCH] Disable forward name hiding for rich messages --- .../Sources/PeerSelectionControllerNode.swift | 6 +++++- .../TelegramUI/Sources/Chat/ChatMessageActionOptions.swift | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift b/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift index 37a7ccd34c..a3c2914e08 100644 --- a/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift +++ b/submodules/TelegramUI/Components/PeerSelectionController/Sources/PeerSelectionControllerNode.swift @@ -453,6 +453,7 @@ final class PeerSelectionControllerNode: ASDisplayNode { var hasOther = false var hasNotOwnMessages = false + var hasRichMessages = false for message in messages { if let author = message.effectiveAuthor { if !uniquePeerIds.contains(author.id) { @@ -479,9 +480,12 @@ final class PeerSelectionControllerNode: ASDisplayNode { if !isDice { hasOther = true } + if message.richText != nil { + hasRichMessages = true + } } - let canHideNames = hasNotOwnMessages && hasOther + let canHideNames = hasNotOwnMessages && hasOther && !hasRichMessages let hideNames = forwardOptions.hideNames let hideCaptions = forwardOptions.hideCaptions diff --git a/submodules/TelegramUI/Sources/Chat/ChatMessageActionOptions.swift b/submodules/TelegramUI/Sources/Chat/ChatMessageActionOptions.swift index 9ccb490700..bc930d7f0d 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatMessageActionOptions.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatMessageActionOptions.swift @@ -145,6 +145,7 @@ private func chatForwardOptions(selfController: ChatControllerImpl, sourceView: var hasOther = false var hasNotOwnMessages = false var hasPaid = false + var hasRichMessages = false for message in messages { if let author = message.effectiveAuthor { if !uniquePeerIds.contains(author.id) { @@ -175,9 +176,12 @@ private func chatForwardOptions(selfController: ChatControllerImpl, sourceView: if !isDice { hasOther = true } + if message.richText != nil { + hasRichMessages = true + } } - var canHideNames = hasNotOwnMessages && hasOther + var canHideNames = hasNotOwnMessages && hasOther && !hasRichMessages if case let .peer(peerId) = selfController.chatLocation, peerId.namespace == Namespaces.Peer.SecretChat { canHideNames = false }