From 8b86f12c23e19f360e663109079859c616f56adf Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 16 Sep 2024 11:25:04 +0400 Subject: [PATCH] Fix quote-reply to album captions. --- Telegram/SourceFiles/history/view/history_view_message.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 35f7647bc..09f3cd381 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -3054,7 +3054,8 @@ TextForMimeData Message::selectedText(TextSelection selection) const { } SelectedQuote Message::selectedQuote(TextSelection selection) const { - const auto item = data(); + const auto textItem = this->textItem(); + const auto item = textItem ? textItem : data().get(); const auto &translated = item->translatedText(); const auto &original = item->originalText(); if (&translated != &original @@ -3068,7 +3069,7 @@ SelectedQuote Message::selectedQuote(TextSelection selection) const { const auto textSelection = mediaBefore ? media->skipSelection(selection) : selection; - return FindSelectedQuote(text(), textSelection, data()); + return FindSelectedQuote(text(), textSelection, item); } else if (const auto media = this->media()) { if (media->isDisplayed() || isHiddenByGroup()) { return media->selectedQuote(selection);