From 1545e7f796f8b803a5643585b372aebab24aa990 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Dec 2015 18:31:56 +0300 Subject: [PATCH] moved to 44 layer --- Telegram/SourceFiles/app.cpp | 3 +- Telegram/SourceFiles/history.cpp | 2 + Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 133 ++++++- Telegram/SourceFiles/mtproto/mtpScheme.h | 385 ++++++++++++++++++++ Telegram/SourceFiles/mtproto/scheme.tl | 12 +- Telegram/SourceFiles/overviewwidget.cpp | 4 +- Telegram/SourceFiles/profilewidget.cpp | 2 +- 9 files changed, 521 insertions(+), 24 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 4837b1bbea..2672bd90c7 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1328,6 +1328,7 @@ namespace App { return page; } break; case mtpc_webPagePending: return App::feedWebPage(webpage.c_webPagePending()); + case mtpc_webPageExternal: LOG(("API Error: should not get webPageExternal in App::feedWebPage")); break; } return 0; } @@ -2444,7 +2445,7 @@ namespace App { if (!::gifItems.isEmpty()) { if (HistoryItem *playing = ::gifItems.begin().value()) { if (playing->getMedia() && playing->getMedia()->type() == MediaTypeGif) { -// static_cast(playing->getMedia())->stop(playing); + static_cast(playing->getMedia())->stop(playing); } } } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index d2a7fb77bc..4b3ca1d27a 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1452,6 +1452,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo case mtpc_webPage: case mtpc_webPageEmpty: case mtpc_webPagePending: break; + case mtpc_webPageExternal: LOG(("API Error: should not get webPageExternal in History::createItem")); default: badMedia = 1; break; } break; @@ -6640,6 +6641,7 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tTex case mtpc_webPage: { _media = new HistoryWebPage(App::feedWebPage(d.c_webPage())); } break; + case mtpc_webPageExternal: LOG(("API Error: should not get webPageExternal in HistoryMessage::initMedia")); break; } } break; default: initMediaFromText(currentText); break; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 7ff7ac6a8c..435c085016 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3225,7 +3225,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re } } - App::stopGifItems(); +// App::stopGifItems(); clearReplyReturns(); clearAllLoadRequests(); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 290c7716c1..10925cdc71 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 43; +static const mtpPrime mtpCurrentLayer = 44; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 627f9d69ca..93b7d74efb 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -784,6 +784,20 @@ void _serialize_inputMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Typ } } +void _serialize_inputMediaGifExternal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ inputMediaGifExternal"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); 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_inputChatPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { to.add("{ inputChatPhotoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -1116,15 +1130,16 @@ void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, case 6: to.add(" bot_chat_history: "); ++stages.back(); if (flag & MTPDuser::flag_bot_chat_history) { to.add("YES [ BY BIT 15 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break; case 7: to.add(" bot_nochats: "); ++stages.back(); if (flag & MTPDuser::flag_bot_nochats) { to.add("YES [ BY BIT 16 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 16 IN FIELD flags ]"); } break; case 8: to.add(" verified: "); ++stages.back(); if (flag & MTPDuser::flag_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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 11: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 12: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 13: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 14: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 15: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_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 16: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_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 17: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 9: to.add(" explicit_content: "); ++stages.back(); if (flag & MTPDuser::flag_explicit_content) { to.add("YES [ BY BIT 18 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; + case 10: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 12: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 13: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 14: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 15: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 16: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_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 17: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_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 18: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1260,13 +1275,14 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type case 6: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchannel::flag_broadcast) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; case 7: to.add(" verified: "); ++stages.back(); if (flag & MTPDchannel::flag_verified) { to.add("YES [ BY BIT 7 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; case 8: to.add(" megagroup: "); ++stages.back(); if (flag & MTPDchannel::flag_megagroup) { to.add("YES [ BY BIT 8 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; - case 9: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 13: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" explicit_content: "); ++stages.back(); if (flag & MTPDchannel::flag_explicit_content) { to.add("YES [ BY BIT 9 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 10: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 14: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 15: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); 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; } } @@ -4212,6 +4228,29 @@ void _serialize_webPage(MTPStringLogger &to, int32 stage, int32 lev, Types &type } } +void _serialize_webPageExternal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ webPageExternal"); + 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_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" display_url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" type: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_type) { types.push_back(mtpc_string); 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(" title: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_title) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 5: to.add(" description: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_description) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 6: to.add(" thumb_url: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_thumb_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 7: to.add(" content_url: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_content_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 8: to.add(" w: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_w) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 9: to.add(" h: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_h) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 10: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPageExternal::flag_duration) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5038,6 +5077,33 @@ void _serialize_help_termsOfService(MTPStringLogger &to, int32 stage, int32 lev, } } +void _serialize_foundGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ foundGif"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" webpage: "); ++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_messages_foundGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_foundGifs"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" next_offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" results: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7000,6 +7066,35 @@ void _serialize_messages_getStickerSet(MTPStringLogger &to, int32 stage, int32 l } } +void _serialize_messages_getDocumentByHash(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_getDocumentByHash"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" sha256: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); 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_messages_searchGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_searchGifs"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_updates_getState(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -7304,6 +7399,7 @@ namespace { _serializers.insert(mtpc_inputMediaUploadedThumbDocument, _serialize_inputMediaUploadedThumbDocument); _serializers.insert(mtpc_inputMediaDocument, _serialize_inputMediaDocument); _serializers.insert(mtpc_inputMediaVenue, _serialize_inputMediaVenue); + _serializers.insert(mtpc_inputMediaGifExternal, _serialize_inputMediaGifExternal); _serializers.insert(mtpc_inputChatPhotoEmpty, _serialize_inputChatPhotoEmpty); _serializers.insert(mtpc_inputChatUploadedPhoto, _serialize_inputChatUploadedPhoto); _serializers.insert(mtpc_inputChatPhoto, _serialize_inputChatPhoto); @@ -7587,6 +7683,7 @@ namespace { _serializers.insert(mtpc_webPageEmpty, _serialize_webPageEmpty); _serializers.insert(mtpc_webPagePending, _serialize_webPagePending); _serializers.insert(mtpc_webPage, _serialize_webPage); + _serializers.insert(mtpc_webPageExternal, _serialize_webPageExternal); _serializers.insert(mtpc_authorization, _serialize_authorization); _serializers.insert(mtpc_account_authorizations, _serialize_account_authorizations); _serializers.insert(mtpc_account_noPassword, _serialize_account_noPassword); @@ -7652,6 +7749,8 @@ namespace { _serializers.insert(mtpc_channels_channelParticipants, _serialize_channels_channelParticipants); _serializers.insert(mtpc_channels_channelParticipant, _serialize_channels_channelParticipant); _serializers.insert(mtpc_help_termsOfService, _serialize_help_termsOfService); + _serializers.insert(mtpc_foundGif, _serialize_foundGif); + _serializers.insert(mtpc_messages_foundGifs, _serialize_messages_foundGifs); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -7798,6 +7897,8 @@ namespace { _serializers.insert(mtpc_channels_exportInvite, _serialize_channels_exportInvite); _serializers.insert(mtpc_messages_checkChatInvite, _serialize_messages_checkChatInvite); _serializers.insert(mtpc_messages_getStickerSet, _serialize_messages_getStickerSet); + _serializers.insert(mtpc_messages_getDocumentByHash, _serialize_messages_getDocumentByHash); + _serializers.insert(mtpc_messages_searchGifs, _serialize_messages_searchGifs); _serializers.insert(mtpc_updates_getState, _serialize_updates_getState); _serializers.insert(mtpc_updates_getDifference, _serialize_updates_getDifference); _serializers.insert(mtpc_updates_getChannelDifference, _serialize_updates_getChannelDifference); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 6b0d1c3a1f..8d9765ce56 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -96,6 +96,7 @@ enum { mtpc_inputMediaUploadedThumbDocument = 0x41481486, mtpc_inputMediaDocument = 0xd184e841, mtpc_inputMediaVenue = 0x2827a81a, + mtpc_inputMediaGifExternal = 0x4843b0fd, mtpc_inputChatPhotoEmpty = 0x1ca48f57, mtpc_inputChatUploadedPhoto = 0x94254732, mtpc_inputChatPhoto = 0xb2e1bf08, @@ -379,6 +380,7 @@ enum { mtpc_webPageEmpty = 0xeb1477e8, mtpc_webPagePending = 0xc586da1c, mtpc_webPage = 0xca820ed7, + mtpc_webPageExternal = 0xcf73f207, mtpc_authorization = 0x7bf2e6f6, mtpc_account_authorizations = 0x1250abde, mtpc_account_noPassword = 0x96dabc18, @@ -444,6 +446,8 @@ enum { mtpc_channels_channelParticipants = 0xf56ee2a8, mtpc_channels_channelParticipant = 0xd0d9b163, mtpc_help_termsOfService = 0xf1ee3e90, + mtpc_foundGif = 0xd579cccb, + mtpc_messages_foundGifs = 0x450a1c0a, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -553,6 +557,8 @@ enum { mtpc_messages_migrateChat = 0x15a3b8e3, mtpc_messages_searchGlobal = 0x9e3cacb0, mtpc_messages_reorderStickerSets = 0x9fcfbc30, + mtpc_messages_getDocumentByHash = 0x338e2464, + mtpc_messages_searchGifs = 0xbf9a776b, mtpc_updates_getState = 0xedd4882a, mtpc_updates_getDifference = 0xa041495, mtpc_updates_getChannelDifference = 0xbb32d7c0, @@ -706,6 +712,7 @@ class MTPDinputMediaUploadedDocument; class MTPDinputMediaUploadedThumbDocument; class MTPDinputMediaDocument; class MTPDinputMediaVenue; +class MTPDinputMediaGifExternal; class MTPinputChatPhoto; class MTPDinputChatUploadedPhoto; @@ -1101,6 +1108,7 @@ class MTPwebPage; class MTPDwebPageEmpty; class MTPDwebPagePending; class MTPDwebPage; +class MTPDwebPageExternal; class MTPauthorization; class MTPDauthorization; @@ -1215,6 +1223,12 @@ class MTPDchannels_channelParticipant; class MTPhelp_termsOfService; class MTPDhelp_termsOfService; +class MTPfoundGif; +class MTPDfoundGif; + +class MTPmessages_foundGifs; +class MTPDmessages_foundGifs; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1374,6 +1388,8 @@ typedef MTPBoxed MTPChannelParticipantRole; typedef MTPBoxed MTPchannels_ChannelParticipants; typedef MTPBoxed MTPchannels_ChannelParticipant; typedef MTPBoxed MTPhelp_TermsOfService; +typedef MTPBoxed MTPFoundGif; +typedef MTPBoxed MTPmessages_FoundGifs; // Type classes definitions @@ -2600,6 +2616,18 @@ public: return *(const MTPDinputMediaVenue*)data; } + MTPDinputMediaGifExternal &_inputMediaGifExternal() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputMediaGifExternal) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaGifExternal); + split(); + return *(MTPDinputMediaGifExternal*)data; + } + const MTPDinputMediaGifExternal &c_inputMediaGifExternal() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_inputMediaGifExternal) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaGifExternal); + return *(const MTPDinputMediaGifExternal*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -2622,6 +2650,7 @@ private: explicit MTPinputMedia(MTPDinputMediaUploadedThumbDocument *_data); explicit MTPinputMedia(MTPDinputMediaDocument *_data); explicit MTPinputMedia(MTPDinputMediaVenue *_data); + explicit MTPinputMedia(MTPDinputMediaGifExternal *_data); friend MTPinputMedia MTP_inputMediaEmpty(); friend MTPinputMedia MTP_inputMediaUploadedPhoto(const MTPInputFile &_file, const MTPstring &_caption); @@ -2637,6 +2666,7 @@ private: friend MTPinputMedia MTP_inputMediaUploadedThumbDocument(const MTPInputFile &_file, const MTPInputFile &_thumb, const MTPstring &_mime_type, const MTPVector &_attributes); friend MTPinputMedia MTP_inputMediaDocument(const MTPInputDocument &_id); friend MTPinputMedia MTP_inputMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id); + friend MTPinputMedia MTP_inputMediaGifExternal(const MTPstring &_url, const MTPstring &_q); mtpTypeId _type; }; @@ -7547,6 +7577,18 @@ public: return *(const MTPDwebPage*)data; } + MTPDwebPageExternal &_webPageExternal() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_webPageExternal) throw mtpErrorWrongTypeId(_type, mtpc_webPageExternal); + split(); + return *(MTPDwebPageExternal*)data; + } + const MTPDwebPageExternal &c_webPageExternal() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_webPageExternal) throw mtpErrorWrongTypeId(_type, mtpc_webPageExternal); + return *(const MTPDwebPageExternal*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -7559,10 +7601,12 @@ private: explicit MTPwebPage(MTPDwebPageEmpty *_data); explicit MTPwebPage(MTPDwebPagePending *_data); explicit MTPwebPage(MTPDwebPage *_data); + explicit MTPwebPage(MTPDwebPageExternal *_data); friend MTPwebPage MTP_webPageEmpty(const MTPlong &_id); friend MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date); friend MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document); + friend MTPwebPage MTP_webPageExternal(MTPint _flags, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_thumb_url, const MTPstring &_content_url, MTPint _w, MTPint _h, MTPint _duration); mtpTypeId _type; }; @@ -8907,6 +8951,68 @@ private: }; typedef MTPBoxed MTPhelp_TermsOfService; +class MTPfoundGif : private mtpDataOwner { +public: + MTPfoundGif(); + MTPfoundGif(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_foundGif) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDfoundGif &_foundGif() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDfoundGif*)data; + } + const MTPDfoundGif &c_foundGif() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDfoundGif*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_foundGif); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPfoundGif(MTPDfoundGif *_data); + + friend MTPfoundGif MTP_foundGif(const MTPWebPage &_webpage); +}; +typedef MTPBoxed MTPFoundGif; + +class MTPmessages_foundGifs : private mtpDataOwner { +public: + MTPmessages_foundGifs(); + MTPmessages_foundGifs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_foundGifs) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDmessages_foundGifs &_messages_foundGifs() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDmessages_foundGifs*)data; + } + const MTPDmessages_foundGifs &c_messages_foundGifs() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDmessages_foundGifs*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_foundGifs); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPmessages_foundGifs(MTPDmessages_foundGifs *_data); + + friend MTPmessages_foundGifs MTP_messages_foundGifs(MTPint _next_offset, const MTPVector &_results); +}; +typedef MTPBoxed MTPmessages_FoundGifs; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -9478,6 +9584,17 @@ public: MTPstring vvenue_id; }; +class MTPDinputMediaGifExternal : public mtpDataImpl { +public: + MTPDinputMediaGifExternal() { + } + MTPDinputMediaGifExternal(const MTPstring &_url, const MTPstring &_q) : vurl(_url), vq(_q) { + } + + MTPstring vurl; + MTPstring vq; +}; + class MTPDinputChatUploadedPhoto : public mtpDataImpl { public: MTPDinputChatUploadedPhoto() { @@ -9706,6 +9823,7 @@ public: flag_bot_chat_history = (1 << 15), flag_bot_nochats = (1 << 16), flag_verified = (1 << 17), + flag_explicit_content = (1 << 18), flag_access_hash = (1 << 0), flag_first_name = (1 << 1), flag_last_name = (1 << 2), @@ -9724,6 +9842,7 @@ public: bool is_bot_chat_history() const { return vflags.v & flag_bot_chat_history; } bool is_bot_nochats() const { return vflags.v & flag_bot_nochats; } bool is_verified() const { return vflags.v & flag_verified; } + bool is_explicit_content() const { return vflags.v & flag_explicit_content; } bool has_access_hash() const { return vflags.v & flag_access_hash; } bool has_first_name() const { return vflags.v & flag_first_name; } bool has_last_name() const { return vflags.v & flag_last_name; } @@ -9847,6 +9966,7 @@ public: flag_broadcast = (1 << 5), flag_verified = (1 << 7), flag_megagroup = (1 << 8), + flag_explicit_content = (1 << 9), flag_username = (1 << 6), }; @@ -9858,6 +9978,7 @@ public: bool is_broadcast() const { return vflags.v & flag_broadcast; } bool is_verified() const { return vflags.v & flag_verified; } bool is_megagroup() const { return vflags.v & flag_megagroup; } + bool is_explicit_content() const { return vflags.v & flag_explicit_content; } bool has_username() const { return vflags.v & flag_username; } }; @@ -12168,6 +12289,46 @@ public: bool has_document() const { return vflags.v & flag_document; } }; +class MTPDwebPageExternal : public mtpDataImpl { +public: + MTPDwebPageExternal() { + } + MTPDwebPageExternal(MTPint _flags, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_thumb_url, const MTPstring &_content_url, MTPint _w, MTPint _h, MTPint _duration) : vflags(_flags), vurl(_url), vdisplay_url(_display_url), vtype(_type), vtitle(_title), vdescription(_description), vthumb_url(_thumb_url), vcontent_url(_content_url), vw(_w), vh(_h), vduration(_duration) { + } + + MTPint vflags; + MTPstring vurl; + MTPstring vdisplay_url; + MTPstring vtype; + MTPstring vtitle; + MTPstring vdescription; + MTPstring vthumb_url; + MTPstring vcontent_url; + MTPint vw; + MTPint vh; + MTPint vduration; + + enum { + flag_type = (1 << 0), + flag_title = (1 << 1), + flag_description = (1 << 2), + flag_thumb_url = (1 << 3), + flag_content_url = (1 << 4), + flag_w = (1 << 5), + flag_h = (1 << 5), + flag_duration = (1 << 6), + }; + + bool has_type() const { return vflags.v & flag_type; } + bool has_title() const { return vflags.v & flag_title; } + bool has_description() const { return vflags.v & flag_description; } + bool has_thumb_url() const { return vflags.v & flag_thumb_url; } + bool has_content_url() const { return vflags.v & flag_content_url; } + bool has_w() const { return vflags.v & flag_w; } + bool has_h() const { return vflags.v & flag_h; } + bool has_duration() const { return vflags.v & flag_duration; } +}; + class MTPDauthorization : public mtpDataImpl { public: MTPDauthorization() { @@ -12857,6 +13018,27 @@ public: MTPstring vtext; }; +class MTPDfoundGif : public mtpDataImpl { +public: + MTPDfoundGif() { + } + MTPDfoundGif(const MTPWebPage &_webpage) : vwebpage(_webpage) { + } + + MTPWebPage vwebpage; +}; + +class MTPDmessages_foundGifs : public mtpDataImpl { +public: + MTPDmessages_foundGifs() { + } + MTPDmessages_foundGifs(MTPint _next_offset, const MTPVector &_results) : vnext_offset(_next_offset), vresults(_results) { + } + + MTPint vnext_offset; + MTPVector vresults; +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -17807,6 +17989,93 @@ public: } }; +class MTPmessages_getDocumentByHash { // RPC method 'messages.getDocumentByHash' +public: + MTPbytes vsha256; + MTPint vsize; + MTPstring vmime_type; + + MTPmessages_getDocumentByHash() { + } + MTPmessages_getDocumentByHash(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDocumentByHash) { + read(from, end, cons); + } + MTPmessages_getDocumentByHash(const MTPbytes &_sha256, MTPint _size, const MTPstring &_mime_type) : vsha256(_sha256), vsize(_size), vmime_type(_mime_type) { + } + + uint32 innerLength() const { + return vsha256.innerLength() + vsize.innerLength() + vmime_type.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_getDocumentByHash; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDocumentByHash) { + vsha256.read(from, end); + vsize.read(from, end); + vmime_type.read(from, end); + } + void write(mtpBuffer &to) const { + vsha256.write(to); + vsize.write(to); + vmime_type.write(to); + } + + typedef MTPDocument ResponseType; +}; +class MTPmessages_GetDocumentByHash : public MTPBoxed { +public: + MTPmessages_GetDocumentByHash() { + } + MTPmessages_GetDocumentByHash(const MTPmessages_getDocumentByHash &v) : MTPBoxed(v) { + } + MTPmessages_GetDocumentByHash(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_GetDocumentByHash(const MTPbytes &_sha256, MTPint _size, const MTPstring &_mime_type) : MTPBoxed(MTPmessages_getDocumentByHash(_sha256, _size, _mime_type)) { + } +}; + +class MTPmessages_searchGifs { // RPC method 'messages.searchGifs' +public: + MTPstring vq; + MTPint voffset; + + MTPmessages_searchGifs() { + } + MTPmessages_searchGifs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_searchGifs) { + read(from, end, cons); + } + MTPmessages_searchGifs(const MTPstring &_q, MTPint _offset) : vq(_q), voffset(_offset) { + } + + uint32 innerLength() const { + return vq.innerLength() + voffset.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_searchGifs; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_searchGifs) { + vq.read(from, end); + voffset.read(from, end); + } + void write(mtpBuffer &to) const { + vq.write(to); + voffset.write(to); + } + + typedef MTPmessages_FoundGifs ResponseType; +}; +class MTPmessages_SearchGifs : public MTPBoxed { +public: + MTPmessages_SearchGifs() { + } + MTPmessages_SearchGifs(const MTPmessages_searchGifs &v) : MTPBoxed(v) { + } + MTPmessages_SearchGifs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_SearchGifs(const MTPstring &_q, MTPint _offset) : MTPBoxed(MTPmessages_searchGifs(_q, _offset)) { + } +}; + class MTPupdates_getState { // RPC method 'updates.getState' public: MTPupdates_getState() { @@ -20918,6 +21187,10 @@ inline uint32 MTPinputMedia::innerLength() const { const MTPDinputMediaVenue &v(c_inputMediaVenue()); return v.vgeo_point.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vprovider.innerLength() + v.vvenue_id.innerLength(); } + case mtpc_inputMediaGifExternal: { + const MTPDinputMediaGifExternal &v(c_inputMediaGifExternal()); + return v.vurl.innerLength() + v.vq.innerLength(); + } } return 0; } @@ -21021,6 +21294,12 @@ inline void MTPinputMedia::read(const mtpPrime *&from, const mtpPrime *end, mtpT v.vprovider.read(from, end); v.vvenue_id.read(from, end); } break; + case mtpc_inputMediaGifExternal: _type = cons; { + if (!data) setData(new MTPDinputMediaGifExternal()); + MTPDinputMediaGifExternal &v(_inputMediaGifExternal()); + v.vurl.read(from, end); + v.vq.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPinputMedia"); } } @@ -21105,6 +21384,11 @@ inline void MTPinputMedia::write(mtpBuffer &to) const { v.vprovider.write(to); v.vvenue_id.write(to); } break; + case mtpc_inputMediaGifExternal: { + const MTPDinputMediaGifExternal &v(c_inputMediaGifExternal()); + v.vurl.write(to); + v.vq.write(to); + } break; } } inline MTPinputMedia::MTPinputMedia(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -21123,6 +21407,7 @@ inline MTPinputMedia::MTPinputMedia(mtpTypeId type) : mtpDataOwner(0), _type(typ case mtpc_inputMediaUploadedThumbDocument: setData(new MTPDinputMediaUploadedThumbDocument()); break; case mtpc_inputMediaDocument: setData(new MTPDinputMediaDocument()); break; case mtpc_inputMediaVenue: setData(new MTPDinputMediaVenue()); break; + case mtpc_inputMediaGifExternal: setData(new MTPDinputMediaGifExternal()); break; default: throw mtpErrorBadTypeId(type, "MTPinputMedia"); } } @@ -21152,6 +21437,8 @@ inline MTPinputMedia::MTPinputMedia(MTPDinputMediaDocument *_data) : mtpDataOwne } inline MTPinputMedia::MTPinputMedia(MTPDinputMediaVenue *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaVenue) { } +inline MTPinputMedia::MTPinputMedia(MTPDinputMediaGifExternal *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaGifExternal) { +} inline MTPinputMedia MTP_inputMediaEmpty() { return MTPinputMedia(mtpc_inputMediaEmpty); } @@ -21194,6 +21481,9 @@ inline MTPinputMedia MTP_inputMediaDocument(const MTPInputDocument &_id) { inline MTPinputMedia MTP_inputMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { return MTPinputMedia(new MTPDinputMediaVenue(_geo_point, _title, _address, _provider, _venue_id)); } +inline MTPinputMedia MTP_inputMediaGifExternal(const MTPstring &_url, const MTPstring &_q) { + return MTPinputMedia(new MTPDinputMediaGifExternal(_url, _q)); +} inline uint32 MTPinputChatPhoto::innerLength() const { switch (_type) { @@ -27996,6 +28286,10 @@ inline uint32 MTPwebPage::innerLength() const { const MTPDwebPage &v(c_webPage()); return v.vflags.innerLength() + v.vid.innerLength() + v.vurl.innerLength() + v.vdisplay_url.innerLength() + (v.has_type() ? v.vtype.innerLength() : 0) + (v.has_site_name() ? v.vsite_name.innerLength() : 0) + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_photo() ? v.vphoto.innerLength() : 0) + (v.has_embed_url() ? v.vembed_url.innerLength() : 0) + (v.has_embed_type() ? v.vembed_type.innerLength() : 0) + (v.has_embed_width() ? v.vembed_width.innerLength() : 0) + (v.has_embed_height() ? v.vembed_height.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0) + (v.has_author() ? v.vauthor.innerLength() : 0) + (v.has_document() ? v.vdocument.innerLength() : 0); } + case mtpc_webPageExternal: { + const MTPDwebPageExternal &v(c_webPageExternal()); + return v.vflags.innerLength() + v.vurl.innerLength() + v.vdisplay_url.innerLength() + (v.has_type() ? v.vtype.innerLength() : 0) + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_thumb_url() ? v.vthumb_url.innerLength() : 0) + (v.has_content_url() ? v.vcontent_url.innerLength() : 0) + (v.has_w() ? v.vw.innerLength() : 0) + (v.has_h() ? v.vh.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0); + } } return 0; } @@ -28037,6 +28331,21 @@ inline void MTPwebPage::read(const mtpPrime *&from, const mtpPrime *end, mtpType if (v.has_author()) { v.vauthor.read(from, end); } else { v.vauthor = MTPstring(); } if (v.has_document()) { v.vdocument.read(from, end); } else { v.vdocument = MTPDocument(); } } break; + case mtpc_webPageExternal: _type = cons; { + if (!data) setData(new MTPDwebPageExternal()); + MTPDwebPageExternal &v(_webPageExternal()); + v.vflags.read(from, end); + v.vurl.read(from, end); + v.vdisplay_url.read(from, end); + if (v.has_type()) { v.vtype.read(from, end); } else { v.vtype = MTPstring(); } + 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_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_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(); } + } break; default: throw mtpErrorUnexpected(cons, "MTPwebPage"); } } @@ -28070,6 +28379,20 @@ inline void MTPwebPage::write(mtpBuffer &to) const { if (v.has_author()) v.vauthor.write(to); if (v.has_document()) v.vdocument.write(to); } break; + case mtpc_webPageExternal: { + const MTPDwebPageExternal &v(c_webPageExternal()); + v.vflags.write(to); + v.vurl.write(to); + v.vdisplay_url.write(to); + if (v.has_type()) v.vtype.write(to); + if (v.has_title()) v.vtitle.write(to); + if (v.has_description()) v.vdescription.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_w()) v.vw.write(to); + if (v.has_h()) v.vh.write(to); + if (v.has_duration()) v.vduration.write(to); + } break; } } inline MTPwebPage::MTPwebPage(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -28077,6 +28400,7 @@ inline MTPwebPage::MTPwebPage(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_webPageEmpty: setData(new MTPDwebPageEmpty()); break; case mtpc_webPagePending: setData(new MTPDwebPagePending()); break; case mtpc_webPage: setData(new MTPDwebPage()); break; + case mtpc_webPageExternal: setData(new MTPDwebPageExternal()); break; default: throw mtpErrorBadTypeId(type, "MTPwebPage"); } } @@ -28086,6 +28410,8 @@ inline MTPwebPage::MTPwebPage(MTPDwebPagePending *_data) : mtpDataOwner(_data), } inline MTPwebPage::MTPwebPage(MTPDwebPage *_data) : mtpDataOwner(_data), _type(mtpc_webPage) { } +inline MTPwebPage::MTPwebPage(MTPDwebPageExternal *_data) : mtpDataOwner(_data), _type(mtpc_webPageExternal) { +} inline MTPwebPage MTP_webPageEmpty(const MTPlong &_id) { return MTPwebPage(new MTPDwebPageEmpty(_id)); } @@ -28095,6 +28421,9 @@ inline MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date) { inline MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) { return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document)); } +inline MTPwebPage MTP_webPageExternal(MTPint _flags, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_thumb_url, const MTPstring &_content_url, MTPint _w, MTPint _h, MTPint _duration) { + return MTPwebPage(new MTPDwebPageExternal(_flags, _url, _display_url, _type, _title, _description, _thumb_url, _content_url, _w, _h, _duration)); +} inline MTPauthorization::MTPauthorization() : mtpDataOwner(new MTPDauthorization()) { } @@ -29793,6 +30122,62 @@ inline MTPhelp_termsOfService MTP_help_termsOfService(const MTPstring &_text) { return MTPhelp_termsOfService(new MTPDhelp_termsOfService(_text)); } +inline MTPfoundGif::MTPfoundGif() : mtpDataOwner(new MTPDfoundGif()) { +} + +inline uint32 MTPfoundGif::innerLength() const { + const MTPDfoundGif &v(c_foundGif()); + return v.vwebpage.innerLength(); +} +inline mtpTypeId MTPfoundGif::type() const { + return mtpc_foundGif; +} +inline void MTPfoundGif::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_foundGif) throw mtpErrorUnexpected(cons, "MTPfoundGif"); + + if (!data) setData(new MTPDfoundGif()); + MTPDfoundGif &v(_foundGif()); + v.vwebpage.read(from, end); +} +inline void MTPfoundGif::write(mtpBuffer &to) const { + const MTPDfoundGif &v(c_foundGif()); + v.vwebpage.write(to); +} +inline MTPfoundGif::MTPfoundGif(MTPDfoundGif *_data) : mtpDataOwner(_data) { +} +inline MTPfoundGif MTP_foundGif(const MTPWebPage &_webpage) { + return MTPfoundGif(new MTPDfoundGif(_webpage)); +} + +inline MTPmessages_foundGifs::MTPmessages_foundGifs() : mtpDataOwner(new MTPDmessages_foundGifs()) { +} + +inline uint32 MTPmessages_foundGifs::innerLength() const { + const MTPDmessages_foundGifs &v(c_messages_foundGifs()); + return v.vnext_offset.innerLength() + v.vresults.innerLength(); +} +inline mtpTypeId MTPmessages_foundGifs::type() const { + return mtpc_messages_foundGifs; +} +inline void MTPmessages_foundGifs::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_messages_foundGifs) throw mtpErrorUnexpected(cons, "MTPmessages_foundGifs"); + + if (!data) setData(new MTPDmessages_foundGifs()); + MTPDmessages_foundGifs &v(_messages_foundGifs()); + v.vnext_offset.read(from, end); + v.vresults.read(from, end); +} +inline void MTPmessages_foundGifs::write(mtpBuffer &to) const { + const MTPDmessages_foundGifs &v(c_messages_foundGifs()); + v.vnext_offset.write(to); + v.vresults.write(to); +} +inline MTPmessages_foundGifs::MTPmessages_foundGifs(MTPDmessages_foundGifs *_data) : mtpDataOwner(_data) { +} +inline MTPmessages_foundGifs MTP_messages_foundGifs(MTPint _next_offset, const MTPVector &_results) { + return MTPmessages_foundGifs(new MTPDmessages_foundGifs(_next_offset, _results)); +} + // Human-readable text serialization #if (defined _DEBUG || defined _WITH_DEBUG) diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index db9481ad04..2658775167 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -159,6 +159,7 @@ inputMediaUploadedDocument#ffe76b78 file:InputFile mime_type:string attributes:V inputMediaUploadedThumbDocument#41481486 file:InputFile thumb:InputFile mime_type:string attributes:Vector = InputMedia; inputMediaDocument#d184e841 id:InputDocument = InputMedia; inputMediaVenue#2827a81a geo_point:InputGeoPoint title:string address:string provider:string venue_id:string = InputMedia; +inputMediaGifExternal#4843b0fd url:string q:string = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; inputChatUploadedPhoto#94254732 file:InputFile crop:InputPhotoCrop = InputChatPhoto; @@ -203,7 +204,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#22e49072 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 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 = User; +user#22e49072 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 explicit_content:flags.18?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 = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto; @@ -218,7 +219,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#678e9587 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat; +channel#678e9587 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true explicit_content:flags.9?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat; channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; @@ -538,6 +539,7 @@ contactLinkContact#d502c2d0 = ContactLink; webPageEmpty#eb1477e8 id:long = WebPage; webPagePending#c586da1c id:long date:int = WebPage; webPage#ca820ed7 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document = WebPage; +webPageExternal#cf73f207 flags:# url:string display_url:string type:flags.0?string title:flags.1?string description:flags.2?string thumb_url:flags.3?string content_url:flags.4?string w:flags.5?int h:flags.5?int duration:flags.6?int = WebPage; authorization#7bf2e6f6 hash:long flags:int device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization; @@ -635,6 +637,10 @@ channels.channelParticipant#d0d9b163 participant:ChannelParticipant users:Vector help.termsOfService#f1ee3e90 text:string = help.TermsOfService; +foundGif#d579cccb webpage:WebPage = FoundGif; + +messages.foundGifs#450a1c0a next_offset:int results:Vector = messages.FoundGifs; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -751,6 +757,8 @@ messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bo messages.migrateChat#15a3b8e3 chat_id:int = Updates; messages.searchGlobal#9e3cacb0 q:string offset_date:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; messages.reorderStickerSets#9fcfbc30 order:Vector = Bool; +messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document; +messages.searchGifs#bf9a776b q:string offset:int = messages.FoundGifs; updates.getState#edd4882a = updates.State; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 6336a25202..35f02ae9b1 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -2906,7 +2906,7 @@ int32 OverviewWidget::countBestScroll() const { } void OverviewWidget::fastShow(bool back, int32 lastScrollTop) { - App::stopGifItems(); +// App::stopGifItems(); resizeEvent(0); _scrollSetAfterShow = (lastScrollTop < 0 ? countBestScroll() : lastScrollTop); show(); @@ -2919,7 +2919,7 @@ void OverviewWidget::fastShow(bool back, int32 lastScrollTop) { void OverviewWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTopBarCache, bool back, int32 lastScrollTop) { if (App::app()) App::app()->mtpPause(); - App::stopGifItems(); +// App::stopGifItems(); (back ? _cacheOver : _cacheUnder) = bgAnimCache; (back ? _cacheTopBarOver : _cacheTopBarUnder) = bgAnimTopBarCache; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index c1f177a948..14eb6d2b9f 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1832,7 +1832,7 @@ int32 ProfileWidget::lastScrollTop() const { void ProfileWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTopBarCache, bool back, int32 lastScrollTop) { if (App::app()) App::app()->mtpPause(); - App::stopGifItems(); +// App::stopGifItems(); (back ? _cacheOver : _cacheUnder) = bgAnimCache; (back ? _cacheTopBarOver : _cacheTopBarUnder) = bgAnimTopBarCache;