From a5e0b19b7929ccc1d328bd97c598cb2eb126d05e Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 18 Jul 2017 19:48:10 +0300 Subject: [PATCH] Copy correct text for a forwarded reply message. --- .../SourceFiles/history/history_message.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 751a71044..0636ea139 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -1288,6 +1288,15 @@ TextWithEntities HistoryMessage::selectedText(TextSelection selection) const { result.text += qstr("\n\n"); TextUtilities::Append(result, std::move(logEntryOriginalResult)); } + if (auto reply = Get()) { + if (selection == FullSelection && reply->replyToMsg) { + TextWithEntities wrapped; + wrapped.text.reserve(lang(lng_in_reply_to).size() + reply->replyToMsg->author()->name.size() + 4 + result.text.size()); + wrapped.text.append('[').append(lang(lng_in_reply_to)).append(' ').append(reply->replyToMsg->author()->name).append(qsl("]\n")); + TextUtilities::Append(wrapped, std::move(result)); + result = wrapped; + } + } if (auto forwarded = Get()) { if (selection == FullSelection) { auto fwdinfo = forwarded->_text.originalTextWithEntities(AllTextSelection, ExpandLinksAll); @@ -1301,15 +1310,6 @@ TextWithEntities HistoryMessage::selectedText(TextSelection selection) const { result = wrapped; } } - if (auto reply = Get()) { - if (selection == FullSelection && reply->replyToMsg) { - TextWithEntities wrapped; - wrapped.text.reserve(lang(lng_in_reply_to).size() + reply->replyToMsg->author()->name.size() + 4 + result.text.size()); - wrapped.text.append('[').append(lang(lng_in_reply_to)).append(' ').append(reply->replyToMsg->author()->name).append(qsl("]\n")); - TextUtilities::Append(wrapped, std::move(result)); - result = wrapped; - } - } return result; }