diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index b6c167586a..dfcbfc6df2 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -733,9 +733,11 @@ HistoryMessageMarkupButton::HistoryMessageMarkupButton( Type type, const QString &text, const QByteArray &data, + const QString &forwardText, int32 buttonId) : type(type) , text(text) +, forwardText(forwardText) , data(data) , buttonId(buttonId) { } @@ -806,6 +808,7 @@ void HistoryMessageReplyMarkup::createFromButtonRows( Type::Auth, qs(data.vtext), qba(data.vurl), + data.has_fwd_text() ? qs(data.vfwd_text) : QString(), data.vbutton_id.v); }, [&](const MTPDinputKeyboardButtonUrlAuth &data) { LOG(("API Error: inputKeyboardButtonUrlAuth received.")); @@ -866,10 +869,14 @@ void HistoryMessageReplyMarkup::create( const auto newType = (button.type != Type::SwitchInlineSame) ? button.type : Type::SwitchInline; + const auto text = button.forwardText.isEmpty() + ? button.text + : button.forwardText; row.emplace_back( newType, - button.text, + text, button.data, + QString(), button.buttonId); } if (!row.empty()) { diff --git a/Telegram/SourceFiles/history/history_item_components.h b/Telegram/SourceFiles/history/history_item_components.h index 2b5edfb8e4..1cd5bd9b76 100644 --- a/Telegram/SourceFiles/history/history_item_components.h +++ b/Telegram/SourceFiles/history/history_item_components.h @@ -171,6 +171,7 @@ struct HistoryMessageMarkupButton { Type type, const QString &text, const QByteArray &data = QByteArray(), + const QString &forwardText = QString(), int32 buttonId = 0); static HistoryMessageMarkupButton *Get( @@ -179,7 +180,7 @@ struct HistoryMessageMarkupButton { int column); Type type; - QString text; + QString text, forwardText; QByteArray data; int32 buttonId = 0; mutable mtpRequestId requestId = 0;