From f7dc832dfe1fde734449034363bd5974b28b0901 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 1 Apr 2016 20:37:23 +0400 Subject: [PATCH] Scheme updated. Current mtp layer is now edited inside scheme.tl file in a special comment line. --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/dropdown.cpp | 10 +- Telegram/SourceFiles/mtproto/connection.cpp | 4 +- Telegram/SourceFiles/mtproto/core_types.h | 1 - Telegram/SourceFiles/mtproto/generate.py | 44 +- Telegram/SourceFiles/mtproto/scheme.tl | 18 +- Telegram/SourceFiles/mtproto/scheme_auto.cpp | 191 +++++- Telegram/SourceFiles/mtproto/scheme_auto.h | 682 +++++++++++++++++-- Telegram/SourceFiles/structs.h | 3 + 9 files changed, 848 insertions(+), 106 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 14ad8aa7e0..4f353192b1 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -602,6 +602,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_reply_to" = "In reply to"; "lng_bot_share_location_unavailable" = "Sorry, the location sharing is currently unavailable in Telegram Desktop."; +"lng_bot_inline_geo_unavailable" = "Sorry, this bot requires location sharing.\nIt is not unavailable in Telegram Desktop."; "lng_bot_share_phone" = "Share Phone Number?"; "lng_bot_share_phone_confirm" = "Share"; diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index bc74c48bcc..1bef5c8a31 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3743,7 +3743,14 @@ void EmojiPan::queryInlineBot(UserData *bot, QString query) { inlineBotChanged(); _inlineBot = bot; force = true; + if (_inlineBot->isBotInlineGeo()) { + Ui::showLayer(new InformBox(lang(lng_bot_inline_geo_unavailable))); + } } + if (_inlineBot && _inlineBot->isBotInlineGeo()) { + return; + } + if (_inlineQuery != query || force) { if (_inlineRequestId) { MTP::cancel(_inlineRequestId); @@ -3772,7 +3779,8 @@ void EmojiPan::onInlineRequest() { if (nextOffset.isEmpty()) return; } Notify::inlineBotRequesting(true); - _inlineRequestId = MTP::send(MTPmessages_GetInlineBotResults(_inlineBot->inputUser, MTP_string(_inlineQuery), MTP_string(nextOffset)), rpcDone(&EmojiPan::inlineResultsDone), rpcFail(&EmojiPan::inlineResultsFail)); + MTPmessages_GetInlineBotResults::Flags flags = 0; + _inlineRequestId = MTP::send(MTPmessages_GetInlineBotResults(MTP_flags(flags), _inlineBot->inputUser, MTPInputGeoPoint(), MTP_string(_inlineQuery), MTP_string(nextOffset)), rpcDone(&EmojiPan::inlineResultsDone), rpcFail(&EmojiPan::inlineResultsFail)); } void EmojiPan::onEmptyInlineRows() { diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index 49cbd9f483..3a76e2a130 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -915,7 +915,7 @@ void ConnectionPrivate::tryToSend() { mtpRequest wrappedRequest(mtpRequestData::prepare(toSendSize)); memcpy(wrappedRequest->data(), toSendRequest->constData(), 7 * sizeof(mtpPrime)); // all except length wrappedRequest->push_back(mtpc_invokeWithLayer); - wrappedRequest->push_back(mtpCurrentLayer); + wrappedRequest->push_back(MTP::internal::CurrentLayer); initWrapper->write(*wrappedRequest); wrappedRequest->resize(wrappedRequest->size() + noWrapSize); memcpy(wrappedRequest->data() + wrappedRequest->size() - noWrapSize, toSendRequest->constData() + 8, noWrapSize * sizeof(mtpPrime)); @@ -947,7 +947,7 @@ void ConnectionPrivate::tryToSend() { if (willNeedInit) { initSerialized.reserve(initSizeInInts); initSerialized.push_back(mtpc_invokeWithLayer); - initSerialized.push_back(mtpCurrentLayer); + initSerialized.push_back(MTP::internal::CurrentLayer); initWrapper->write(initSerialized); } toSendRequest = mtpRequestData::prepare(containerSize, containerSize + 3 * toSend.size()); // prepare container + each in invoke after diff --git a/Telegram/SourceFiles/mtproto/core_types.h b/Telegram/SourceFiles/mtproto/core_types.h index 8717281961..808b1ab7c1 100644 --- a/Telegram/SourceFiles/mtproto/core_types.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -349,7 +349,6 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 51; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index f88a042284..85b571407d 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -43,6 +43,7 @@ addChildParentFlags('MTPDpeerNotifySettings', 'MTPDinputPeerNotifySettings'); # each key flag of parentFlags should be a subset of the value flag here parentFlagsCheck = {}; +layer = ''; funcs = 0 types = 0; consts = 0 @@ -89,6 +90,9 @@ out.write('*/\n'); out.write('#pragma once\n\n#include "mtproto/core_types.h"\n'); with open('scheme.tl') as f: for line in f: + layerline = re.match(r'// LAYER (\d+)', line) + if (layerline): + layer = 'static constexpr mtpPrime CurrentLayer = ' + layerline.group(1) + ';'; nocomment = re.match(r'^(.*?)//', line) if (nocomment): line = nocomment.group(1); @@ -221,7 +225,7 @@ with open('scheme.tl') as f: prmsStr = []; prmsInit = []; prmsNames = []; - if (len(conditions)): + if (hasFlags != ''): funcsText += '\tenum class Flag : int32 {\n'; maxbit = 0; parentFlagsCheck['MTP' + name] = {}; @@ -230,17 +234,19 @@ with open('scheme.tl') as f: parentFlagsCheck['MTP' + name][paramName] = conditions[paramName]; maxbit = max(maxbit, int(conditions[paramName])); if (maxbit > 0): - funcsText += '\n\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; + funcsText += '\n'; + funcsText += '\n\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; funcsText += '\t};\n'; funcsText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n'; funcsText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); }\n'; funcsText += '\n'; - for paramName in conditionsList: - if (paramName in trivialConditions): - funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; - else: - funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; - funcsText += '\n'; + if (len(conditions)): + for paramName in conditionsList: + if (paramName in trivialConditions): + funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + else: + funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + funcsText += '\n'; if (len(prms) > len(trivialConditions)): for paramName in prmsList: @@ -497,7 +503,7 @@ for restype in typesList: readText = ''; writeText = ''; - if (len(conditions)): + if (hasFlags != ''): dataText += '\tenum class Flag : int32 {\n'; maxbit = 0; parentFlagsCheck['MTPD' + name] = {}; @@ -506,17 +512,19 @@ for restype in typesList: parentFlagsCheck['MTPD' + name][paramName] = conditions[paramName]; maxbit = max(maxbit, int(conditions[paramName])); if (maxbit > 0): - dataText += '\n\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; + dataText += '\n'; + dataText += '\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; dataText += '\t};\n'; dataText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n'; dataText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); }\n'; dataText += '\n'; - for paramName in conditionsList: - if (paramName in trivialConditions): - dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; - else: - dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; - dataText += '\n'; + if (len(conditions)): + for paramName in conditionsList: + if (paramName in trivialConditions): + dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + else: + dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + dataText += '\n'; dataText += '\tMTPD' + name + '() {\n\t}\n'; # default constructor switchLines += '\t\tcase mtpc_' + name + ': '; # for by-type-id type constructor @@ -854,7 +862,9 @@ textSerializeFull += '\t\t}\n'; textSerializeFull += '\t}\n'; textSerializeFull += '}\n'; -out.write('\n// Creator proxy class declaration\nnamespace MTP {\nnamespace internal {\n\nclass TypeCreator;\n\n} // namespace internal\n} // namespace MTP\n'); +out.write('\n// Creator current layer and proxy class declaration\n'); +out.write('namespace MTP {\nnamespace internal {\n\n' + layer + '\n\n'); +out.write('class TypeCreator;\n\n} // namespace internal\n} // namespace MTP\n'); out.write('\n// Type id constants\nenum {\n' + ',\n'.join(enums) + '\n};\n'); out.write('\n// Type forward declarations\n' + forwards); out.write('\n// Boxed types definitions\n' + forwTypedefs); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 669ccc65e2..cd3ffacb47 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -194,7 +194,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation; userEmpty#200250ba id:int = User; -user#d10d979a flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string = User; +user#d10d979a flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto; @@ -383,8 +383,8 @@ updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update; updateStickerSetsOrder#f0dfb451 order:Vector = Update; updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; -updateBotInlineQuery#c01eea08 query_id:long user_id:int query:string offset:string = Update; -updateBotInlineSend#f69e113 user_id:int query:string id:string = 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; 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; @@ -634,11 +634,19 @@ 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; 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#243edc26 flags:# id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult; +inputBotInlineResultDocument#11af9bcc flags:# id:string type:string title:flags.1?string description:flags.2?string document:flags.5?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; botInlineMediaResultDocument#f897d33e id:string type:string document:Document send_message:BotInlineMessage = BotInlineResult; botInlineMediaResultPhoto#c5528587 id:string type:string photo:Photo send_message:BotInlineMessage = BotInlineResult; @@ -784,7 +792,7 @@ messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Doc messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs; messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; -messages.getInlineBotResults#9324600d bot:InputUser query:string offset:string = messages.BotResults; +messages.getInlineBotResults#94e7b170 flags:# bot:InputUser geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults; messages.setInlineBotResults#3f23ec12 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string = Bool; messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; @@ -843,3 +851,5 @@ channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates; channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink; channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates; + +// LAYER 52 diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp index e9de2f07ba..048e2e8c8e 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -1011,17 +1011,18 @@ void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, case 8: to.add(" verified: "); ++stages.back(); if (flag & MTPDuser::Flag::f_verified) { to.add("YES [ BY BIT 17 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 17 IN FIELD flags ]"); } break; case 9: to.add(" restricted: "); ++stages.back(); if (flag & MTPDuser::Flag::f_restricted) { to.add("YES [ BY BIT 18 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; case 10: to.add(" min: "); ++stages.back(); if (flag & MTPDuser::Flag::f_min) { to.add("YES [ BY BIT 20 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 20 IN FIELD flags ]"); } break; - case 11: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::Flag::f_access_hash) { types.push_back(mtpc_long+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 13: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_first_name) { 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 14: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_last_name) { 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 15: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::Flag::f_username) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 16: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::Flag::f_phone) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 17: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::Flag::f_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 18: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::Flag::f_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 19: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_info_version) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 20: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDuser::Flag::f_restriction_reason) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; - case 21: to.add(" bot_inline_placeholder: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_inline_placeholder) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 19 IN FIELD flags ]"); } break; + case 11: to.add(" bot_inline_geo: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_inline_geo) { to.add("YES [ BY BIT 21 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 21 IN FIELD flags ]"); } break; + case 12: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::Flag::f_access_hash) { types.push_back(mtpc_long+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 14: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_first_name) { 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 15: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_last_name) { 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 16: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::Flag::f_username) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 17: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::Flag::f_phone) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 18: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::Flag::f_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 19: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::Flag::f_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 20: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_info_version) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 21: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDuser::Flag::f_restriction_reason) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; + case 22: to.add(" bot_inline_placeholder: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_inline_placeholder) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 19 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2887,6 +2888,8 @@ void _serialize_updateSavedGifs(MTPStringLogger &to, int32 stage, int32 lev, Typ } void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateBotInlineQuery::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2894,15 +2897,19 @@ void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: 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 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(" offset: "); ++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(" 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(" query: "); ++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(" geo: "); ++stages.back(); if (flag & MTPDupdateBotInlineQuery::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 5: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string+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_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateBotInlineSend::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2910,9 +2917,11 @@ void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: 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 2: 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 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(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5124,6 +5133,51 @@ void _serialize_inputBotInlineMessageText(MTPStringLogger &to, int32 stage, int3 } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineMessageMediaGeo"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineMessageMediaVenue"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputBotInlineMessageMediaContact"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_inputBotInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { MTPDinputBotInlineResult::Flags flag(iflag); @@ -5151,6 +5205,44 @@ 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(" 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(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: 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(); if (flag & MTPDinputBotInlineResultDocument::Flag::f_document) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5182,6 +5274,51 @@ void _serialize_botInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ botInlineMessageMediaGeo"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ botInlineMessageMediaVenue"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ botInlineMessageMediaContact"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_botInlineMediaResultDocument(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); @@ -7581,6 +7718,8 @@ void _serialize_messages_getSavedGifs(MTPStringLogger &to, int32 stage, int32 le } void _serialize_messages_getInlineBotResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_getInlineBotResults::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7588,9 +7727,11 @@ void _serialize_messages_getInlineBotResults(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" bot: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: 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 2: to.add(" offset: "); ++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(" bot: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" geo_point: "); ++stages.back(); if (flag & MTPmessages_getInlineBotResults::Flag::f_geo_point) { 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 3: 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 4: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string+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; } } @@ -8292,9 +8433,17 @@ namespace { _serializers.insert(mtpc_messages_savedGifs, _serialize_messages_savedGifs); _serializers.insert(mtpc_inputBotInlineMessageMediaAuto, _serialize_inputBotInlineMessageMediaAuto); _serializers.insert(mtpc_inputBotInlineMessageText, _serialize_inputBotInlineMessageText); + _serializers.insert(mtpc_inputBotInlineMessageMediaGeo, _serialize_inputBotInlineMessageMediaGeo); + _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); + _serializers.insert(mtpc_botInlineMessageMediaVenue, _serialize_botInlineMessageMediaVenue); + _serializers.insert(mtpc_botInlineMessageMediaContact, _serialize_botInlineMessageMediaContact); _serializers.insert(mtpc_botInlineMediaResultDocument, _serialize_botInlineMediaResultDocument); _serializers.insert(mtpc_botInlineMediaResultPhoto, _serialize_botInlineMediaResultPhoto); _serializers.insert(mtpc_botInlineResult, _serialize_botInlineResult); diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.h b/Telegram/SourceFiles/mtproto/scheme_auto.h index 2f12fb2a2b..81dc6dd9bc 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -26,10 +26,12 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "mtproto/core_types.h" -// Creator proxy class declaration +// Creator current layer and proxy class declaration namespace MTP { namespace internal { +static constexpr mtpPrime CurrentLayer = 52; + class TypeCreator; } // namespace internal @@ -277,8 +279,8 @@ enum { mtpc_updateStickerSetsOrder = 0xf0dfb451, mtpc_updateStickerSets = 0x43ae3dec, mtpc_updateSavedGifs = 0x9375341e, - mtpc_updateBotInlineQuery = 0xc01eea08, - mtpc_updateBotInlineSend = 0xf69e113, + mtpc_updateBotInlineQuery = 0x54826690, + mtpc_updateBotInlineSend = 0xdaa0c53d, mtpc_updateEditChannelMessage = 0x1b3f4df7, mtpc_updateChannelPinnedMessage = 0x98592475, mtpc_updateBotCallbackQuery = 0xa68c688c, @@ -455,9 +457,17 @@ enum { mtpc_messages_savedGifs = 0x2e0709a5, mtpc_inputBotInlineMessageMediaAuto = 0x2e43e587, mtpc_inputBotInlineMessageText = 0xadf0df71, + mtpc_inputBotInlineMessageMediaGeo = 0x197dce7e, + mtpc_inputBotInlineMessageMediaVenue = 0x8ab91f84, + mtpc_inputBotInlineMessageMediaContact = 0x52971c52, mtpc_inputBotInlineResult = 0x2cbbe15a, + mtpc_inputBotInlineResultPhoto = 0x243edc26, + mtpc_inputBotInlineResultDocument = 0x11af9bcc, mtpc_botInlineMessageMediaAuto = 0xfc56e87d, mtpc_botInlineMessageText = 0xa56197a9, + mtpc_botInlineMessageMediaGeo = 0x59d1ff36, + mtpc_botInlineMessageMediaVenue = 0x6fa16678, + mtpc_botInlineMessageMediaContact = 0x89202361, mtpc_botInlineMediaResultDocument = 0xf897d33e, mtpc_botInlineMediaResultPhoto = 0xc5528587, mtpc_botInlineResult = 0x9bebaeb9, @@ -587,7 +597,7 @@ enum { mtpc_messages_searchGifs = 0xbf9a776b, mtpc_messages_getSavedGifs = 0x83bf3d52, mtpc_messages_saveGif = 0x327a30cb, - mtpc_messages_getInlineBotResults = 0x9324600d, + mtpc_messages_getInlineBotResults = 0x94e7b170, mtpc_messages_setInlineBotResults = 0x3f23ec12, mtpc_messages_sendInlineBotResult = 0xb16e06fe, mtpc_messages_getMessageEditData = 0xfda68d36, @@ -1254,13 +1264,21 @@ class MTPDmessages_savedGifs; class MTPinputBotInlineMessage; class MTPDinputBotInlineMessageMediaAuto; class MTPDinputBotInlineMessageText; +class MTPDinputBotInlineMessageMediaGeo; +class MTPDinputBotInlineMessageMediaVenue; +class MTPDinputBotInlineMessageMediaContact; class MTPinputBotInlineResult; class MTPDinputBotInlineResult; +class MTPDinputBotInlineResultPhoto; +class MTPDinputBotInlineResultDocument; class MTPbotInlineMessage; class MTPDbotInlineMessageMediaAuto; class MTPDbotInlineMessageText; +class MTPDbotInlineMessageMediaGeo; +class MTPDbotInlineMessageMediaVenue; +class MTPDbotInlineMessageMediaContact; class MTPbotInlineResult; class MTPDbotInlineMediaResultDocument; @@ -8667,6 +8685,42 @@ public: return *(const MTPDinputBotInlineMessageText*)data; } + MTPDinputBotInlineMessageMediaGeo &_inputBotInlineMessageMediaGeo() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaGeo) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaGeo); + split(); + return *(MTPDinputBotInlineMessageMediaGeo*)data; + } + const MTPDinputBotInlineMessageMediaGeo &c_inputBotInlineMessageMediaGeo() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaGeo) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaGeo); + return *(const MTPDinputBotInlineMessageMediaGeo*)data; + } + + MTPDinputBotInlineMessageMediaVenue &_inputBotInlineMessageMediaVenue() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaVenue) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaVenue); + split(); + return *(MTPDinputBotInlineMessageMediaVenue*)data; + } + const MTPDinputBotInlineMessageMediaVenue &c_inputBotInlineMessageMediaVenue() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaVenue) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaVenue); + return *(const MTPDinputBotInlineMessageMediaVenue*)data; + } + + MTPDinputBotInlineMessageMediaContact &_inputBotInlineMessageMediaContact() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaContact) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaContact); + split(); + return *(MTPDinputBotInlineMessageMediaContact*)data; + } + const MTPDinputBotInlineMessageMediaContact &c_inputBotInlineMessageMediaContact() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputBotInlineMessageMediaContact) throw mtpErrorWrongTypeId(_type, mtpc_inputBotInlineMessageMediaContact); + return *(const MTPDinputBotInlineMessageMediaContact*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -8678,6 +8732,9 @@ private: explicit MTPinputBotInlineMessage(mtpTypeId type); explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaAuto *_data); explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageText *_data); + explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaGeo *_data); + explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaVenue *_data); + explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaContact *_data); friend class MTP::internal::TypeCreator; @@ -8687,32 +8744,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; @@ -8748,6 +8837,42 @@ public: return *(const MTPDbotInlineMessageText*)data; } + MTPDbotInlineMessageMediaGeo &_botInlineMessageMediaGeo() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaGeo) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaGeo); + split(); + return *(MTPDbotInlineMessageMediaGeo*)data; + } + const MTPDbotInlineMessageMediaGeo &c_botInlineMessageMediaGeo() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaGeo) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaGeo); + return *(const MTPDbotInlineMessageMediaGeo*)data; + } + + MTPDbotInlineMessageMediaVenue &_botInlineMessageMediaVenue() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaVenue) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaVenue); + split(); + return *(MTPDbotInlineMessageMediaVenue*)data; + } + const MTPDbotInlineMessageMediaVenue &c_botInlineMessageMediaVenue() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaVenue) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaVenue); + return *(const MTPDbotInlineMessageMediaVenue*)data; + } + + MTPDbotInlineMessageMediaContact &_botInlineMessageMediaContact() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaContact) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaContact); + split(); + return *(MTPDbotInlineMessageMediaContact*)data; + } + const MTPDbotInlineMessageMediaContact &c_botInlineMessageMediaContact() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_botInlineMessageMediaContact) throw mtpErrorWrongTypeId(_type, mtpc_botInlineMessageMediaContact); + return *(const MTPDbotInlineMessageMediaContact*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -8759,6 +8884,9 @@ private: explicit MTPbotInlineMessage(mtpTypeId type); explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaAuto *_data); explicit MTPbotInlineMessage(MTPDbotInlineMessageText *_data); + explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaGeo *_data); + explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaVenue *_data); + explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaContact *_data); friend class MTP::internal::TypeCreator; @@ -9786,6 +9914,7 @@ public: f_verified = (1 << 17), f_restricted = (1 << 18), f_min = (1 << 20), + f_bot_inline_geo = (1 << 21), f_access_hash = (1 << 0), f_first_name = (1 << 1), f_last_name = (1 << 2), @@ -9797,7 +9926,7 @@ public: f_restriction_reason = (1 << 18), f_bot_inline_placeholder = (1 << 19), - MAX_FIELD = (1 << 20), + MAX_FIELD = (1 << 21), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -9812,6 +9941,7 @@ public: bool is_verified() const { return vflags.v & Flag::f_verified; } bool is_restricted() const { return vflags.v & Flag::f_restricted; } bool is_min() const { return vflags.v & Flag::f_min; } + bool is_bot_inline_geo() const { return vflags.v & Flag::f_bot_inline_geo; } bool has_access_hash() const { return vflags.v & Flag::f_access_hash; } bool has_first_name() const { return vflags.v & Flag::f_first_name; } bool has_last_name() const { return vflags.v & Flag::f_last_name; } @@ -10104,6 +10234,7 @@ class MTPDchatParticipantsForbidden : public mtpDataImpl(v)); } @@ -10639,6 +10770,7 @@ class MTPDpeerSettings : public mtpDataImpl { public: enum class Flag : int32 { f_report_spam = (1 << 0), + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -10879,6 +11011,7 @@ class MTPDmessages_channelMessages : public mtpDataImpl(v)); } @@ -11265,6 +11398,7 @@ class MTPDupdateChannelTooLong : public mtpDataImpl { public: enum class Flag : int32 { f_pts = (1 << 0), + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -11397,26 +11531,48 @@ public: class MTPDupdateBotInlineQuery : public mtpDataImpl { public: + enum class Flag : int32 { + f_geo = (1 << 0), + MAX_FIELD = (1 << 0), + }; + 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; } + MTPDupdateBotInlineQuery() { } - MTPDupdateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset) : vquery_id(_query_id), vuser_id(_user_id), vquery(_query), voffset(_offset) { + MTPDupdateBotInlineQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_offset) : vflags(_flags), vquery_id(_query_id), vuser_id(_user_id), vquery(_query), vgeo(_geo), voffset(_offset) { } + MTPflags vflags; MTPlong vquery_id; MTPint vuser_id; MTPstring vquery; + MTPGeoPoint vgeo; MTPstring voffset; }; class MTPDupdateBotInlineSend : public mtpDataImpl { public: + enum class Flag : int32 { + f_geo = (1 << 0), + MAX_FIELD = (1 << 0), + }; + 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; } + MTPDupdateBotInlineSend() { } - MTPDupdateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) : vuser_id(_user_id), vquery(_query), vid(_id) { + 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) { } + MTPflags vflags; MTPint vuser_id; MTPstring vquery; + MTPGeoPoint vgeo; MTPstring vid; }; @@ -13256,6 +13412,42 @@ public: MTPVector ventities; }; +class MTPDinputBotInlineMessageMediaGeo : public mtpDataImpl { +public: + MTPDinputBotInlineMessageMediaGeo() { + } + MTPDinputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) : vgeo_point(_geo_point) { + } + + MTPInputGeoPoint vgeo_point; +}; + +class MTPDinputBotInlineMessageMediaVenue : public mtpDataImpl { +public: + 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) { + } + + MTPInputGeoPoint vgeo_point; + MTPstring vtitle; + MTPstring vaddress; + MTPstring vprovider; + MTPstring vvenue_id; +}; + +class MTPDinputBotInlineMessageMediaContact : public mtpDataImpl { +public: + 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) { + } + + MTPstring vphone_number; + MTPstring vfirst_name; + MTPstring vlast_name; +}; + class MTPDinputBotInlineResult : public mtpDataImpl { public: enum class Flag : int32 { @@ -13304,6 +13496,56 @@ public: MTPInputBotInlineMessage vsend_message; }; +class MTPDinputBotInlineResultPhoto : public mtpDataImpl { +public: + enum class Flag : int32 { + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + MTPDinputBotInlineResultPhoto() { + } + MTPDinputBotInlineResultPhoto(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vphoto(_photo), vsend_message(_send_message) { + } + + MTPflags vflags; + 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), + f_document = (1 << 5), + + MAX_FIELD = (1 << 5), + }; + 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; } + bool has_document() const { return vflags.v & Flag::f_document; } + + 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: MTPDbotInlineMessageMediaAuto() { @@ -13338,6 +13580,42 @@ public: MTPVector ventities; }; +class MTPDbotInlineMessageMediaGeo : public mtpDataImpl { +public: + MTPDbotInlineMessageMediaGeo() { + } + MTPDbotInlineMessageMediaGeo(const MTPGeoPoint &_geo) : vgeo(_geo) { + } + + MTPGeoPoint vgeo; +}; + +class MTPDbotInlineMessageMediaVenue : public mtpDataImpl { +public: + 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) { + } + + MTPGeoPoint vgeo; + MTPstring vtitle; + MTPstring vaddress; + MTPstring vprovider; + MTPstring vvenue_id; +}; + +class MTPDbotInlineMessageMediaContact : public mtpDataImpl { +public: + 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) { + } + + MTPstring vphone_number; + MTPstring vfirst_name; + MTPstring vlast_name; +}; + class MTPDbotInlineMediaResultDocument : public mtpDataImpl { public: MTPDbotInlineMediaResultDocument() { @@ -13542,6 +13820,7 @@ class MTPDmessages_messageEditData : public mtpDataImpl(v)); } @@ -14208,6 +14487,8 @@ public: enum class Flag : int32 { f_allow_flashcall = (1 << 0), f_current_number = (1 << 0), + + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -15057,6 +15338,7 @@ public: f_last_name = (1 << 1), f_about = (1 << 2), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -15499,6 +15781,8 @@ public: enum class Flag : int32 { f_allow_flashcall = (1 << 0), f_current_number = (1 << 0), + + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -16504,6 +16788,8 @@ class MTPmessages_search { // RPC method 'messages.search' public: enum class Flag : int32 { f_important_only = (1 << 0), + + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -16788,6 +17074,7 @@ public: f_reply_markup = (1 << 2), f_entities = (1 << 3), + MAX_FIELD = (1 << 6), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -16867,6 +17154,7 @@ public: f_reply_to_msg_id = (1 << 0), f_reply_markup = (1 << 2), + MAX_FIELD = (1 << 6), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -16939,6 +17227,7 @@ public: f_silent = (1 << 5), f_background = (1 << 6), + MAX_FIELD = (1 << 6), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -18807,7 +19096,19 @@ public: class MTPmessages_getInlineBotResults { // RPC method 'messages.getInlineBotResults' public: + enum class Flag : int32 { + f_geo_point = (1 << 0), + + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_geo_point() const { return vflags.v & Flag::f_geo_point; } + + MTPflags vflags; MTPInputUser vbot; + MTPInputGeoPoint vgeo_point; MTPstring vquery; MTPstring voffset; @@ -18816,28 +19117,34 @@ public: MTPmessages_getInlineBotResults(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getInlineBotResults) { read(from, end, cons); } - MTPmessages_getInlineBotResults(const MTPInputUser &_bot, const MTPstring &_query, const MTPstring &_offset) : vbot(_bot), vquery(_query), voffset(_offset) { + MTPmessages_getInlineBotResults(const MTPflags &_flags, const MTPInputUser &_bot, const MTPInputGeoPoint &_geo_point, const MTPstring &_query, const MTPstring &_offset) : vflags(_flags), vbot(_bot), vgeo_point(_geo_point), vquery(_query), voffset(_offset) { } uint32 innerLength() const { - return vbot.innerLength() + vquery.innerLength() + voffset.innerLength(); + return vflags.innerLength() + vbot.innerLength() + (has_geo_point() ? vgeo_point.innerLength() : 0) + vquery.innerLength() + voffset.innerLength(); } mtpTypeId type() const { return mtpc_messages_getInlineBotResults; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getInlineBotResults) { + vflags.read(from, end); vbot.read(from, end); + if (has_geo_point()) { vgeo_point.read(from, end); } else { vgeo_point = MTPInputGeoPoint(); } vquery.read(from, end); voffset.read(from, end); } void write(mtpBuffer &to) const { + vflags.write(to); vbot.write(to); + if (has_geo_point()) vgeo_point.write(to); vquery.write(to); voffset.write(to); } typedef MTPmessages_BotResults ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_getInlineBotResults::Flags) + class MTPmessages_GetInlineBotResults : public MTPBoxed { public: MTPmessages_GetInlineBotResults() { @@ -18846,7 +19153,7 @@ public: } MTPmessages_GetInlineBotResults(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_GetInlineBotResults(const MTPInputUser &_bot, const MTPstring &_query, const MTPstring &_offset) : MTPBoxed(MTPmessages_getInlineBotResults(_bot, _query, _offset)) { + MTPmessages_GetInlineBotResults(const MTPflags &_flags, const MTPInputUser &_bot, const MTPInputGeoPoint &_geo_point, const MTPstring &_query, const MTPstring &_offset) : MTPBoxed(MTPmessages_getInlineBotResults(_flags, _bot, _geo_point, _query, _offset)) { } }; @@ -18857,6 +19164,7 @@ public: f_private = (1 << 1), f_next_offset = (1 << 2), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -18925,6 +19233,7 @@ public: f_background = (1 << 6), f_reply_to_msg_id = (1 << 0), + MAX_FIELD = (1 << 6), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -19038,6 +19347,7 @@ public: f_entities = (1 << 3), f_reply_markup = (1 << 2), + MAX_FIELD = (1 << 3), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -19152,6 +19462,7 @@ public: f_alert = (1 << 1), f_message = (1 << 0), + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -20436,6 +20747,7 @@ public: f_broadcast = (1 << 0), f_megagroup = (1 << 1), + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); @@ -21159,6 +21471,8 @@ class MTPchannels_updatePinnedMessage { // RPC method 'channels.updatePinnedMess public: enum class Flag : int32 { f_silent = (1 << 0), + + MAX_FIELD = (1 << 0), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -21909,11 +22223,11 @@ public: inline static MTPupdate new_updateSavedGifs() { return MTPupdate(mtpc_updateSavedGifs); } - inline static MTPupdate new_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset) { - return MTPupdate(new MTPDupdateBotInlineQuery(_query_id, _user_id, _query, _offset)); + 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(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { - return MTPupdate(new MTPDupdateBotInlineSend(_user_id, _query, _id)); + 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_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); @@ -22443,15 +22757,39 @@ public: 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_inputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaGeo(_geo_point)); + } + 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_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 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 MTPinputBotInlineResult new_inputBotInlineResultPhoto(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) { + return MTPinputBotInlineResult(new MTPDinputBotInlineResultPhoto(_flags, _id, _type, _photo, _send_message)); + } + 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_botInlineMessageMediaAuto(const MTPstring &_caption) { return MTPbotInlineMessage(new MTPDbotInlineMessageMediaAuto(_caption)); } inline static MTPbotInlineMessage new_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { return MTPbotInlineMessage(new MTPDbotInlineMessageText(_flags, _message, _entities)); } + inline static MTPbotInlineMessage new_botInlineMessageMediaGeo(const MTPGeoPoint &_geo) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaGeo(_geo)); + } + 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_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 MTPbotInlineResult new_botInlineMediaResultDocument(const MTPstring &_id, const MTPstring &_type, const MTPDocument &_document, const MTPBotInlineMessage &_send_message) { return MTPbotInlineResult(new MTPDbotInlineMediaResultDocument(_id, _type, _document, _send_message)); } @@ -27381,11 +27719,11 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateBotInlineQuery: { const MTPDupdateBotInlineQuery &v(c_updateBotInlineQuery()); - return v.vquery_id.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + v.voffset.innerLength(); + return v.vflags.innerLength() + v.vquery_id.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + (v.has_geo() ? v.vgeo.innerLength() : 0) + v.voffset.innerLength(); } case mtpc_updateBotInlineSend: { const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); - return v.vuser_id.innerLength() + v.vquery.innerLength() + v.vid.innerLength(); + return v.vflags.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + (v.has_geo() ? v.vgeo.innerLength() : 0) + v.vid.innerLength(); } case mtpc_updateEditChannelMessage: { const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); @@ -27677,16 +28015,20 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI case mtpc_updateBotInlineQuery: _type = cons; { if (!data) setData(new MTPDupdateBotInlineQuery()); MTPDupdateBotInlineQuery &v(_updateBotInlineQuery()); + v.vflags.read(from, end); v.vquery_id.read(from, end); v.vuser_id.read(from, end); v.vquery.read(from, end); + if (v.has_geo()) { v.vgeo.read(from, end); } else { v.vgeo = MTPGeoPoint(); } v.voffset.read(from, end); } break; case mtpc_updateBotInlineSend: _type = cons; { if (!data) setData(new MTPDupdateBotInlineSend()); MTPDupdateBotInlineSend &v(_updateBotInlineSend()); + v.vflags.read(from, end); v.vuser_id.read(from, end); v.vquery.read(from, end); + if (v.has_geo()) { v.vgeo.read(from, end); } else { v.vgeo = MTPGeoPoint(); } v.vid.read(from, end); } break; case mtpc_updateEditChannelMessage: _type = cons; { @@ -27945,15 +28287,19 @@ inline void MTPupdate::write(mtpBuffer &to) const { } break; case mtpc_updateBotInlineQuery: { const MTPDupdateBotInlineQuery &v(c_updateBotInlineQuery()); + v.vflags.write(to); v.vquery_id.write(to); v.vuser_id.write(to); v.vquery.write(to); + if (v.has_geo()) v.vgeo.write(to); v.voffset.write(to); } break; case mtpc_updateBotInlineSend: { const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); + v.vflags.write(to); v.vuser_id.write(to); v.vquery.write(to); + if (v.has_geo()) v.vgeo.write(to); v.vid.write(to); } break; case mtpc_updateEditChannelMessage: { @@ -28249,11 +28595,13 @@ inline MTPupdate MTP_updateStickerSets() { inline MTPupdate MTP_updateSavedGifs() { return MTP::internal::TypeCreator::new_updateSavedGifs(); } -inline MTPupdate MTP_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset) { - return MTP::internal::TypeCreator::new_updateBotInlineQuery(_query_id, _user_id, _query, _offset); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateBotInlineQuery::Flags) +inline MTPupdate MTP_updateBotInlineQuery(const MTPflags &_flags, const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPGeoPoint &_geo, const MTPstring &_offset) { + return MTP::internal::TypeCreator::new_updateBotInlineQuery(_flags, _query_id, _user_id, _query, _geo, _offset); } -inline MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { - return MTP::internal::TypeCreator::new_updateBotInlineSend(_user_id, _query, _id); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateBotInlineSend::Flags) +inline MTPupdate MTP_updateBotInlineSend(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_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateEditChannelMessage(_message, _pts, _pts_count); @@ -32602,6 +32950,18 @@ inline uint32 MTPinputBotInlineMessage::innerLength() const { const MTPDinputBotInlineMessageText &v(c_inputBotInlineMessageText()); return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0); } + case mtpc_inputBotInlineMessageMediaGeo: { + const MTPDinputBotInlineMessageMediaGeo &v(c_inputBotInlineMessageMediaGeo()); + return v.vgeo_point.innerLength(); + } + 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(); + } + case mtpc_inputBotInlineMessageMediaContact: { + const MTPDinputBotInlineMessageMediaContact &v(c_inputBotInlineMessageMediaContact()); + return v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength(); + } } return 0; } @@ -32624,6 +32984,27 @@ inline void MTPinputBotInlineMessage::read(const mtpPrime *&from, const mtpPrime v.vmessage.read(from, end); if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } } break; + case mtpc_inputBotInlineMessageMediaGeo: _type = cons; { + if (!data) setData(new MTPDinputBotInlineMessageMediaGeo()); + MTPDinputBotInlineMessageMediaGeo &v(_inputBotInlineMessageMediaGeo()); + v.vgeo_point.read(from, end); + } break; + case mtpc_inputBotInlineMessageMediaVenue: _type = cons; { + if (!data) setData(new MTPDinputBotInlineMessageMediaVenue()); + MTPDinputBotInlineMessageMediaVenue &v(_inputBotInlineMessageMediaVenue()); + 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); + } break; + case mtpc_inputBotInlineMessageMediaContact: _type = cons; { + if (!data) setData(new MTPDinputBotInlineMessageMediaContact()); + MTPDinputBotInlineMessageMediaContact &v(_inputBotInlineMessageMediaContact()); + v.vphone_number.read(from, end); + v.vfirst_name.read(from, end); + v.vlast_name.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPinputBotInlineMessage"); } } @@ -32639,12 +33020,33 @@ inline void MTPinputBotInlineMessage::write(mtpBuffer &to) const { v.vmessage.write(to); if (v.has_entities()) v.ventities.write(to); } break; + case mtpc_inputBotInlineMessageMediaGeo: { + const MTPDinputBotInlineMessageMediaGeo &v(c_inputBotInlineMessageMediaGeo()); + v.vgeo_point.write(to); + } break; + case mtpc_inputBotInlineMessageMediaVenue: { + const MTPDinputBotInlineMessageMediaVenue &v(c_inputBotInlineMessageMediaVenue()); + v.vgeo_point.write(to); + v.vtitle.write(to); + v.vaddress.write(to); + v.vprovider.write(to); + v.vvenue_id.write(to); + } break; + case mtpc_inputBotInlineMessageMediaContact: { + const MTPDinputBotInlineMessageMediaContact &v(c_inputBotInlineMessageMediaContact()); + v.vphone_number.write(to); + v.vfirst_name.write(to); + v.vlast_name.write(to); + } break; } } inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(mtpTypeId type) : mtpDataOwner(0), _type(type) { switch (type) { case mtpc_inputBotInlineMessageMediaAuto: setData(new MTPDinputBotInlineMessageMediaAuto()); break; case mtpc_inputBotInlineMessageText: setData(new MTPDinputBotInlineMessageText()); break; + case mtpc_inputBotInlineMessageMediaGeo: setData(new MTPDinputBotInlineMessageMediaGeo()); break; + case mtpc_inputBotInlineMessageMediaVenue: setData(new MTPDinputBotInlineMessageMediaVenue()); break; + case mtpc_inputBotInlineMessageMediaContact: setData(new MTPDinputBotInlineMessageMediaContact()); break; default: throw mtpErrorBadTypeId(type, "MTPinputBotInlineMessage"); } } @@ -32652,6 +33054,12 @@ inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMess } inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageText *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageText) { } +inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaGeo *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageMediaGeo) { +} +inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaVenue *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageMediaVenue) { +} +inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageMediaContact) { +} inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaAuto(const MTPstring &_caption) { return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaAuto(_caption); } @@ -32659,58 +33067,143 @@ 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 MTPinputBotInlineResult::MTPinputBotInlineResult() : mtpDataOwner(new MTPDinputBotInlineResult()) { +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaGeo(const MTPInputGeoPoint &_geo_point) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaGeo(_geo_point); +} +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); +} +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 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.vflags.innerLength() + 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.has_document() ? v.vdocument.innerLength() : 0) + 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.vflags.read(from, end); + 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(); } + if (v.has_document()) { v.vdocument.read(from, end); } else { v.vdocument = MTPInputDocument(); } + 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.vflags.write(to); + 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); + if (v.has_document()) 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 MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPInputPhoto &_photo, const MTPInputBotInlineMessage &_send_message) { + return MTP::internal::TypeCreator::new_inputBotInlineResultPhoto(_flags, _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) { @@ -32722,6 +33215,18 @@ inline uint32 MTPbotInlineMessage::innerLength() const { const MTPDbotInlineMessageText &v(c_botInlineMessageText()); return v.vflags.innerLength() + v.vmessage.innerLength() + (v.has_entities() ? v.ventities.innerLength() : 0); } + case mtpc_botInlineMessageMediaGeo: { + const MTPDbotInlineMessageMediaGeo &v(c_botInlineMessageMediaGeo()); + return v.vgeo.innerLength(); + } + 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(); + } + case mtpc_botInlineMessageMediaContact: { + const MTPDbotInlineMessageMediaContact &v(c_botInlineMessageMediaContact()); + return v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength(); + } } return 0; } @@ -32744,6 +33249,27 @@ inline void MTPbotInlineMessage::read(const mtpPrime *&from, const mtpPrime *end v.vmessage.read(from, end); if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } } break; + case mtpc_botInlineMessageMediaGeo: _type = cons; { + if (!data) setData(new MTPDbotInlineMessageMediaGeo()); + MTPDbotInlineMessageMediaGeo &v(_botInlineMessageMediaGeo()); + v.vgeo.read(from, end); + } break; + case mtpc_botInlineMessageMediaVenue: _type = cons; { + if (!data) setData(new MTPDbotInlineMessageMediaVenue()); + MTPDbotInlineMessageMediaVenue &v(_botInlineMessageMediaVenue()); + 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); + } break; + case mtpc_botInlineMessageMediaContact: _type = cons; { + if (!data) setData(new MTPDbotInlineMessageMediaContact()); + MTPDbotInlineMessageMediaContact &v(_botInlineMessageMediaContact()); + v.vphone_number.read(from, end); + v.vfirst_name.read(from, end); + v.vlast_name.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPbotInlineMessage"); } } @@ -32759,12 +33285,33 @@ inline void MTPbotInlineMessage::write(mtpBuffer &to) const { v.vmessage.write(to); if (v.has_entities()) v.ventities.write(to); } break; + case mtpc_botInlineMessageMediaGeo: { + const MTPDbotInlineMessageMediaGeo &v(c_botInlineMessageMediaGeo()); + v.vgeo.write(to); + } break; + case mtpc_botInlineMessageMediaVenue: { + const MTPDbotInlineMessageMediaVenue &v(c_botInlineMessageMediaVenue()); + v.vgeo.write(to); + v.vtitle.write(to); + v.vaddress.write(to); + v.vprovider.write(to); + v.vvenue_id.write(to); + } break; + case mtpc_botInlineMessageMediaContact: { + const MTPDbotInlineMessageMediaContact &v(c_botInlineMessageMediaContact()); + v.vphone_number.write(to); + v.vfirst_name.write(to); + v.vlast_name.write(to); + } break; } } inline MTPbotInlineMessage::MTPbotInlineMessage(mtpTypeId type) : mtpDataOwner(0), _type(type) { switch (type) { case mtpc_botInlineMessageMediaAuto: setData(new MTPDbotInlineMessageMediaAuto()); break; case mtpc_botInlineMessageText: setData(new MTPDbotInlineMessageText()); break; + case mtpc_botInlineMessageMediaGeo: setData(new MTPDbotInlineMessageMediaGeo()); break; + case mtpc_botInlineMessageMediaVenue: setData(new MTPDbotInlineMessageMediaVenue()); break; + case mtpc_botInlineMessageMediaContact: setData(new MTPDbotInlineMessageMediaContact()); break; default: throw mtpErrorBadTypeId(type, "MTPbotInlineMessage"); } } @@ -32772,6 +33319,12 @@ inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaAuto *_ } inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageText *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageText) { } +inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaGeo *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageMediaGeo) { +} +inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaVenue *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageMediaVenue) { +} +inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageMediaContact) { +} inline MTPbotInlineMessage MTP_botInlineMessageMediaAuto(const MTPstring &_caption) { return MTP::internal::TypeCreator::new_botInlineMessageMediaAuto(_caption); } @@ -32779,6 +33332,15 @@ 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_botInlineMessageMediaGeo(const MTPGeoPoint &_geo) { + return MTP::internal::TypeCreator::new_botInlineMessageMediaGeo(_geo); +} +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); +} +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); +} inline uint32 MTPbotInlineResult::innerLength() const { switch (_type) { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 5a5e7def69..48d4f5f518 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -414,6 +414,9 @@ public: bool isVerified() const { return flags & MTPDuser::Flag::f_verified; } + bool isBotInlineGeo() const { + return flags & MTPDuser::Flag::f_bot_inline_geo; + } bool canWrite() const { return access != UserNoAccess; }