From 87caa58456e79bbb70adbe689f67a157c6f445cc Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 25 May 2019 16:42:01 +0200 Subject: [PATCH] Forward some inline keyboards. --- Telegram/SourceFiles/history/history_item.h | 17 +++++---- .../history/history_item_components.cpp | 6 ++- .../SourceFiles/history/history_message.cpp | 37 ++++++++++++++----- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h index 824bd4d029..dc4aa5e3c9 100644 --- a/Telegram/SourceFiles/history/history_item.h +++ b/Telegram/SourceFiles/history/history_item.h @@ -296,6 +296,15 @@ public: MessageGroupId groupId() const; + const HistoryMessageReplyMarkup *inlineReplyMarkup() const { + return const_cast(this)->inlineReplyMarkup(); + } + const ReplyKeyboard *inlineReplyKeyboard() const { + return const_cast(this)->inlineReplyKeyboard(); + } + HistoryMessageReplyMarkup *inlineReplyMarkup(); + ReplyKeyboard *inlineReplyKeyboard(); + virtual std::unique_ptr createView( not_null delegate) = 0; @@ -319,14 +328,6 @@ protected: not_null _from; MTPDmessage::Flags _flags = 0; - const HistoryMessageReplyMarkup *inlineReplyMarkup() const { - return const_cast(this)->inlineReplyMarkup(); - } - const ReplyKeyboard *inlineReplyKeyboard() const { - return const_cast(this)->inlineReplyKeyboard(); - } - HistoryMessageReplyMarkup *inlineReplyMarkup(); - ReplyKeyboard *inlineReplyKeyboard(); void invalidateChatListEntry(); void setGroupId(MessageGroupId groupId); diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 01fc882adb..30c1b6adc2 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -860,12 +860,16 @@ void HistoryMessageReplyMarkup::create( rows.clear(); rows.reserve(markup.rows.size()); + using Type = HistoryMessageMarkupButton::Type; for (const auto &existing : markup.rows) { auto row = std::vector