From b9f63f80f14d826908089618dee05b2d1a00b6b1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 28 May 2024 10:59:46 +0400 Subject: [PATCH] Reply-in-another-chat by Ctrl+Click on Reply. --- .../SourceFiles/history/history_inner_widget.cpp | 2 +- .../history/view/history_view_context_menu.cpp | 14 +++++--------- .../history/view/history_view_replies_section.cpp | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index ae28620d55..1b5e78f3ef 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2399,7 +2399,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { const auto quoteOffset = selected.offset; text.replace('&', u"&&"_q); _menu->addAction(text, [=] { - if (canSendReply) { + if (canSendReply && !base::IsCtrlPressed()) { _widget->replyToMessage({ .messageId = itemId, .quote = quote, diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index dcebb2628a..3905783930 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -632,15 +632,11 @@ bool AddReplyToMessageAction( text.replace('&', u"&&"_q); const auto itemId = item->fullId(); menu->addAction(text, [=] { - if (!item) { - return; - } else { - list->replyToMessageRequestNotify({ - .messageId = itemId, - .quote = quote.text, - .quoteOffset = quote.offset, - }); - } + list->replyToMessageRequestNotify({ + .messageId = itemId, + .quote = quote.text, + .quoteOffset = quote.offset, + }); }, &st::menuIconReply); return true; } diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index 1974cce2b8..7db2a21414 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -327,7 +327,7 @@ RepliesWidget::RepliesWidget( const auto canSendReply = _topic ? Data::CanSendAnything(_topic) : Data::CanSendAnything(_history->peer); - if (_joinGroup || !canSendReply) { + if (_joinGroup || !canSendReply || base::IsCtrlPressed()) { Controls::ShowReplyToChatBox(controller->uiShow(), { fullId }); } else { replyToMessage(fullId);