From 6a3989488e77b1ad3a4f79207ab4adab72f1723e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 27 Jun 2025 21:29:17 +0400 Subject: [PATCH] Fix possible crash in quick replies. --- Telegram/SourceFiles/history/history_item.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index a8794542e3..20566113af 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -3704,7 +3704,9 @@ bool HistoryItem::isEmpty() const { } Data::SavedSublist *HistoryItem::savedSublist() const { - if (const auto saved = Get()) { + if (isBusinessShortcut()) { + return nullptr; + } else if (const auto saved = Get()) { if (saved->savedMessagesSublist) { return saved->savedMessagesSublist; } else if (const auto monoforum = _history->peer->monoforum()) { @@ -3928,9 +3930,10 @@ void HistoryItem::createComponents(CreateConfig &&config) { mask |= HistoryMessageReplyMarkup::Bit(); } const auto requiresMonoforumPeer = _history->peer->amMonoforumAdmin(); - if (_history->peer->isSelf() - || config.savedSublistPeer - || requiresMonoforumPeer) { + if (!isBusinessShortcut() + && (_history->peer->isSelf() + || config.savedSublistPeer + || requiresMonoforumPeer)) { mask |= HistoryMessageSaved::Bit(); } if (!config.restrictions.empty()) { @@ -4724,7 +4727,8 @@ void HistoryItem::createServiceFromMtp(const MTPDmessageService &message) { ? peerFromMTP(*message.vsaved_peer_id()) : PeerId(); const auto requiresMonoforumPeer = _history->peer->amMonoforumAdmin(); - if (savedSublistPeer || requiresMonoforumPeer) { + if (!isBusinessShortcut() + && (savedSublistPeer || requiresMonoforumPeer)) { AddComponents(HistoryMessageSaved::Bit()); const auto saved = Get(); saved->sublistPeerId = savedSublistPeer