/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "history/history_item_reply_markup.h" #include "data/data_session.h" #include "history/history_item.h" #include "history/history_item_components.h" HistoryMessageMarkupButton::HistoryMessageMarkupButton( Type type, const QString &text, const QByteArray &data, const QString &forwardText, int64 buttonId) : type(type) , text(text) , forwardText(forwardText) , data(data) , buttonId(buttonId) { } HistoryMessageMarkupButton *HistoryMessageMarkupButton::Get( not_null owner, FullMsgId itemId, int row, int column) { if (const auto item = owner->message(itemId)) { if (const auto markup = item->Get()) { if (row < markup->data.rows.size()) { auto &buttons = markup->data.rows[row]; if (column < buttons.size()) { return &buttons[column]; } } } } return nullptr; } void HistoryMessageMarkupData::fillRows( const QVector &list) { rows.clear(); if (list.isEmpty()) { return; } using Type = Button::Type; rows.reserve(list.size()); for (const auto &row : list) { row.match([&](const MTPDkeyboardButtonRow &data) { auto row = std::vector