From 63f0bd38d0f209f4fe3c9dc76bd4eac9d4aa21c9 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 3 Sep 2024 23:01:52 +0800 Subject: [PATCH] Fix send as (cherry picked from commit 945525057159e7ad8c33c218075b862599bdb8fe) --- .../Sources/PendingMessages/EnqueueMessage.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift b/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift index 14556bc594..7cafce774d 100644 --- a/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift +++ b/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift @@ -716,10 +716,14 @@ func enqueueMessages(transaction: Transaction, account: Account, peerId: PeerId, var authorId: PeerId? if let sendAsPeer = sendAsPeer { - if let peer = peer as? TelegramChannel, case let .broadcast(info) = peer.info, info.flags.contains(.messagesShouldHaveProfiles) { - authorId = sendAsPeer.id + if let peer = peer as? TelegramChannel, case let .broadcast(info) = peer.info { + if info.flags.contains(.messagesShouldHaveProfiles) { + authorId = sendAsPeer.id + } else { + authorId = peer.id + } } else { - authorId = peer.id + authorId = sendAsPeer.id } } else if let peer = peer as? TelegramChannel { if case .broadcast = peer.info {