Reply-in-another-chat by Ctrl+Click on Reply.

This commit is contained in:
John Preston 2024-05-28 10:59:46 +04:00
parent 32cd2120ac
commit b9f63f80f1
3 changed files with 7 additions and 11 deletions

View file

@ -2399,7 +2399,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
const auto quoteOffset = selected.offset; const auto quoteOffset = selected.offset;
text.replace('&', u"&&"_q); text.replace('&', u"&&"_q);
_menu->addAction(text, [=] { _menu->addAction(text, [=] {
if (canSendReply) { if (canSendReply && !base::IsCtrlPressed()) {
_widget->replyToMessage({ _widget->replyToMessage({
.messageId = itemId, .messageId = itemId,
.quote = quote, .quote = quote,

View file

@ -632,15 +632,11 @@ bool AddReplyToMessageAction(
text.replace('&', u"&&"_q); text.replace('&', u"&&"_q);
const auto itemId = item->fullId(); const auto itemId = item->fullId();
menu->addAction(text, [=] { menu->addAction(text, [=] {
if (!item) { list->replyToMessageRequestNotify({
return; .messageId = itemId,
} else { .quote = quote.text,
list->replyToMessageRequestNotify({ .quoteOffset = quote.offset,
.messageId = itemId, });
.quote = quote.text,
.quoteOffset = quote.offset,
});
}
}, &st::menuIconReply); }, &st::menuIconReply);
return true; return true;
} }

View file

@ -327,7 +327,7 @@ RepliesWidget::RepliesWidget(
const auto canSendReply = _topic const auto canSendReply = _topic
? Data::CanSendAnything(_topic) ? Data::CanSendAnything(_topic)
: Data::CanSendAnything(_history->peer); : Data::CanSendAnything(_history->peer);
if (_joinGroup || !canSendReply) { if (_joinGroup || !canSendReply || base::IsCtrlPressed()) {
Controls::ShowReplyToChatBox(controller->uiShow(), { fullId }); Controls::ShowReplyToChatBox(controller->uiShow(), { fullId });
} else { } else {
replyToMessage(fullId); replyToMessage(fullId);