From 259a9962767d6371caa733069b528caf0749b73c Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 6 Apr 2016 12:00:37 +0400 Subject: [PATCH] Scheme updated. Inline bot result messages now may have reply markup. Fully applying media from send inline bot result response. --- Telegram/SourceFiles/history.cpp | 131 +-- Telegram/SourceFiles/history.h | 39 +- Telegram/SourceFiles/historywidget.cpp | 4 +- .../inline_bot_layout_internal.cpp | 17 +- .../inline_bots/inline_bot_result.cpp | 28 +- .../inline_bots/inline_bot_result.h | 2 + Telegram/SourceFiles/mtproto/core_types.h | 10 +- Telegram/SourceFiles/mtproto/scheme.tl | 31 +- Telegram/SourceFiles/mtproto/scheme_auto.cpp | 188 +++- Telegram/SourceFiles/mtproto/scheme_auto.h | 826 +++++++++++++++--- 10 files changed, 1025 insertions(+), 251 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index ce45f5bf6..940b3990d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1435,12 +1435,12 @@ HistoryItem *History::createItemForwarded(MsgId id, MTPDmessage::Flags flags, QD return HistoryMessage::create(this, id, flags, date, from, msg); } -HistoryItem *History::createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, doc, caption); +HistoryItem *History::createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) { + return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, doc, caption, markup); } -HistoryItem *History::createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, photo, caption); +HistoryItem *History::createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) { + return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, photo, caption, markup); } HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags, bool newMsg) { @@ -1482,12 +1482,12 @@ HistoryItem *History::addNewForwarded(MsgId id, MTPDmessage::Flags flags, QDateT return addNewItem(createItemForwarded(id, flags, date, from, item), true); } -HistoryItem *History::addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - return addNewItem(createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption), true); +HistoryItem *History::addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) { + return addNewItem(createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption, markup), true); } -HistoryItem *History::addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - return addNewItem(createItemPhoto(id, flags, viaBotId, replyTo, date, from, photo, caption), true); +HistoryItem *History::addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) { + return addNewItem(createItemPhoto(id, flags, viaBotId, replyTo, date, from, photo, caption, markup), true); } bool History::addToOverview(MediaOverviewType type, MsgId msgId, AddToOverviewMethod method) { @@ -2985,6 +2985,49 @@ void ReplyKeyboard::Style::paintButton(Painter &p, const ReplyKeyboard::Button & button.text.drawElided(p, tx, textTop + ((rect.height() - _st->height) / 2), tw, 1, style::al_top); } +void HistoryMessageReplyMarkup::createFromButtonRows(const QVector &v) { + if (v.isEmpty()) { + rows.clear(); + return; + } + + rows.reserve(v.size()); + for_const(const MTPKeyboardButtonRow &row, v) { + switch (row.type()) { + case mtpc_keyboardButtonRow: { + const MTPDkeyboardButtonRow &r(row.c_keyboardButtonRow()); + const QVector &b(r.vbuttons.c_vector().v); + if (!b.isEmpty()) { + ButtonRow buttonRow; + buttonRow.reserve(b.size()); + for_const(const MTPKeyboardButton &button, b) { + switch (button.type()) { + case mtpc_keyboardButton: { + buttonRow.push_back({ Button::Default, qs(button.c_keyboardButton().vtext), QByteArray() }); + } break; + case mtpc_keyboardButtonCallback: { + const auto &buttonData(button.c_keyboardButtonCallback()); + buttonRow.push_back({ Button::Callback, qs(buttonData.vtext), qba(buttonData.vdata) }); + } break; + case mtpc_keyboardButtonRequestGeoLocation: { + buttonRow.push_back({ Button::RequestLocation, qs(button.c_keyboardButtonRequestGeoLocation().vtext), QByteArray() }); + } break; + case mtpc_keyboardButtonRequestPhone: { + buttonRow.push_back({ Button::RequestPhone, qs(button.c_keyboardButtonRequestPhone().vtext), QByteArray() }); + } break; + case mtpc_keyboardButtonUrl: { + const auto &buttonData(button.c_keyboardButtonUrl()); + buttonRow.push_back({ Button::Url, qs(buttonData.vtext), qba(buttonData.vurl) }); + } break; + } + } + if (!buttonRow.isEmpty()) rows.push_back(buttonRow); + } + } break; + } + } +} + void HistoryMessageReplyMarkup::create(const MTPReplyMarkup &markup) { flags = 0; rows.clear(); @@ -2995,44 +3038,14 @@ void HistoryMessageReplyMarkup::create(const MTPReplyMarkup &markup) { const MTPDreplyKeyboardMarkup &d(markup.c_replyKeyboardMarkup()); flags = d.vflags.v; - const QVector &v(d.vrows.c_vector().v); - if (!v.isEmpty()) { - rows.reserve(v.size()); - for_const (const MTPKeyboardButtonRow &row, v) { - switch (row.type()) { - case mtpc_keyboardButtonRow: { - const MTPDkeyboardButtonRow &r(row.c_keyboardButtonRow()); - const QVector &b(r.vbuttons.c_vector().v); - if (!b.isEmpty()) { - ButtonRow buttonRow; - buttonRow.reserve(b.size()); - for_const (const MTPKeyboardButton &button, b) { - switch (button.type()) { - case mtpc_keyboardButton: { - buttonRow.push_back({ Button::Default, qs(button.c_keyboardButton().vtext), QByteArray() }); - } break; - case mtpc_keyboardButtonCallback: { - const auto &buttonData(button.c_keyboardButtonCallback()); - buttonRow.push_back({ Button::Callback, qs(buttonData.vtext), qba(buttonData.vdata) }); - } break; - case mtpc_keyboardButtonRequestGeoLocation: { - buttonRow.push_back({ Button::RequestLocation, qs(button.c_keyboardButtonRequestGeoLocation().vtext), QByteArray() }); - } break; - case mtpc_keyboardButtonRequestPhone: { - buttonRow.push_back({ Button::RequestPhone, qs(button.c_keyboardButtonRequestPhone().vtext), QByteArray() }); - } break; - case mtpc_keyboardButtonUrl: { - const auto &buttonData(button.c_keyboardButtonUrl()); - buttonRow.push_back({ Button::Url, qs(buttonData.vtext), qba(buttonData.vurl) }); - } break; - } - } - if (!buttonRow.isEmpty()) rows.push_back(buttonRow); - } - } break; - } - } - } + createFromButtonRows(d.vrows.c_vector().v); + } break; + + case mtpc_replyInlineMarkup: { + const MTPDreplyInlineMarkup &d(markup.c_replyInlineMarkup()); + flags = MTPDreplyKeyboardMarkup::Flags(0) | MTPDreplyKeyboardMarkup_ClientFlag::f_inline; + + createFromButtonRows(d.vrows.c_vector().v); } break; case mtpc_replyKeyboardHide: { @@ -6628,32 +6641,33 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) : HistoryItem(history, id, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { - createComponentsHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId, MTPnullMarkup); setText(msg, entities); } -HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) : HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { - createComponentsHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId, markup); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } -HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) : HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { - createComponentsHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId, markup); _media.reset(this, new HistoryPhoto(photo, caption, this)); setText(QString(), EntitiesInText()); } -void HistoryMessage::createComponentsHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId) { +void HistoryMessage::createComponentsHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, const MTPReplyMarkup &markup) { CreateConfig config; if (flags & MTPDmessage::Flag::f_via_bot_id) config.viaBotId = viaBotId; if (flags & MTPDmessage::Flag::f_reply_to_msg_id) config.replyTo = replyTo; + if (flags & MTPDmessage::Flag::f_reply_markup) config.markup = &markup; if (isPost()) config.viewsCount = 1; createComponents(config); @@ -6937,6 +6951,19 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) { } } +void HistoryMessage::updateMedia(const MTPMessageMedia *media) { + bool fromInlineBot = (_flags & MTPDmessage_ClientFlag::f_from_inline_bot); + if (media && _media && _media->type() != MediaTypeWebPage && !fromInlineBot) { + _media->updateFrom(*media, this); + } else { + setMedia(media); + } + if (fromInlineBot) { + _flags &= ~MTPDmessage_ClientFlag::f_from_inline_bot; + } + setPendingInitDimensions(); +} + int32 HistoryMessage::addToOverview(AddToOverviewMethod method) { if (!indexInOverview()) return 0; diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index f283710b7..2a41230cc 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -246,8 +246,8 @@ public: HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); HistoryItem *addToHistory(const MTPMessage &msg); HistoryItem *addNewForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *item); - HistoryItem *addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup); + HistoryItem *addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup); void addOlderSlice(const QVector &slice, const QVector *collapsed); void addNewerSlice(const QVector &slice, const QVector *collapsed); @@ -481,8 +481,8 @@ protected: HistoryItem *createItem(const MTPMessage &msg, bool applyServiceAction, bool detachExistingItem); HistoryItem *createItemForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *msg); - HistoryItem *createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup); + HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup); HistoryItem *addNewItem(HistoryItem *adding, bool newMsg); HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); @@ -1115,6 +1115,10 @@ struct HistoryMessageReplyMarkup : public BaseComponent inlineKeyboard; + +private: + void createFromButtonRows(const QVector &v); + }; class ReplyMarkupClickHandler : public LeftButtonClickHandler { @@ -1431,7 +1435,7 @@ public: } bool definesReplyKeyboard() const { if (auto *markup = Get()) { - if (markup->flags & MTPDreplyKeyboardMarkup::Flag::f_inline) { + if (markup->flags & MTPDreplyKeyboardMarkup_ClientFlag::f_inline) { return false; } return true; @@ -1764,7 +1768,7 @@ protected: const HistoryMessageReplyMarkup *inlineReplyMarkup() const { if (auto *markup = Get()) { - if (markup->flags & MTPDreplyKeyboardMarkup::Flag::f_inline) { + if (markup->flags & MTPDreplyKeyboardMarkup_ClientFlag::f_inline) { return markup; } } @@ -2767,11 +2771,11 @@ public: static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) { return _create(history, msgId, flags, replyTo, viaBotId, date, from, msg, entities); } - static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - return _create(history, msgId, flags, replyTo, viaBotId, date, from, doc, caption); + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup) { + return _create(history, msgId, flags, replyTo, viaBotId, date, from, doc, caption, markup); } - static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - return _create(history, msgId, flags, replyTo, viaBotId, date, from, photo, caption); + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup) { + return _create(history, msgId, flags, replyTo, viaBotId, date, from, photo, caption, markup); } void initTime(); @@ -2835,14 +2839,7 @@ public: QString notificationText() const override; void applyEdition(const MTPDmessage &message) override; - void updateMedia(const MTPMessageMedia *media) override { - if (media && _media && _media->type() != MediaTypeWebPage) { - _media->updateFrom(*media, this); - } else { - setMedia(media); - } - setPendingInitDimensions(); - } + void updateMedia(const MTPMessageMedia *media) override; int32 addToOverview(AddToOverviewMethod method) override; void eraseFromOverview(); @@ -2915,8 +2912,8 @@ private: HistoryMessage(History *history, const MTPDmessage &msg); HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *fwd); // local forwarded HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message - HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document - HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption, const MTPReplyMarkup &markup); // local document + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption, const MTPReplyMarkup &markup); // local photo friend class HistoryItemInstantiated; void initDimensions() override; @@ -2950,7 +2947,7 @@ private: MsgId originalId = 0; const MTPReplyMarkup *markup = nullptr; }; - void createComponentsHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId); + void createComponentsHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, const MTPReplyMarkup &markup); void createComponents(const CreateConfig &config); class KeyboardStyle : public ReplyKeyboard::Style { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 13ec2849d..b1619a2e7 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6938,7 +6938,7 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti if (silentPost) { sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } - _history->addNewDocument(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, doc, caption); + _history->addNewDocument(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, doc, caption, MTPnullMarkup); _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(doc->id), MTP_long(doc->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); @@ -6994,7 +6994,7 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption) if (silentPost) { sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } - _history->addNewPhoto(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, photo, caption); + _history->addNewPhoto(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, photo, caption, MTPnullMarkup); _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaPhoto(MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index 084219491..3eda81fa7 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -754,16 +754,13 @@ File::File(Result *result) : FileBase(result) void File::initDimensions() { _maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft; - int32 textWidth = _maxw - (st::msgFileSize + st::inlineThumbSkip); - TextParseOptions titleOpts = { 0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto }; + int textWidth = _maxw - (st::msgFileSize + st::inlineThumbSkip); + + TextParseOptions titleOpts = { 0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto }; _title.setText(st::semiboldFont, textOneLine(_result->getLayoutTitle()), titleOpts); - int32 titleHeight = qMin(_title.countHeight(_maxw), 2 * st::semiboldFont->height); - int32 descriptionLines = 1; - - TextParseOptions descriptionOpts = { TextParseMultiline, _maxw, descriptionLines * st::normalFont->height, Qt::LayoutDirectionAuto }; + TextParseOptions descriptionOpts = { TextParseMultiline, _maxw, st::normalFont->height, Qt::LayoutDirectionAuto }; _description.setText(st::normalFont, _result->getLayoutDescription(), descriptionOpts); - int32 descriptionHeight = qMin(_description.countHeight(_maxw), descriptionLines * st::normalFont->height); _minh = st::msgFileSize; _minh += st::inlineRowMargin * 2 + st::inlineRowBorder; @@ -818,12 +815,10 @@ void File::paint(Painter &p, const QRect &clip, uint32 selection, const PaintCon int descriptionTop = st::inlineRowMargin + st::inlineRowFileDescriptionTop; p.setPen(st::black); - _title.drawLeftElided(p, left, titleTop, _width - left, _width, 2); - int32 titleHeight = st::semiboldFont->height; + _title.drawLeftElided(p, left, titleTop, _width - left, _width); p.setPen(st::inlineDescriptionFg); - int32 descriptionLines = 1; - _description.drawLeftElided(p, left, descriptionTop, _width - left, _width, descriptionLines); + _description.drawLeftElided(p, left, descriptionTop, _width - left, _width); if (!context->lastRow) { p.fillRect(rtlrect(left, _height - st::inlineRowBorder, _width - left, st::inlineRowBorder, _width), st::inlineRowBorderFg); diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_result.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_result.cpp index 73932f904..738bb88ab 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_result.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_result.cpp @@ -138,12 +138,18 @@ UniquePointer Result::create(uint64 queryId, const MTPBotInlineResult &m } else { result->sendData.reset(new internal::SendFile(result->_document, result->_content_url, qs(r.vcaption))); } + if (r.has_reply_markup()) { + result->_mtpKeyboard = MakeUnique(r.vreply_markup); + } } break; case mtpc_botInlineMessageText: { const MTPDbotInlineMessageText &r(message->c_botInlineMessageText()); EntitiesInText entities = r.has_entities() ? entitiesFromMTP(r.ventities.c_vector().v) : EntitiesInText(); result->sendData.reset(new internal::SendText(qs(r.vmessage), entities, r.is_no_webpage())); + if (r.has_reply_markup()) { + result->_mtpKeyboard = MakeUnique(r.vreply_markup); + } } break; case mtpc_botInlineMessageMediaGeo: { @@ -153,6 +159,9 @@ UniquePointer Result::create(uint64 queryId, const MTPBotInlineResult &m } else { badAttachment = true; } + if (r.has_reply_markup()) { + result->_mtpKeyboard = MakeUnique(r.vreply_markup); + } } break; case mtpc_botInlineMessageMediaVenue: { @@ -162,11 +171,17 @@ UniquePointer Result::create(uint64 queryId, const MTPBotInlineResult &m } else { badAttachment = true; } + if (r.has_reply_markup()) { + result->_mtpKeyboard = MakeUnique(r.vreply_markup); + } } break; case mtpc_botInlineMessageMediaContact: { const MTPDbotInlineMessageMediaContact &r(message->c_botInlineMessageMediaContact()); result->sendData.reset(new internal::SendContact(qs(r.vfirst_name), qs(r.vlast_name), qs(r.vphone_number))); + if (r.has_reply_markup()) { + result->_mtpKeyboard = MakeUnique(r.vreply_markup); + } } break; default: { @@ -438,16 +453,23 @@ bool Result::hasThumbDisplay() const { }; void Result::addToHistory(History *history, MTPDmessage::Flags flags, MsgId msgId, UserId fromId, MTPint mtpDate, UserId viaBotId, MsgId replyToId) const { + flags |= MTPDmessage_ClientFlag::f_from_inline_bot; + + MTPReplyMarkup markup = MTPnullMarkup; + if (_mtpKeyboard) { + flags |= MTPDmessage::Flag::f_reply_markup; + markup = *_mtpKeyboard; + } if (DocumentData *document = sendData->getSentDocument()) { - history->addNewDocument(msgId, flags, viaBotId, replyToId, date(mtpDate), fromId, document, sendData->getSentCaption()); + history->addNewDocument(msgId, flags, viaBotId, replyToId, date(mtpDate), fromId, document, sendData->getSentCaption(), markup); } else if (PhotoData *photo = sendData->getSentPhoto()) { - history->addNewPhoto(msgId, flags, viaBotId, replyToId, date(mtpDate), fromId, photo, sendData->getSentCaption()); + history->addNewPhoto(msgId, flags, viaBotId, replyToId, date(mtpDate), fromId, photo, sendData->getSentCaption(), markup); } else { internal::SendData::SentMTPMessageFields fields = sendData->getSentMessageFields(this); if (!fields.entities.c_vector().v.isEmpty()) { flags |= MTPDmessage::Flag::f_entities; } - history->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(msgId), MTP_int(fromId), peerToMTP(history->peer->id), MTPnullFwdHeader, MTP_int(viaBotId), MTP_int(replyToId), mtpDate, fields.text, fields.media, MTPnullMarkup, fields.entities, MTP_int(1), MTPint()), NewMessageUnread); + history->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(msgId), MTP_int(fromId), peerToMTP(history->peer->id), MTPnullFwdHeader, MTP_int(viaBotId), MTP_int(replyToId), mtpDate, fields.text, fields.media, markup, fields.entities, MTP_int(1), MTPint()), NewMessageUnread); } } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_result.h b/Telegram/SourceFiles/inline_bots/inline_bot_result.h index 4f3fe830e..9cd4a004f 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_result.h +++ b/Telegram/SourceFiles/inline_bots/inline_bot_result.h @@ -121,6 +121,8 @@ private: mutable MTPPhoto _mtpPhoto = MTP_photoEmpty(MTP_long(0)); PhotoData *_photo = nullptr; + UniquePointer _mtpKeyboard; + ImagePtr _thumb, _locationThumb; UniquePointer sendData; diff --git a/Telegram/SourceFiles/mtproto/core_types.h b/Telegram/SourceFiles/mtproto/core_types.h index b63d12b63..6b42f1eeb 100644 --- a/Telegram/SourceFiles/mtproto/core_types.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -1021,8 +1021,11 @@ enum class MTPDmessage_ClientFlag : int32 { // message is attached to previous one when displaying the history f_attach_to_previous = (1 << 25), + // message was sent from inline bot, need to re-set media when sent + f_from_inline_bot = (1 << 24), + // update this when adding new client side flags - MIN_FIELD = (1 << 25), + MIN_FIELD = (1 << 24), }; DEFINE_MTP_CLIENT_FLAGS(MTPDmessage) @@ -1033,8 +1036,11 @@ enum class MTPDreplyKeyboardMarkup_ClientFlag : int32 { // markup just wants a text reply f_force_reply = (1 << 29), + // markup keyboard is inline + f_inline = (1 << 28), + // update this when adding new client side flags - MIN_FIELD = (1 << 29), + MIN_FIELD = (1 << 28), }; DEFINE_MTP_CLIENT_FLAGS(MTPDreplyKeyboardMarkup) diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 90885da72..ccdbdc63d 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -384,11 +384,12 @@ updateStickerSetsOrder#f0dfb451 order:Vector = Update; updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; updateBotInlineQuery#54826690 flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint offset:string = Update; -updateBotInlineSend#daa0c53d flags:# user_id:int query:string geo:flags.0?GeoPoint id:string = Update; +updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update; updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; updateChannelPinnedMessage#98592475 channel_id:int id:int = Update; updateBotCallbackQuery#a68c688c query_id:long user_id:int peer:Peer msg_id:int data:bytes = Update; updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update; +updateInlineBotCallbackQuery#8bad2883 flags:# query_id:long user_id:int msg_id:flags.0?InputBotInlineMessageID data:bytes = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -568,7 +569,8 @@ keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup; -replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true inline:flags.3?true rows:Vector = ReplyMarkup; +replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector = ReplyMarkup; +replyInlineMarkup#48a30254 rows:Vector = ReplyMarkup; help.appChangelogEmpty#af7e0394 = help.AppChangelog; help.appChangelog#4668e6bd text:string = help.AppChangelog; @@ -632,19 +634,21 @@ messages.foundGifs#450a1c0a next_offset:int results:Vector = messages. messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs; messages.savedGifs#2e0709a5 hash:int gifs:Vector = messages.SavedGifs; -inputBotInlineMessageMediaAuto#2e43e587 caption:string = InputBotInlineMessage; -inputBotInlineMessageText#adf0df71 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector = InputBotInlineMessage; -inputBotInlineMessageMediaGeo#197dce7e geo_point:InputGeoPoint = InputBotInlineMessage; -inputBotInlineMessageMediaVenue#8ab91f84 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputBotInlineMessage; -inputBotInlineMessageMediaContact#52971c52 phone_number:string first_name:string last_name:string = InputBotInlineMessage; +inputBotInlineMessageMediaAuto#292fed13 flags:# caption:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaGeo#f4a59de1 flags:# geo_point:InputGeoPoint reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaVenue#aaafadc8 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult; -botInlineMessageMediaAuto#fc56e87d caption:string = BotInlineMessage; -botInlineMessageText#a56197a9 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector = BotInlineMessage; -botInlineMessageMediaGeo#59d1ff36 geo:GeoPoint = BotInlineMessage; -botInlineMessageMediaVenue#6fa16678 geo:GeoPoint title:string address:string provider:string venue_id:string = BotInlineMessage; -botInlineMessageMediaContact#89202361 phone_number:string first_name:string last_name:string = BotInlineMessage; +botInlineMessageMediaAuto#a74b15b flags:# caption:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaGeo#3a8fd8b8 flags:# geo:GeoPoint reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaVenue#4366232e flags:# geo:GeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; +botInlineMessageMediaContact#35edb4d4 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage; botInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:BotInlineMessage = BotInlineResult; botInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult; @@ -668,6 +672,8 @@ messages.botCallbackAnswer#1264f1c6 flags:# alert:flags.1?true message:flags.0?s messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData; +inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -796,6 +802,7 @@ messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEdi messages.editMessage#d2003257 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:string entities:flags.3?Vector reply_markup:flags.2?ReplyMarkup = Updates; messages.getBotCallbackAnswer#a6e94f04 peer:InputPeer msg_id:int data:bytes = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#481c591a flags:# alert:flags.1?true query_id:long message:flags.0?string = Bool; +messages.editInlineBotMessage#a39b97fa flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:string entities:flags.3?Vector reply_markup:flags.2?ReplyMarkup = Bool; updates.getState#edd4882a = updates.State; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp index ad4c77d8d..b5ddce7e9 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -2922,6 +2922,7 @@ void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, case 2: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" geo: "); ++stages.back(); if (flag & MTPDupdateBotInlineSend::Flag::f_geo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" msg_id: "); ++stages.back(); if (flag & MTPDupdateBotInlineSend::Flag::f_msg_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2987,6 +2988,25 @@ void _serialize_updateEditMessage(MTPStringLogger &to, int32 stage, int32 lev, T } } +void _serialize_updateInlineBotCallbackQuery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateInlineBotCallbackQuery::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateInlineBotCallbackQuery"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" msg_id: "); ++stages.back(); if (flag & MTPDupdateInlineBotCallbackQuery::Flag::f_msg_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 4: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_updates_state(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -4546,8 +4566,20 @@ void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev, case 1: to.add(" resize: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_resize) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_single_use) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 3: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" inline: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_inline) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 5: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_replyInlineMarkup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ replyInlineMarkup"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5103,6 +5135,8 @@ void _serialize_messages_savedGifs(MTPStringLogger &to, int32 stage, int32 lev, } void _serialize_inputBotInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageMediaAuto::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5110,7 +5144,9 @@ void _serialize_inputBotInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageMediaAuto::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5129,11 +5165,14 @@ void _serialize_inputBotInlineMessageText(MTPStringLogger &to, int32 stage, int3 case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::Flag::f_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_inputBotInlineMessageMediaGeo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageMediaGeo::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5141,12 +5180,16 @@ void _serialize_inputBotInlineMessageMediaGeo(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageMediaGeo::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_inputBotInlineMessageMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageMediaVenue::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5154,16 +5197,20 @@ void _serialize_inputBotInlineMessageMediaVenue(MTPStringLogger &to, int32 stage to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageMediaVenue::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_inputBotInlineMessageMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageMediaContact::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5171,9 +5218,11 @@ void _serialize_inputBotInlineMessageMediaContact(MTPStringLogger &to, int32 sta to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageMediaContact::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5205,7 +5254,46 @@ void _serialize_inputBotInlineResult(MTPStringLogger &to, int32 stage, int32 lev } } +void _serialize_inputBotInlineResultPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineResultPhoto"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_inputBotInlineResultDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineResultDocument::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineResultDocument"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDinputBotInlineResultDocument::Flag::f_title) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" description: "); ++stages.back(); if (flag & MTPDinputBotInlineResultDocument::Flag::f_description) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 5: to.add(" document: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_botInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineMessageMediaAuto::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5213,7 +5301,9 @@ void _serialize_botInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDbotInlineMessageMediaAuto::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5232,11 +5322,14 @@ void _serialize_botInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::Flag::f_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_botInlineMessageMediaGeo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineMessageMediaGeo::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5244,12 +5337,16 @@ void _serialize_botInlineMessageMediaGeo(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDbotInlineMessageMediaGeo::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_botInlineMessageMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineMessageMediaVenue::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5257,16 +5354,20 @@ void _serialize_botInlineMessageMediaVenue(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDbotInlineMessageMediaVenue::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } void _serialize_botInlineMessageMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineMessageMediaContact::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5274,9 +5375,11 @@ void _serialize_botInlineMessageMediaContact(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDbotInlineMessageMediaContact::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5478,6 +5581,21 @@ void _serialize_messages_messageEditData(MTPStringLogger &to, int32 stage, int32 } } +void _serialize_inputBotInlineMessageID(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineMessageID"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6044,6 +6162,26 @@ void _serialize_messages_setBotCallbackAnswer(MTPStringLogger &to, int32 stage, } } +void _serialize_messages_editInlineBotMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_editInlineBotMessage::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_editInlineBotMessage"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPmessages_editInlineBotMessage::Flag::f_no_webpage) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 2: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" entities: "); ++stages.back(); if (flag & MTPmessages_editInlineBotMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 5: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_editInlineBotMessage::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_upload_saveFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -8213,6 +8351,7 @@ namespace { _serializers.insert(mtpc_updateChannelPinnedMessage, _serialize_updateChannelPinnedMessage); _serializers.insert(mtpc_updateBotCallbackQuery, _serialize_updateBotCallbackQuery); _serializers.insert(mtpc_updateEditMessage, _serialize_updateEditMessage); + _serializers.insert(mtpc_updateInlineBotCallbackQuery, _serialize_updateInlineBotCallbackQuery); _serializers.insert(mtpc_updates_state, _serialize_updates_state); _serializers.insert(mtpc_updates_differenceEmpty, _serialize_updates_differenceEmpty); _serializers.insert(mtpc_updates_difference, _serialize_updates_difference); @@ -8338,6 +8477,7 @@ namespace { _serializers.insert(mtpc_replyKeyboardHide, _serialize_replyKeyboardHide); _serializers.insert(mtpc_replyKeyboardForceReply, _serialize_replyKeyboardForceReply); _serializers.insert(mtpc_replyKeyboardMarkup, _serialize_replyKeyboardMarkup); + _serializers.insert(mtpc_replyInlineMarkup, _serialize_replyInlineMarkup); _serializers.insert(mtpc_help_appChangelogEmpty, _serialize_help_appChangelogEmpty); _serializers.insert(mtpc_help_appChangelog, _serialize_help_appChangelog); _serializers.insert(mtpc_messageEntityUnknown, _serialize_messageEntityUnknown); @@ -8389,6 +8529,8 @@ namespace { _serializers.insert(mtpc_inputBotInlineMessageMediaVenue, _serialize_inputBotInlineMessageMediaVenue); _serializers.insert(mtpc_inputBotInlineMessageMediaContact, _serialize_inputBotInlineMessageMediaContact); _serializers.insert(mtpc_inputBotInlineResult, _serialize_inputBotInlineResult); + _serializers.insert(mtpc_inputBotInlineResultPhoto, _serialize_inputBotInlineResultPhoto); + _serializers.insert(mtpc_inputBotInlineResultDocument, _serialize_inputBotInlineResultDocument); _serializers.insert(mtpc_botInlineMessageMediaAuto, _serialize_botInlineMessageMediaAuto); _serializers.insert(mtpc_botInlineMessageText, _serialize_botInlineMessageText); _serializers.insert(mtpc_botInlineMessageMediaGeo, _serialize_botInlineMessageMediaGeo); @@ -8408,6 +8550,7 @@ namespace { _serializers.insert(mtpc_auth_sentCodeTypeFlashCall, _serialize_auth_sentCodeTypeFlashCall); _serializers.insert(mtpc_messages_botCallbackAnswer, _serialize_messages_botCallbackAnswer); _serializers.insert(mtpc_messages_messageEditData, _serialize_messages_messageEditData); + _serializers.insert(mtpc_inputBotInlineMessageID, _serialize_inputBotInlineMessageID); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -8451,6 +8594,7 @@ namespace { _serializers.insert(mtpc_messages_saveGif, _serialize_messages_saveGif); _serializers.insert(mtpc_messages_setInlineBotResults, _serialize_messages_setInlineBotResults); _serializers.insert(mtpc_messages_setBotCallbackAnswer, _serialize_messages_setBotCallbackAnswer); + _serializers.insert(mtpc_messages_editInlineBotMessage, _serialize_messages_editInlineBotMessage); _serializers.insert(mtpc_upload_saveFilePart, _serialize_upload_saveFilePart); _serializers.insert(mtpc_upload_saveBigFilePart, _serialize_upload_saveBigFilePart); _serializers.insert(mtpc_help_saveAppLog, _serialize_help_saveAppLog); diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.h b/Telegram/SourceFiles/mtproto/scheme_auto.h index 05c2e27c1..3290078d7 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -280,11 +280,12 @@ enum { mtpc_updateStickerSets = 0x43ae3dec, mtpc_updateSavedGifs = 0x9375341e, mtpc_updateBotInlineQuery = 0x54826690, - mtpc_updateBotInlineSend = 0xdaa0c53d, + mtpc_updateBotInlineSend = 0xe48f964, mtpc_updateEditChannelMessage = 0x1b3f4df7, mtpc_updateChannelPinnedMessage = 0x98592475, mtpc_updateBotCallbackQuery = 0xa68c688c, mtpc_updateEditMessage = 0xe40370a3, + mtpc_updateInlineBotCallbackQuery = 0x8bad2883, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, @@ -410,6 +411,7 @@ enum { mtpc_replyKeyboardHide = 0xa03e5b85, mtpc_replyKeyboardForceReply = 0xf4108aa0, mtpc_replyKeyboardMarkup = 0x3502758c, + mtpc_replyInlineMarkup = 0x48a30254, mtpc_help_appChangelogEmpty = 0xaf7e0394, mtpc_help_appChangelog = 0x4668e6bd, mtpc_messageEntityUnknown = 0xbb92ba95, @@ -455,17 +457,19 @@ enum { mtpc_messages_foundGifs = 0x450a1c0a, mtpc_messages_savedGifsNotModified = 0xe8025ca2, mtpc_messages_savedGifs = 0x2e0709a5, - mtpc_inputBotInlineMessageMediaAuto = 0x2e43e587, - mtpc_inputBotInlineMessageText = 0xadf0df71, - mtpc_inputBotInlineMessageMediaGeo = 0x197dce7e, - mtpc_inputBotInlineMessageMediaVenue = 0x8ab91f84, - mtpc_inputBotInlineMessageMediaContact = 0x52971c52, + mtpc_inputBotInlineMessageMediaAuto = 0x292fed13, + mtpc_inputBotInlineMessageText = 0x3dcd7a87, + mtpc_inputBotInlineMessageMediaGeo = 0xf4a59de1, + mtpc_inputBotInlineMessageMediaVenue = 0xaaafadc8, + mtpc_inputBotInlineMessageMediaContact = 0x2daf01a7, mtpc_inputBotInlineResult = 0x2cbbe15a, - mtpc_botInlineMessageMediaAuto = 0xfc56e87d, - mtpc_botInlineMessageText = 0xa56197a9, - mtpc_botInlineMessageMediaGeo = 0x59d1ff36, - mtpc_botInlineMessageMediaVenue = 0x6fa16678, - mtpc_botInlineMessageMediaContact = 0x89202361, + mtpc_inputBotInlineResultPhoto = 0xa8d864a7, + mtpc_inputBotInlineResultDocument = 0xfff8fdc4, + mtpc_botInlineMessageMediaAuto = 0xa74b15b, + mtpc_botInlineMessageText = 0x8c7f65e2, + mtpc_botInlineMessageMediaGeo = 0x3a8fd8b8, + mtpc_botInlineMessageMediaVenue = 0x4366232e, + mtpc_botInlineMessageMediaContact = 0x35edb4d4, mtpc_botInlineResult = 0x9bebaeb9, mtpc_botInlineMediaResult = 0x17db940b, mtpc_messages_botResults = 0x1170b0a3, @@ -480,6 +484,7 @@ enum { mtpc_auth_sentCodeTypeFlashCall = 0xab03c6d9, mtpc_messages_botCallbackAnswer = 0x1264f1c6, mtpc_messages_messageEditData = 0x26b5dde6, + mtpc_inputBotInlineMessageID = 0x890c3d89, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -601,6 +606,7 @@ enum { mtpc_messages_editMessage = 0xd2003257, mtpc_messages_getBotCallbackAnswer = 0xa6e94f04, mtpc_messages_setBotCallbackAnswer = 0x481c591a, + mtpc_messages_editInlineBotMessage = 0xa39b97fa, mtpc_updates_getState = 0xedd4882a, mtpc_updates_getDifference = 0xa041495, mtpc_updates_getChannelDifference = 0xbb32d7c0, @@ -990,6 +996,7 @@ class MTPDupdateEditChannelMessage; class MTPDupdateChannelPinnedMessage; class MTPDupdateBotCallbackQuery; class MTPDupdateEditMessage; +class MTPDupdateInlineBotCallbackQuery; class MTPupdates_state; class MTPDupdates_state; @@ -1190,6 +1197,7 @@ class MTPreplyMarkup; class MTPDreplyKeyboardHide; class MTPDreplyKeyboardForceReply; class MTPDreplyKeyboardMarkup; +class MTPDreplyInlineMarkup; class MTPhelp_appChangelog; class MTPDhelp_appChangelog; @@ -1267,6 +1275,8 @@ class MTPDinputBotInlineMessageMediaContact; class MTPinputBotInlineResult; class MTPDinputBotInlineResult; +class MTPDinputBotInlineResultPhoto; +class MTPDinputBotInlineResultDocument; class MTPbotInlineMessage; class MTPDbotInlineMessageMediaAuto; @@ -1302,6 +1312,9 @@ class MTPDmessages_botCallbackAnswer; class MTPmessages_messageEditData; class MTPDmessages_messageEditData; +class MTPinputBotInlineMessageID; +class MTPDinputBotInlineMessageID; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1469,6 +1482,7 @@ typedef MTPBoxed MTPauth_CodeType; typedef MTPBoxed MTPauth_SentCodeType; typedef MTPBoxed MTPmessages_BotCallbackAnswer; typedef MTPBoxed MTPmessages_MessageEditData; +typedef MTPBoxed MTPInputBotInlineMessageID; // Type classes definitions @@ -5457,6 +5471,18 @@ public: return *(const MTPDupdateEditMessage*)data; } + MTPDupdateInlineBotCallbackQuery &_updateInlineBotCallbackQuery() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateInlineBotCallbackQuery) throw mtpErrorWrongTypeId(_type, mtpc_updateInlineBotCallbackQuery); + split(); + return *(MTPDupdateInlineBotCallbackQuery*)data; + } + const MTPDupdateInlineBotCallbackQuery &c_updateInlineBotCallbackQuery() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateInlineBotCallbackQuery) throw mtpErrorWrongTypeId(_type, mtpc_updateInlineBotCallbackQuery); + return *(const MTPDupdateInlineBotCallbackQuery*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5511,6 +5537,7 @@ private: explicit MTPupdate(MTPDupdateChannelPinnedMessage *_data); explicit MTPupdate(MTPDupdateBotCallbackQuery *_data); explicit MTPupdate(MTPDupdateEditMessage *_data); + explicit MTPupdate(MTPDupdateInlineBotCallbackQuery *_data); friend class MTP::internal::TypeCreator; @@ -7833,6 +7860,18 @@ public: return *(const MTPDreplyKeyboardMarkup*)data; } + MTPDreplyInlineMarkup &_replyInlineMarkup() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_replyInlineMarkup) throw mtpErrorWrongTypeId(_type, mtpc_replyInlineMarkup); + split(); + return *(MTPDreplyInlineMarkup*)data; + } + const MTPDreplyInlineMarkup &c_replyInlineMarkup() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_replyInlineMarkup) throw mtpErrorWrongTypeId(_type, mtpc_replyInlineMarkup); + return *(const MTPDreplyInlineMarkup*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -7845,6 +7884,7 @@ private: explicit MTPreplyMarkup(MTPDreplyKeyboardHide *_data); explicit MTPreplyMarkup(MTPDreplyKeyboardForceReply *_data); explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data); + explicit MTPreplyMarkup(MTPDreplyInlineMarkup *_data); friend class MTP::internal::TypeCreator; @@ -8738,32 +8778,64 @@ typedef MTPBoxed MTPInputBotInlineMessage; class MTPinputBotInlineResult : private mtpDataOwner { public: - MTPinputBotInlineResult(); - MTPinputBotInlineResult(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputBotInlineResult) : mtpDataOwner(0) { + MTPinputBotInlineResult() : mtpDataOwner(0), _type(0) { + } + MTPinputBotInlineResult(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { read(from, end, cons); } MTPDinputBotInlineResult &_inputBotInlineResult() { if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResult) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResult); split(); return *(MTPDinputBotInlineResult*)data; } const MTPDinputBotInlineResult &c_inputBotInlineResult() const { if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResult) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResult); return *(const MTPDinputBotInlineResult*)data; } + MTPDinputBotInlineResultPhoto &_inputBotInlineResultPhoto() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResultPhoto) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResultPhoto); + split(); + return *(MTPDinputBotInlineResultPhoto*)data; + } + const MTPDinputBotInlineResultPhoto &c_inputBotInlineResultPhoto() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResultPhoto) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResultPhoto); + return *(const MTPDinputBotInlineResultPhoto*)data; + } + + MTPDinputBotInlineResultDocument &_inputBotInlineResultDocument() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResultDocument) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResultDocument); + split(); + return *(MTPDinputBotInlineResultDocument*)data; + } + const MTPDinputBotInlineResultDocument &c_inputBotInlineResultDocument() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineResultDocument) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineResultDocument); + return *(const MTPDinputBotInlineResultDocument*)data; + } + uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputBotInlineResult); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); void write(mtpBuffer &to) const; typedef void ResponseType; private: + explicit MTPinputBotInlineResult(mtpTypeId type); explicit MTPinputBotInlineResult(MTPDinputBotInlineResult *_data); + explicit MTPinputBotInlineResult(MTPDinputBotInlineResultPhoto *_data); + explicit MTPinputBotInlineResult(MTPDinputBotInlineResultDocument *_data); friend class MTP::internal::TypeCreator; + + mtpTypeId _type; }; typedef MTPBoxed MTPInputBotInlineResult; @@ -9161,6 +9233,37 @@ private: }; typedef MTPBoxed MTPmessages_MessageEditData; +class MTPinputBotInlineMessageID : private mtpDataOwner { +public: + MTPinputBotInlineMessageID(); + MTPinputBotInlineMessageID(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputBotInlineMessageID) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDinputBotInlineMessageID &_inputBotInlineMessageID() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDinputBotInlineMessageID*)data; + } + const MTPDinputBotInlineMessageID &c_inputBotInlineMessageID() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDinputBotInlineMessageID*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputBotInlineMessageID); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPinputBotInlineMessageID(MTPDinputBotInlineMessageID *_data); + + friend class MTP::internal::TypeCreator; +}; +typedef MTPBoxed MTPInputBotInlineMessageID; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -11506,16 +11609,19 @@ class MTPDupdateBotInlineSend : public mtpDataImpl { public: enum class Flag : int32 { f_geo = (1 << 0), - MAX_FIELD = (1 << 0), + f_msg_id = (1 << 1), + + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } bool has_geo() const { return vflags.v & Flag::f_geo; } + bool has_msg_id() const { return vflags.v & Flag::f_msg_id; } MTPDupdateBotInlineSend() { } - MTPDupdateBotInlineSend(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id) : vflags(_flags), vuser_id(_user_id), vquery(_query), vgeo(_geo), vid(_id) { + MTPDupdateBotInlineSend(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id, const MTPInputBotInlineMessageID &_msg_id) : vflags(_flags), vuser_id(_user_id), vquery(_query), vgeo(_geo), vid(_id), vmsg_id(_msg_id) { } MTPflags vflags; @@ -11523,6 +11629,7 @@ public: MTPstring vquery; MTPGeoPoint vgeo; MTPstring vid; + MTPInputBotInlineMessageID vmsg_id; }; class MTPDupdateEditChannelMessage : public mtpDataImpl { @@ -11574,6 +11681,29 @@ public: MTPint vpts_count; }; +class MTPDupdateInlineBotCallbackQuery : public mtpDataImpl { +public: + enum class Flag : int32 { + f_msg_id = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_msg_id() const { return vflags.v & Flag::f_msg_id; } + + MTPDupdateInlineBotCallbackQuery() { + } + MTPDupdateInlineBotCallbackQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPInputBotInlineMessageID &_msg_id, const MTPbytes &_data) : vflags(_flags), vquery_id(_query_id), vuser_id(_user_id), vmsg_id(_msg_id), vdata(_data) { + } + + MTPflags vflags; + MTPlong vquery_id; + MTPint vuser_id; + MTPInputBotInlineMessageID vmsg_id; + MTPbytes vdata; +}; + class MTPDupdates_state : public mtpDataImpl { public: MTPDupdates_state() { @@ -12868,9 +12998,8 @@ public: f_resize = (1 << 0), f_single_use = (1 << 1), f_selective = (1 << 2), - f_inline = (1 << 3), - MAX_FIELD = (1 << 3), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -12878,7 +13007,6 @@ public: bool is_resize() const { return vflags.v & Flag::f_resize; } bool is_single_use() const { return vflags.v & Flag::f_single_use; } bool is_selective() const { return vflags.v & Flag::f_selective; } - bool is_inline() const { return vflags.v & Flag::f_inline; } MTPDreplyKeyboardMarkup() { } @@ -12889,6 +13017,16 @@ public: MTPVector vrows; }; +class MTPDreplyInlineMarkup : public mtpDataImpl { +public: + MTPDreplyInlineMarkup() { + } + MTPDreplyInlineMarkup(const MTPVector &_rows) : vrows(_rows) { + } + + MTPVector vrows; +}; + class MTPDhelp_appChangelog : public mtpDataImpl { public: MTPDhelp_appChangelog() { @@ -13329,12 +13467,24 @@ public: class MTPDinputBotInlineMessageMediaAuto : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDinputBotInlineMessageMediaAuto() { } - MTPDinputBotInlineMessageMediaAuto(const MTPstring &_caption) : vcaption(_caption) { + MTPDinputBotInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vcaption(_caption), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPstring vcaption; + MTPReplyMarkup vreply_markup; }; class MTPDinputBotInlineMessageText : public mtpDataImpl { @@ -13342,59 +13492,98 @@ public: enum class Flag : int32 { f_no_webpage = (1 << 0), f_entities = (1 << 1), + f_reply_markup = (1 << 2), - MAX_FIELD = (1 << 1), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } bool has_entities() const { return vflags.v & Flag::f_entities; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } MTPDinputBotInlineMessageText() { } - MTPDinputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { + MTPDinputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vmessage(_message), ventities(_entities), vreply_markup(_reply_markup) { } MTPflags vflags; MTPstring vmessage; MTPVector ventities; + MTPReplyMarkup vreply_markup; }; class MTPDinputBotInlineMessageMediaGeo : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDinputBotInlineMessageMediaGeo() { } - MTPDinputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) : vgeo_point(_geo_point) { + MTPDinputBotInlineMessageMediaGeo(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vgeo_point(_geo_point), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPInputGeoPoint vgeo_point; + MTPReplyMarkup vreply_markup; }; class MTPDinputBotInlineMessageMediaVenue : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDinputBotInlineMessageMediaVenue() { } - MTPDinputBotInlineMessageMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) : vgeo_point(_geo_point), vtitle(_title), vaddress(_address), vprovider(_provider), vvenue_id(_venue_id) { + MTPDinputBotInlineMessageMediaVenue(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vgeo_point(_geo_point), vtitle(_title), vaddress(_address), vprovider(_provider), vvenue_id(_venue_id), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPInputGeoPoint vgeo_point; MTPstring vtitle; MTPstring vaddress; MTPstring vprovider; MTPstring vvenue_id; + MTPReplyMarkup vreply_markup; }; class MTPDinputBotInlineMessageMediaContact : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDinputBotInlineMessageMediaContact() { } - MTPDinputBotInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) : vphone_number(_phone_number), vfirst_name(_first_name), vlast_name(_last_name) { + MTPDinputBotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vphone_number(_phone_number), vfirst_name(_first_name), vlast_name(_last_name), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPstring vphone_number; MTPstring vfirst_name; MTPstring vlast_name; + MTPReplyMarkup vreply_markup; }; class MTPDinputBotInlineResult : public mtpDataImpl { @@ -13445,14 +13634,67 @@ public: MTPInputBotInlineMessage vsend_message; }; -class MTPDbotInlineMessageMediaAuto : public mtpDataImpl { +class MTPDinputBotInlineResultPhoto : public mtpDataImpl { public: - MTPDbotInlineMessageMediaAuto() { + MTPDinputBotInlineResultPhoto() { } - MTPDbotInlineMessageMediaAuto(const MTPstring &_caption) : vcaption(_caption) { + MTPDinputBotInlineResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) : vid(_id), vtype(_type), vphoto(_photo), vsend_message(_send_message) { } + MTPstring vid; + MTPstring vtype; + MTPInputPhoto vphoto; + MTPInputBotInlineMessage vsend_message; +}; + +class MTPDinputBotInlineResultDocument : public mtpDataImpl { +public: + enum class Flag : int32 { + f_title = (1 << 1), + f_description = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_title() const { return vflags.v & Flag::f_title; } + bool has_description() const { return vflags.v & Flag::f_description; } + + MTPDinputBotInlineResultDocument() { + } + MTPDinputBotInlineResultDocument(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPInputDocument &_document, const MTPInputBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vtitle(_title), vdescription(_description), vdocument(_document), vsend_message(_send_message) { + } + + MTPflags vflags; + MTPstring vid; + MTPstring vtype; + MTPstring vtitle; + MTPstring vdescription; + MTPInputDocument vdocument; + MTPInputBotInlineMessage vsend_message; +}; + +class MTPDbotInlineMessageMediaAuto : public mtpDataImpl { +public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + + MTPDbotInlineMessageMediaAuto() { + } + MTPDbotInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vcaption(_caption), vreply_markup(_reply_markup) { + } + + MTPflags vflags; MTPstring vcaption; + MTPReplyMarkup vreply_markup; }; class MTPDbotInlineMessageText : public mtpDataImpl { @@ -13460,59 +13702,98 @@ public: enum class Flag : int32 { f_no_webpage = (1 << 0), f_entities = (1 << 1), + f_reply_markup = (1 << 2), - MAX_FIELD = (1 << 1), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } bool has_entities() const { return vflags.v & Flag::f_entities; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } MTPDbotInlineMessageText() { } - MTPDbotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { + MTPDbotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vmessage(_message), ventities(_entities), vreply_markup(_reply_markup) { } MTPflags vflags; MTPstring vmessage; MTPVector ventities; + MTPReplyMarkup vreply_markup; }; class MTPDbotInlineMessageMediaGeo : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDbotInlineMessageMediaGeo() { } - MTPDbotInlineMessageMediaGeo(const MTPGeoPoint &_geo) : vgeo(_geo) { + MTPDbotInlineMessageMediaGeo(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vgeo(_geo), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPGeoPoint vgeo; + MTPReplyMarkup vreply_markup; }; class MTPDbotInlineMessageMediaVenue : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDbotInlineMessageMediaVenue() { } - MTPDbotInlineMessageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) : vgeo(_geo), vtitle(_title), vaddress(_address), vprovider(_provider), vvenue_id(_venue_id) { + MTPDbotInlineMessageMediaVenue(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vgeo(_geo), vtitle(_title), vaddress(_address), vprovider(_provider), vvenue_id(_venue_id), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPGeoPoint vgeo; MTPstring vtitle; MTPstring vaddress; MTPstring vprovider; MTPstring vvenue_id; + MTPReplyMarkup vreply_markup; }; class MTPDbotInlineMessageMediaContact : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDbotInlineMessageMediaContact() { } - MTPDbotInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) : vphone_number(_phone_number), vfirst_name(_first_name), vlast_name(_last_name) { + MTPDbotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vphone_number(_phone_number), vfirst_name(_first_name), vlast_name(_last_name), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPstring vphone_number; MTPstring vfirst_name; MTPstring vlast_name; + MTPReplyMarkup vreply_markup; }; class MTPDbotInlineResult : public mtpDataImpl { @@ -13741,6 +14022,18 @@ public: MTPflags vflags; }; +class MTPDinputBotInlineMessageID : public mtpDataImpl { +public: + MTPDinputBotInlineMessageID() { + } + MTPDinputBotInlineMessageID(MTPint _dc_id, const MTPlong &_id, const MTPlong &_access_hash) : vdc_id(_dc_id), vid(_id), vaccess_hash(_access_hash) { + } + + MTPint vdc_id; + MTPlong vid; + MTPlong vaccess_hash; +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -19422,6 +19715,74 @@ public: } }; +class MTPmessages_editInlineBotMessage { // RPC method 'messages.editInlineBotMessage' +public: + enum class Flag : int32 { + f_no_webpage = (1 << 1), + f_entities = (1 << 3), + f_reply_markup = (1 << 2), + + + MAX_FIELD = (1 << 3), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + + MTPflags vflags; + MTPInputBotInlineMessageID vid; + MTPstring vmessage; + MTPVector ventities; + MTPReplyMarkup vreply_markup; + + MTPmessages_editInlineBotMessage() { + } + MTPmessages_editInlineBotMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editInlineBotMessage) { + read(from, end, cons); + } + MTPmessages_editInlineBotMessage(const MTPflags &_flags, const MTPInputBotInlineMessageID &_id, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vid(_id), vmessage(_message), ventities(_entities), vreply_markup(_reply_markup) { + } + + uint32 innerLength() const { + return vflags.innerLength() + vid.innerLength() + vmessage.innerLength() + (has_entities() ? ventities.innerLength() : 0) + (has_reply_markup() ? vreply_markup.innerLength() : 0); + } + mtpTypeId type() const { + return mtpc_messages_editInlineBotMessage; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editInlineBotMessage) { + vflags.read(from, end); + vid.read(from, end); + vmessage.read(from, end); + if (has_entities()) { ventities.read(from, end); } else { ventities = MTPVector(); } + if (has_reply_markup()) { vreply_markup.read(from, end); } else { vreply_markup = MTPReplyMarkup(); } + } + void write(mtpBuffer &to) const { + vflags.write(to); + vid.write(to); + vmessage.write(to); + if (has_entities()) ventities.write(to); + if (has_reply_markup()) vreply_markup.write(to); + } + + typedef MTPBool ResponseType; +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_editInlineBotMessage::Flags) + +class MTPmessages_EditInlineBotMessage : public MTPBoxed { +public: + MTPmessages_EditInlineBotMessage() { + } + MTPmessages_EditInlineBotMessage(const MTPmessages_editInlineBotMessage &v) : MTPBoxed(v) { + } + MTPmessages_EditInlineBotMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_EditInlineBotMessage(const MTPflags &_flags, const MTPInputBotInlineMessageID &_id, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) : MTPBoxed(MTPmessages_editInlineBotMessage(_flags, _id, _message, _entities, _reply_markup)) { + } +}; + class MTPupdates_getState { // RPC method 'updates.getState' public: MTPupdates_getState() { @@ -22132,8 +22493,8 @@ public: inline static MTPupdate new_updateBotInlineQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_offset) { return MTPupdate(new MTPDupdateBotInlineQuery(_flags, _query_id, _user_id, _query, _geo, _offset)); } - inline static MTPupdate new_updateBotInlineSend(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id) { - return MTPupdate(new MTPDupdateBotInlineSend(_flags, _user_id, _query, _geo, _id)); + inline static MTPupdate new_updateBotInlineSend(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id, const MTPInputBotInlineMessageID &_msg_id) { + return MTPupdate(new MTPDupdateBotInlineSend(_flags, _user_id, _query, _geo, _id, _msg_id)); } inline static MTPupdate new_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); @@ -22147,6 +22508,9 @@ public: inline static MTPupdate new_updateEditMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateEditMessage(_message, _pts, _pts_count)); } + inline static MTPupdate new_updateInlineBotCallbackQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPInputBotInlineMessageID &_msg_id, const MTPbytes &_data) { + return MTPupdate(new MTPDupdateInlineBotCallbackQuery(_flags, _query_id, _user_id, _msg_id, _data)); + } inline static MTPupdates_state new_updates_state(MTPint _pts, MTPint _qts, MTPint _date, MTPint _seq, MTPint _unread_count) { return MTPupdates_state(new MTPDupdates_state(_pts, _qts, _date, _seq, _unread_count)); } @@ -22522,6 +22886,9 @@ public: inline static MTPreplyMarkup new_replyKeyboardMarkup(const MTPflags &_flags, const MTPVector &_rows) { return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_flags, _rows)); } + inline static MTPreplyMarkup new_replyInlineMarkup(const MTPVector &_rows) { + return MTPreplyMarkup(new MTPDreplyInlineMarkup(_rows)); + } inline static MTPhelp_appChangelog new_help_appChangelogEmpty() { return MTPhelp_appChangelog(mtpc_help_appChangelogEmpty); } @@ -22657,38 +23024,44 @@ public: inline static MTPmessages_savedGifs new_messages_savedGifs(MTPint _hash, const MTPVector &_gifs) { return MTPmessages_savedGifs(new MTPDmessages_savedGifs(_hash, _gifs)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaAuto(const MTPstring &_caption) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaAuto(_caption)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaAuto(_flags, _caption, _reply_markup)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageText(_flags, _message, _entities)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageText(_flags, _message, _entities, _reply_markup)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaGeo(_geo_point)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaGeo(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaGeo(_flags, _geo_point, _reply_markup)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaVenue(_geo_point, _title, _address, _provider, _venue_id)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaVenue(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaVenue(_flags, _geo_point, _title, _address, _provider, _venue_id, _reply_markup)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaContact(_phone_number, _first_name, _last_name)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup)); } inline static MTPinputBotInlineResult new_inputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { return MTPinputBotInlineResult(new MTPDinputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); } - inline static MTPbotInlineMessage new_botInlineMessageMediaAuto(const MTPstring &_caption) { - return MTPbotInlineMessage(new MTPDbotInlineMessageMediaAuto(_caption)); + inline static MTPinputBotInlineResult new_inputBotInlineResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) { + return MTPinputBotInlineResult(new MTPDinputBotInlineResultPhoto(_id, _type, _photo, _send_message)); } - inline static MTPbotInlineMessage new_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { - return MTPbotInlineMessage(new MTPDbotInlineMessageText(_flags, _message, _entities)); + inline static MTPinputBotInlineResult new_inputBotInlineResultDocument(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPInputDocument &_document, const MTPInputBotInlineMessage &_send_message) { + return MTPinputBotInlineResult(new MTPDinputBotInlineResultDocument(_flags, _id, _type, _title, _description, _document, _send_message)); } - inline static MTPbotInlineMessage new_botInlineMessageMediaGeo(const MTPGeoPoint &_geo) { - return MTPbotInlineMessage(new MTPDbotInlineMessageMediaGeo(_geo)); + inline static MTPbotInlineMessage new_botInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaAuto(_flags, _caption, _reply_markup)); } - inline static MTPbotInlineMessage new_botInlineMessageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTPbotInlineMessage(new MTPDbotInlineMessageMediaVenue(_geo, _title, _address, _provider, _venue_id)); + inline static MTPbotInlineMessage new_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) { + return MTPbotInlineMessage(new MTPDbotInlineMessageText(_flags, _message, _entities, _reply_markup)); } - inline static MTPbotInlineMessage new_botInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTPbotInlineMessage(new MTPDbotInlineMessageMediaContact(_phone_number, _first_name, _last_name)); + inline static MTPbotInlineMessage new_botInlineMessageMediaGeo(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPReplyMarkup &_reply_markup) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaGeo(_flags, _geo, _reply_markup)); + } + inline static MTPbotInlineMessage new_botInlineMessageMediaVenue(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaVenue(_flags, _geo, _title, _address, _provider, _venue_id, _reply_markup)); + } + inline static MTPbotInlineMessage new_botInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup)); } inline static MTPbotInlineResult new_botInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) { return MTPbotInlineResult(new MTPDbotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); @@ -22732,6 +23105,9 @@ public: inline static MTPmessages_messageEditData new_messages_messageEditData(const MTPflags &_flags) { return MTPmessages_messageEditData(new MTPDmessages_messageEditData(_flags)); } + inline static MTPinputBotInlineMessageID new_inputBotInlineMessageID(MTPint _dc_id, const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputBotInlineMessageID(new MTPDinputBotInlineMessageID(_dc_id, _id, _access_hash)); + } }; } // namespace internal @@ -27620,7 +27996,7 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateBotInlineSend: { const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); - return v.vflags.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + (v.has_geo() ? v.vgeo.innerLength() : 0) + v.vid.innerLength(); + return v.vflags.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + (v.has_geo() ? v.vgeo.innerLength() : 0) + v.vid.innerLength() + (v.has_msg_id() ? v.vmsg_id.innerLength() : 0); } case mtpc_updateEditChannelMessage: { const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); @@ -27638,6 +28014,10 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateEditMessage &v(c_updateEditMessage()); return v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); } + case mtpc_updateInlineBotCallbackQuery: { + const MTPDupdateInlineBotCallbackQuery &v(c_updateInlineBotCallbackQuery()); + return v.vflags.innerLength() + v.vquery_id.innerLength() + v.vuser_id.innerLength() + (v.has_msg_id() ? v.vmsg_id.innerLength() : 0) + v.vdata.innerLength(); + } } return 0; } @@ -27927,6 +28307,7 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vquery.read(from, end); if (v.has_geo()) { v.vgeo.read(from, end); } else { v.vgeo = MTPGeoPoint(); } v.vid.read(from, end); + if (v.has_msg_id()) { v.vmsg_id.read(from, end); } else { v.vmsg_id = MTPInputBotInlineMessageID(); } } break; case mtpc_updateEditChannelMessage: _type = cons; { if (!data) setData(new MTPDupdateEditChannelMessage()); @@ -27957,6 +28338,15 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vpts.read(from, end); v.vpts_count.read(from, end); } break; + case mtpc_updateInlineBotCallbackQuery: _type = cons; { + if (!data) setData(new MTPDupdateInlineBotCallbackQuery()); + MTPDupdateInlineBotCallbackQuery &v(_updateInlineBotCallbackQuery()); + v.vflags.read(from, end); + v.vquery_id.read(from, end); + v.vuser_id.read(from, end); + if (v.has_msg_id()) { v.vmsg_id.read(from, end); } else { v.vmsg_id = MTPInputBotInlineMessageID(); } + v.vdata.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPupdate"); } } @@ -28198,6 +28588,7 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vquery.write(to); if (v.has_geo()) v.vgeo.write(to); v.vid.write(to); + if (v.has_msg_id()) v.vmsg_id.write(to); } break; case mtpc_updateEditChannelMessage: { const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); @@ -28224,6 +28615,14 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vpts.write(to); v.vpts_count.write(to); } break; + case mtpc_updateInlineBotCallbackQuery: { + const MTPDupdateInlineBotCallbackQuery &v(c_updateInlineBotCallbackQuery()); + v.vflags.write(to); + v.vquery_id.write(to); + v.vuser_id.write(to); + if (v.has_msg_id()) v.vmsg_id.write(to); + v.vdata.write(to); + } break; } } inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -28275,6 +28674,7 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateChannelPinnedMessage: setData(new MTPDupdateChannelPinnedMessage()); break; case mtpc_updateBotCallbackQuery: setData(new MTPDupdateBotCallbackQuery()); break; case mtpc_updateEditMessage: setData(new MTPDupdateEditMessage()); break; + case mtpc_updateInlineBotCallbackQuery: setData(new MTPDupdateInlineBotCallbackQuery()); break; default: throw mtpErrorBadTypeId(type, "MTPupdate"); } } @@ -28368,6 +28768,8 @@ inline MTPupdate::MTPupdate(MTPDupdateBotCallbackQuery *_data) : mtpDataOwner(_d } inline MTPupdate::MTPupdate(MTPDupdateEditMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateEditMessage) { } +inline MTPupdate::MTPupdate(MTPDupdateInlineBotCallbackQuery *_data) : mtpDataOwner(_data), _type(mtpc_updateInlineBotCallbackQuery) { +} inline MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateNewMessage(_message, _pts, _pts_count); } @@ -28497,8 +28899,8 @@ inline MTPupdate MTP_updateBotInlineQuery(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id) { - return MTP::internal::TypeCreator::new_updateBotInlineSend(_flags, _user_id, _query, _geo, _id); +inline MTPupdate MTP_updateBotInlineSend(const MTPflags &_flags, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_id, const MTPInputBotInlineMessageID &_msg_id) { + return MTP::internal::TypeCreator::new_updateBotInlineSend(_flags, _user_id, _query, _geo, _id, _msg_id); } inline MTPupdate MTP_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateEditChannelMessage(_message, _pts, _pts_count); @@ -28512,6 +28914,10 @@ inline MTPupdate MTP_updateBotCallbackQuery(const MTPlong &_query_id, MTPint _us inline MTPupdate MTP_updateEditMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateEditMessage(_message, _pts, _pts_count); } +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateInlineBotCallbackQuery::Flags) +inline MTPupdate MTP_updateInlineBotCallbackQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPInputBotInlineMessageID &_msg_id, const MTPbytes &_data) { + return MTP::internal::TypeCreator::new_updateInlineBotCallbackQuery(_flags, _query_id, _user_id, _msg_id, _data); +} inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { } @@ -31657,6 +32063,10 @@ inline uint32 MTPreplyMarkup::innerLength() const { const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup()); return v.vflags.innerLength() + v.vrows.innerLength(); } + case mtpc_replyInlineMarkup: { + const MTPDreplyInlineMarkup &v(c_replyInlineMarkup()); + return v.vrows.innerLength(); + } } return 0; } @@ -31683,6 +32093,11 @@ inline void MTPreplyMarkup::read(const mtpPrime *&from, const mtpPrime *end, mtp v.vflags.read(from, end); v.vrows.read(from, end); } break; + case mtpc_replyInlineMarkup: _type = cons; { + if (!data) setData(new MTPDreplyInlineMarkup()); + MTPDreplyInlineMarkup &v(_replyInlineMarkup()); + v.vrows.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPreplyMarkup"); } } @@ -31701,6 +32116,10 @@ inline void MTPreplyMarkup::write(mtpBuffer &to) const { v.vflags.write(to); v.vrows.write(to); } break; + case mtpc_replyInlineMarkup: { + const MTPDreplyInlineMarkup &v(c_replyInlineMarkup()); + v.vrows.write(to); + } break; } } inline MTPreplyMarkup::MTPreplyMarkup(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -31708,6 +32127,7 @@ inline MTPreplyMarkup::MTPreplyMarkup(mtpTypeId type) : mtpDataOwner(0), _type(t case mtpc_replyKeyboardHide: setData(new MTPDreplyKeyboardHide()); break; case mtpc_replyKeyboardForceReply: setData(new MTPDreplyKeyboardForceReply()); break; case mtpc_replyKeyboardMarkup: setData(new MTPDreplyKeyboardMarkup()); break; + case mtpc_replyInlineMarkup: setData(new MTPDreplyInlineMarkup()); break; default: throw mtpErrorBadTypeId(type, "MTPreplyMarkup"); } } @@ -31717,6 +32137,8 @@ inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardForceReply *_data) : mtpD } inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data) : mtpDataOwner(_data), _type(mtpc_replyKeyboardMarkup) { } +inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyInlineMarkup *_data) : mtpDataOwner(_data), _type(mtpc_replyInlineMarkup) { +} Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDreplyKeyboardHide::Flags) inline MTPreplyMarkup MTP_replyKeyboardHide(const MTPflags &_flags) { return MTP::internal::TypeCreator::new_replyKeyboardHide(_flags); @@ -31729,6 +32151,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDreplyKeyboardMarkup::Flags) inline MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPflags &_flags, const MTPVector &_rows) { return MTP::internal::TypeCreator::new_replyKeyboardMarkup(_flags, _rows); } +inline MTPreplyMarkup MTP_replyInlineMarkup(const MTPVector &_rows) { + return MTP::internal::TypeCreator::new_replyInlineMarkup(_rows); +} inline uint32 MTPhelp_appChangelog::innerLength() const { switch (_type) { @@ -32841,23 +33266,23 @@ inline uint32 MTPinputBotInlineMessage::innerLength() const { switch (_type) { case mtpc_inputBotInlineMessageMediaAuto: { const MTPDinputBotInlineMessageMediaAuto &v(c_inputBotInlineMessageMediaAuto()); - return v.vcaption.innerLength(); + return v.vflags.innerLength() + v.vcaption.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_inputBotInlineMessageText: { const MTPDinputBotInlineMessageText &v(c_inputBotInlineMessageText()); - return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_inputBotInlineMessageMediaGeo: { const MTPDinputBotInlineMessageMediaGeo &v(c_inputBotInlineMessageMediaGeo()); - return v.vgeo_point.innerLength(); + return v.vflags.innerLength() + v.vgeo_point.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_inputBotInlineMessageMediaVenue: { const MTPDinputBotInlineMessageMediaVenue &v(c_inputBotInlineMessageMediaVenue()); - return v.vgeo_point.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vprovider.innerLength() + v.vvenue_id.innerLength(); + return v.vflags.innerLength() + v.vgeo_point.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vprovider.innerLength() + v.vvenue_id.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_inputBotInlineMessageMediaContact: { const MTPDinputBotInlineMessageMediaContact &v(c_inputBotInlineMessageMediaContact()); - return v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength(); + return v.vflags.innerLength() + v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } } return 0; @@ -32872,7 +33297,9 @@ inline void MTPinputBotInlineMessage::read(const mtpPrime *&from, const mtpPrime case mtpc_inputBotInlineMessageMediaAuto: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageMediaAuto()); MTPDinputBotInlineMessageMediaAuto &v(_inputBotInlineMessageMediaAuto()); + v.vflags.read(from, end); v.vcaption.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_inputBotInlineMessageText: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageText()); @@ -32880,27 +33307,34 @@ inline void MTPinputBotInlineMessage::read(const mtpPrime *&from, const mtpPrime v.vflags.read(from, end); v.vmessage.read(from, end); if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_inputBotInlineMessageMediaGeo: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageMediaGeo()); MTPDinputBotInlineMessageMediaGeo &v(_inputBotInlineMessageMediaGeo()); + v.vflags.read(from, end); v.vgeo_point.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_inputBotInlineMessageMediaVenue: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageMediaVenue()); MTPDinputBotInlineMessageMediaVenue &v(_inputBotInlineMessageMediaVenue()); + v.vflags.read(from, end); v.vgeo_point.read(from, end); v.vtitle.read(from, end); v.vaddress.read(from, end); v.vprovider.read(from, end); v.vvenue_id.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_inputBotInlineMessageMediaContact: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageMediaContact()); MTPDinputBotInlineMessageMediaContact &v(_inputBotInlineMessageMediaContact()); + v.vflags.read(from, end); v.vphone_number.read(from, end); v.vfirst_name.read(from, end); v.vlast_name.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; default: throw mtpErrorUnexpected(cons, "MTPinputBotInlineMessage"); } @@ -32909,31 +33343,40 @@ inline void MTPinputBotInlineMessage::write(mtpBuffer &to) const { switch (_type) { case mtpc_inputBotInlineMessageMediaAuto: { const MTPDinputBotInlineMessageMediaAuto &v(c_inputBotInlineMessageMediaAuto()); + v.vflags.write(to); v.vcaption.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_inputBotInlineMessageText: { const MTPDinputBotInlineMessageText &v(c_inputBotInlineMessageText()); v.vflags.write(to); v.vmessage.write(to); if (v.has_entities()) v.ventities.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_inputBotInlineMessageMediaGeo: { const MTPDinputBotInlineMessageMediaGeo &v(c_inputBotInlineMessageMediaGeo()); + v.vflags.write(to); v.vgeo_point.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_inputBotInlineMessageMediaVenue: { const MTPDinputBotInlineMessageMediaVenue &v(c_inputBotInlineMessageMediaVenue()); + v.vflags.write(to); v.vgeo_point.write(to); v.vtitle.write(to); v.vaddress.write(to); v.vprovider.write(to); v.vvenue_id.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_inputBotInlineMessageMediaContact: { const MTPDinputBotInlineMessageMediaContact &v(c_inputBotInlineMessageMediaContact()); + v.vflags.write(to); v.vphone_number.write(to); v.vfirst_name.write(to); v.vlast_name.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; } } @@ -32957,96 +33400,174 @@ inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMess } inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageMediaContact) { } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaAuto(const MTPstring &_caption) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaAuto(_caption); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageMediaAuto::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaAuto(_flags, _caption, _reply_markup); } Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageText::Flags) -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageText(_flags, _message, _entities); +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageText(_flags, _message, _entities, _reply_markup); } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaGeo(_geo_point); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageMediaGeo::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaGeo(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaGeo(_flags, _geo_point, _reply_markup); } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaVenue(_geo_point, _title, _address, _provider, _venue_id); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageMediaVenue::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaVenue(const MTPflags &_flags, const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaVenue(_flags, _geo_point, _title, _address, _provider, _venue_id, _reply_markup); } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaContact(_phone_number, _first_name, _last_name); -} - -inline MTPinputBotInlineResult::MTPinputBotInlineResult() : mtpDataOwner(new MTPDinputBotInlineResult()) { +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageMediaContact::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup); } inline uint32 MTPinputBotInlineResult::innerLength() const { - const MTPDinputBotInlineResult &v(c_inputBotInlineResult()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vtype.innerLength() + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_url() ? v.vurl.innerLength() : 0) + (v.has_thumb_url() ? v.vthumb_url.innerLength() : 0) + (v.has_content_url() ? v.vcontent_url.innerLength() : 0) + (v.has_content_type() ? v.vcontent_type.innerLength() : 0) + (v.has_w() ? v.vw.innerLength() : 0) + (v.has_h() ? v.vh.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0) + v.vsend_message.innerLength(); + switch (_type) { + case mtpc_inputBotInlineResult: { + const MTPDinputBotInlineResult &v(c_inputBotInlineResult()); + return v.vflags.innerLength() + v.vid.innerLength() + v.vtype.innerLength() + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_url() ? v.vurl.innerLength() : 0) + (v.has_thumb_url() ? v.vthumb_url.innerLength() : 0) + (v.has_content_url() ? v.vcontent_url.innerLength() : 0) + (v.has_content_type() ? v.vcontent_type.innerLength() : 0) + (v.has_w() ? v.vw.innerLength() : 0) + (v.has_h() ? v.vh.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0) + v.vsend_message.innerLength(); + } + case mtpc_inputBotInlineResultPhoto: { + const MTPDinputBotInlineResultPhoto &v(c_inputBotInlineResultPhoto()); + return v.vid.innerLength() + v.vtype.innerLength() + v.vphoto.innerLength() + v.vsend_message.innerLength(); + } + case mtpc_inputBotInlineResultDocument: { + const MTPDinputBotInlineResultDocument &v(c_inputBotInlineResultDocument()); + return v.vflags.innerLength() + v.vid.innerLength() + v.vtype.innerLength() + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + v.vdocument.innerLength() + v.vsend_message.innerLength(); + } + } + return 0; } inline mtpTypeId MTPinputBotInlineResult::type() const { - return mtpc_inputBotInlineResult; + if (!_type) throw mtpErrorUninitialized(); + return _type; } inline void MTPinputBotInlineResult::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_inputBotInlineResult) throw mtpErrorUnexpected(cons, "MTPinputBotInlineResult"); - - if (!data) setData(new MTPDinputBotInlineResult()); - MTPDinputBotInlineResult &v(_inputBotInlineResult()); - v.vflags.read(from, end); - v.vid.read(from, end); - v.vtype.read(from, end); - if (v.has_title()) { v.vtitle.read(from, end); } else { v.vtitle = MTPstring(); } - if (v.has_description()) { v.vdescription.read(from, end); } else { v.vdescription = MTPstring(); } - if (v.has_url()) { v.vurl.read(from, end); } else { v.vurl = MTPstring(); } - if (v.has_thumb_url()) { v.vthumb_url.read(from, end); } else { v.vthumb_url = MTPstring(); } - if (v.has_content_url()) { v.vcontent_url.read(from, end); } else { v.vcontent_url = MTPstring(); } - if (v.has_content_type()) { v.vcontent_type.read(from, end); } else { v.vcontent_type = MTPstring(); } - if (v.has_w()) { v.vw.read(from, end); } else { v.vw = MTPint(); } - if (v.has_h()) { v.vh.read(from, end); } else { v.vh = MTPint(); } - if (v.has_duration()) { v.vduration.read(from, end); } else { v.vduration = MTPint(); } - v.vsend_message.read(from, end); + if (cons != _type) setData(0); + switch (cons) { + case mtpc_inputBotInlineResult: _type = cons; { + if (!data) setData(new MTPDinputBotInlineResult()); + MTPDinputBotInlineResult &v(_inputBotInlineResult()); + v.vflags.read(from, end); + v.vid.read(from, end); + v.vtype.read(from, end); + if (v.has_title()) { v.vtitle.read(from, end); } else { v.vtitle = MTPstring(); } + if (v.has_description()) { v.vdescription.read(from, end); } else { v.vdescription = MTPstring(); } + if (v.has_url()) { v.vurl.read(from, end); } else { v.vurl = MTPstring(); } + if (v.has_thumb_url()) { v.vthumb_url.read(from, end); } else { v.vthumb_url = MTPstring(); } + if (v.has_content_url()) { v.vcontent_url.read(from, end); } else { v.vcontent_url = MTPstring(); } + if (v.has_content_type()) { v.vcontent_type.read(from, end); } else { v.vcontent_type = MTPstring(); } + if (v.has_w()) { v.vw.read(from, end); } else { v.vw = MTPint(); } + if (v.has_h()) { v.vh.read(from, end); } else { v.vh = MTPint(); } + if (v.has_duration()) { v.vduration.read(from, end); } else { v.vduration = MTPint(); } + v.vsend_message.read(from, end); + } break; + case mtpc_inputBotInlineResultPhoto: _type = cons; { + if (!data) setData(new MTPDinputBotInlineResultPhoto()); + MTPDinputBotInlineResultPhoto &v(_inputBotInlineResultPhoto()); + v.vid.read(from, end); + v.vtype.read(from, end); + v.vphoto.read(from, end); + v.vsend_message.read(from, end); + } break; + case mtpc_inputBotInlineResultDocument: _type = cons; { + if (!data) setData(new MTPDinputBotInlineResultDocument()); + MTPDinputBotInlineResultDocument &v(_inputBotInlineResultDocument()); + v.vflags.read(from, end); + v.vid.read(from, end); + v.vtype.read(from, end); + if (v.has_title()) { v.vtitle.read(from, end); } else { v.vtitle = MTPstring(); } + if (v.has_description()) { v.vdescription.read(from, end); } else { v.vdescription = MTPstring(); } + v.vdocument.read(from, end); + v.vsend_message.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPinputBotInlineResult"); + } } inline void MTPinputBotInlineResult::write(mtpBuffer &to) const { - const MTPDinputBotInlineResult &v(c_inputBotInlineResult()); - v.vflags.write(to); - v.vid.write(to); - v.vtype.write(to); - if (v.has_title()) v.vtitle.write(to); - if (v.has_description()) v.vdescription.write(to); - if (v.has_url()) v.vurl.write(to); - if (v.has_thumb_url()) v.vthumb_url.write(to); - if (v.has_content_url()) v.vcontent_url.write(to); - if (v.has_content_type()) v.vcontent_type.write(to); - if (v.has_w()) v.vw.write(to); - if (v.has_h()) v.vh.write(to); - if (v.has_duration()) v.vduration.write(to); - v.vsend_message.write(to); + switch (_type) { + case mtpc_inputBotInlineResult: { + const MTPDinputBotInlineResult &v(c_inputBotInlineResult()); + v.vflags.write(to); + v.vid.write(to); + v.vtype.write(to); + if (v.has_title()) v.vtitle.write(to); + if (v.has_description()) v.vdescription.write(to); + if (v.has_url()) v.vurl.write(to); + if (v.has_thumb_url()) v.vthumb_url.write(to); + if (v.has_content_url()) v.vcontent_url.write(to); + if (v.has_content_type()) v.vcontent_type.write(to); + if (v.has_w()) v.vw.write(to); + if (v.has_h()) v.vh.write(to); + if (v.has_duration()) v.vduration.write(to); + v.vsend_message.write(to); + } break; + case mtpc_inputBotInlineResultPhoto: { + const MTPDinputBotInlineResultPhoto &v(c_inputBotInlineResultPhoto()); + v.vid.write(to); + v.vtype.write(to); + v.vphoto.write(to); + v.vsend_message.write(to); + } break; + case mtpc_inputBotInlineResultDocument: { + const MTPDinputBotInlineResultDocument &v(c_inputBotInlineResultDocument()); + v.vflags.write(to); + v.vid.write(to); + v.vtype.write(to); + if (v.has_title()) v.vtitle.write(to); + if (v.has_description()) v.vdescription.write(to); + v.vdocument.write(to); + v.vsend_message.write(to); + } break; + } } -inline MTPinputBotInlineResult::MTPinputBotInlineResult(MTPDinputBotInlineResult *_data) : mtpDataOwner(_data) { +inline MTPinputBotInlineResult::MTPinputBotInlineResult(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_inputBotInlineResult: setData(new MTPDinputBotInlineResult()); break; + case mtpc_inputBotInlineResultPhoto: setData(new MTPDinputBotInlineResultPhoto()); break; + case mtpc_inputBotInlineResultDocument: setData(new MTPDinputBotInlineResultDocument()); break; + default: throw mtpErrorBadTypeId(type, "MTPinputBotInlineResult"); + } +} +inline MTPinputBotInlineResult::MTPinputBotInlineResult(MTPDinputBotInlineResult *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineResult) { +} +inline MTPinputBotInlineResult::MTPinputBotInlineResult(MTPDinputBotInlineResultPhoto *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineResultPhoto) { +} +inline MTPinputBotInlineResult::MTPinputBotInlineResult(MTPDinputBotInlineResultDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineResultDocument) { } Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineResult::Flags) inline MTPinputBotInlineResult MTP_inputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { return MTP::internal::TypeCreator::new_inputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message); } +inline MTPinputBotInlineResult MTP_inputBotInlineResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) { + return MTP::internal::TypeCreator::new_inputBotInlineResultPhoto(_id, _type, _photo, _send_message); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineResultDocument::Flags) +inline MTPinputBotInlineResult MTP_inputBotInlineResultDocument(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPInputDocument &_document, const MTPInputBotInlineMessage &_send_message) { + return MTP::internal::TypeCreator::new_inputBotInlineResultDocument(_flags, _id, _type, _title, _description, _document, _send_message); +} inline uint32 MTPbotInlineMessage::innerLength() const { switch (_type) { case mtpc_botInlineMessageMediaAuto: { const MTPDbotInlineMessageMediaAuto &v(c_botInlineMessageMediaAuto()); - return v.vcaption.innerLength(); + return v.vflags.innerLength() + v.vcaption.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_botInlineMessageText: { const MTPDbotInlineMessageText &v(c_botInlineMessageText()); - return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_botInlineMessageMediaGeo: { const MTPDbotInlineMessageMediaGeo &v(c_botInlineMessageMediaGeo()); - return v.vgeo.innerLength(); + return v.vflags.innerLength() + v.vgeo.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_botInlineMessageMediaVenue: { const MTPDbotInlineMessageMediaVenue &v(c_botInlineMessageMediaVenue()); - return v.vgeo.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vprovider.innerLength() + v.vvenue_id.innerLength(); + return v.vflags.innerLength() + v.vgeo.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vprovider.innerLength() + v.vvenue_id.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } case mtpc_botInlineMessageMediaContact: { const MTPDbotInlineMessageMediaContact &v(c_botInlineMessageMediaContact()); - return v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength(); + return v.vflags.innerLength() + v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } } return 0; @@ -33061,7 +33582,9 @@ inline void MTPbotInlineMessage::read(const mtpPrime *&from, const mtpPrime *end case mtpc_botInlineMessageMediaAuto: _type = cons; { if (!data) setData(new MTPDbotInlineMessageMediaAuto()); MTPDbotInlineMessageMediaAuto &v(_botInlineMessageMediaAuto()); + v.vflags.read(from, end); v.vcaption.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_botInlineMessageText: _type = cons; { if (!data) setData(new MTPDbotInlineMessageText()); @@ -33069,27 +33592,34 @@ inline void MTPbotInlineMessage::read(const mtpPrime *&from, const mtpPrime *end v.vflags.read(from, end); v.vmessage.read(from, end); if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_botInlineMessageMediaGeo: _type = cons; { if (!data) setData(new MTPDbotInlineMessageMediaGeo()); MTPDbotInlineMessageMediaGeo &v(_botInlineMessageMediaGeo()); + v.vflags.read(from, end); v.vgeo.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_botInlineMessageMediaVenue: _type = cons; { if (!data) setData(new MTPDbotInlineMessageMediaVenue()); MTPDbotInlineMessageMediaVenue &v(_botInlineMessageMediaVenue()); + v.vflags.read(from, end); v.vgeo.read(from, end); v.vtitle.read(from, end); v.vaddress.read(from, end); v.vprovider.read(from, end); v.vvenue_id.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; case mtpc_botInlineMessageMediaContact: _type = cons; { if (!data) setData(new MTPDbotInlineMessageMediaContact()); MTPDbotInlineMessageMediaContact &v(_botInlineMessageMediaContact()); + v.vflags.read(from, end); v.vphone_number.read(from, end); v.vfirst_name.read(from, end); v.vlast_name.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; default: throw mtpErrorUnexpected(cons, "MTPbotInlineMessage"); } @@ -33098,31 +33628,40 @@ inline void MTPbotInlineMessage::write(mtpBuffer &to) const { switch (_type) { case mtpc_botInlineMessageMediaAuto: { const MTPDbotInlineMessageMediaAuto &v(c_botInlineMessageMediaAuto()); + v.vflags.write(to); v.vcaption.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_botInlineMessageText: { const MTPDbotInlineMessageText &v(c_botInlineMessageText()); v.vflags.write(to); v.vmessage.write(to); if (v.has_entities()) v.ventities.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_botInlineMessageMediaGeo: { const MTPDbotInlineMessageMediaGeo &v(c_botInlineMessageMediaGeo()); + v.vflags.write(to); v.vgeo.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_botInlineMessageMediaVenue: { const MTPDbotInlineMessageMediaVenue &v(c_botInlineMessageMediaVenue()); + v.vflags.write(to); v.vgeo.write(to); v.vtitle.write(to); v.vaddress.write(to); v.vprovider.write(to); v.vvenue_id.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; case mtpc_botInlineMessageMediaContact: { const MTPDbotInlineMessageMediaContact &v(c_botInlineMessageMediaContact()); + v.vflags.write(to); v.vphone_number.write(to); v.vfirst_name.write(to); v.vlast_name.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; } } @@ -33146,21 +33685,25 @@ inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaVenue * } inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageMediaContact) { } -inline MTPbotInlineMessage MTP_botInlineMessageMediaAuto(const MTPstring &_caption) { - return MTP::internal::TypeCreator::new_botInlineMessageMediaAuto(_caption); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageMediaAuto::Flags) +inline MTPbotInlineMessage MTP_botInlineMessageMediaAuto(const MTPflags &_flags, const MTPstring &_caption, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_botInlineMessageMediaAuto(_flags, _caption, _reply_markup); } Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageText::Flags) -inline MTPbotInlineMessage MTP_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { - return MTP::internal::TypeCreator::new_botInlineMessageText(_flags, _message, _entities); +inline MTPbotInlineMessage MTP_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_botInlineMessageText(_flags, _message, _entities, _reply_markup); } -inline MTPbotInlineMessage MTP_botInlineMessageMediaGeo(const MTPGeoPoint &_geo) { - return MTP::internal::TypeCreator::new_botInlineMessageMediaGeo(_geo); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageMediaGeo::Flags) +inline MTPbotInlineMessage MTP_botInlineMessageMediaGeo(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_botInlineMessageMediaGeo(_flags, _geo, _reply_markup); } -inline MTPbotInlineMessage MTP_botInlineMessageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTP::internal::TypeCreator::new_botInlineMessageMediaVenue(_geo, _title, _address, _provider, _venue_id); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageMediaVenue::Flags) +inline MTPbotInlineMessage MTP_botInlineMessageMediaVenue(const MTPflags &_flags, const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_botInlineMessageMediaVenue(_flags, _geo, _title, _address, _provider, _venue_id, _reply_markup); } -inline MTPbotInlineMessage MTP_botInlineMessageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTP::internal::TypeCreator::new_botInlineMessageMediaContact(_phone_number, _first_name, _last_name); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageMediaContact::Flags) +inline MTPbotInlineMessage MTP_botInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_botInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup); } inline uint32 MTPbotInlineResult::innerLength() const { @@ -33556,6 +34099,37 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessages_messageEditData::Flags) inline MTPmessages_messageEditData MTP_messages_messageEditData(const MTPflags &_flags) { return MTP::internal::TypeCreator::new_messages_messageEditData(_flags); } + +inline MTPinputBotInlineMessageID::MTPinputBotInlineMessageID() : mtpDataOwner(new MTPDinputBotInlineMessageID()) { +} + +inline uint32 MTPinputBotInlineMessageID::innerLength() const { + const MTPDinputBotInlineMessageID &v(c_inputBotInlineMessageID()); + return v.vdc_id.innerLength() + v.vid.innerLength() + v.vaccess_hash.innerLength(); +} +inline mtpTypeId MTPinputBotInlineMessageID::type() const { + return mtpc_inputBotInlineMessageID; +} +inline void MTPinputBotInlineMessageID::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_inputBotInlineMessageID) throw mtpErrorUnexpected(cons, "MTPinputBotInlineMessageID"); + + if (!data) setData(new MTPDinputBotInlineMessageID()); + MTPDinputBotInlineMessageID &v(_inputBotInlineMessageID()); + v.vdc_id.read(from, end); + v.vid.read(from, end); + v.vaccess_hash.read(from, end); +} +inline void MTPinputBotInlineMessageID::write(mtpBuffer &to) const { + const MTPDinputBotInlineMessageID &v(c_inputBotInlineMessageID()); + v.vdc_id.write(to); + v.vid.write(to); + v.vaccess_hash.write(to); +} +inline MTPinputBotInlineMessageID::MTPinputBotInlineMessageID(MTPDinputBotInlineMessageID *_data) : mtpDataOwner(_data) { +} +inline MTPinputBotInlineMessageID MTP_inputBotInlineMessageID(MTPint _dc_id, const MTPlong &_id, const MTPlong &_access_hash) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageID(_dc_id, _id, _access_hash); +} inline MTPDmessage::Flags mtpCastFlags(MTPDmessageService::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } inline MTPDmessage::Flags mtpCastFlags(MTPflags flags) { return mtpCastFlags(flags.v); } inline MTPDmessage::Flags mtpCastFlags(MTPDupdateShortMessage::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); }