From 4e3c1460f65fecc350117c4f25603ff3979e8d36 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 23 Dec 2023 01:40:18 +0300 Subject: [PATCH] Fixed display of menu items from sponsored message with selected text. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 0b067eac1..b7c5cba31 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2526,6 +2526,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { ? link->copyToClipboardContextItemText() : QString(); + if (item->isSponsored()) { + FillSponsoredMessagesMenu(controller, item->fullId(), _menu); + } if (isUponSelected > 0) { addReplyAction(item); const auto selectedText = getSelectedText(); @@ -2588,10 +2591,6 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { }, &st::menuIconCopy); } } - if (item->isSponsored()) { - const auto itemId = item->fullId(); - FillSponsoredMessagesMenu(controller, itemId, _menu); - } if (!item->isService() && view && actionText.isEmpty()) { if (!hasCopyRestriction(item) && (view->hasVisibleText() || mediaHasTextForCopy)) {