diff --git a/Telegram/Resources/colors.palette b/Telegram/Resources/colors.palette index 6755f8b66d..96214c4223 100644 --- a/Telegram/Resources/colors.palette +++ b/Telegram/Resources/colors.palette @@ -177,7 +177,7 @@ dialogsVerifiedIconFgActive: dialogsBgActive; dialogsSendingIconFgActive: #ffffff99; dialogsSentIconFgActive: dialogsTextFgActive; dialogsUnreadBgActive: dialogsTextFgActive; -dialogsUnreadBgMutedActive: #d3e2ee; +dialogsUnreadBgMutedActive: dialogsDraftFgActive; dialogsUnreadFgActive: dialogsBgActive; dialogsForwardBg: dialogsBgActive; diff --git a/Telegram/Resources/icons/dialogs_pinned.png b/Telegram/Resources/icons/dialogs_pinned.png new file mode 100644 index 0000000000..9ddb487478 Binary files /dev/null and b/Telegram/Resources/icons/dialogs_pinned.png differ diff --git a/Telegram/Resources/icons/dialogs_pinned@2x.png b/Telegram/Resources/icons/dialogs_pinned@2x.png new file mode 100644 index 0000000000..231933b94a Binary files /dev/null and b/Telegram/Resources/icons/dialogs_pinned@2x.png differ diff --git a/Telegram/Resources/icons/stickers_reorder.png b/Telegram/Resources/icons/stickers_reorder.png index 9be51fed48..d49b58f448 100644 Binary files a/Telegram/Resources/icons/stickers_reorder.png and b/Telegram/Resources/icons/stickers_reorder.png differ diff --git a/Telegram/Resources/icons/stickers_reorder@2x.png b/Telegram/Resources/icons/stickers_reorder@2x.png index 51f43b6c75..d0d660eda1 100644 Binary files a/Telegram/Resources/icons/stickers_reorder@2x.png and b/Telegram/Resources/icons/stickers_reorder@2x.png differ diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index e9a46b7754..cb6d50f706 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -842,6 +842,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_profile" = "View profile"; "lng_context_view_group" = "View group info"; "lng_context_view_channel" = "View channel info"; +"lng_context_pin_to_top" = "Pin to top"; +"lng_context_unpin_from_top" = "Unpin from top"; "lng_context_copy_link" = "Copy Link"; "lng_context_copy_post_link" = "Copy Post Link"; diff --git a/Telegram/Resources/sample.tdesktop-theme b/Telegram/Resources/sample.tdesktop-theme index 53d63888a7..ce33f69047 100644 --- a/Telegram/Resources/sample.tdesktop-theme +++ b/Telegram/Resources/sample.tdesktop-theme @@ -149,7 +149,7 @@ dialogsVerifiedIconFgActive: dialogsBgActive; dialogsSendingIconFgActive: #ffffff99; dialogsSentIconFgActive: dialogsTextFgActive; dialogsUnreadBgActive: dialogsTextFgActive; -dialogsUnreadBgMutedActive: #d3e2ee; +dialogsUnreadBgMutedActive: dialogsDraftFgActive; dialogsUnreadFgActive: dialogsBgActive; dialogsForwardBg: dialogsBgActive; dialogsForwardFg: dialogsNameFgActive; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 4bf3b5ab41..c0033e1c41 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1513,7 +1513,7 @@ namespace { return page; } break; case mtpc_webPagePending: return App::feedWebPage(webpage.c_webPagePending()); -// case mtpc_webPageNotModified: LOG(("API Error: webPageNotModified is unexpected in feedWebPage().")); break; // TODO + case mtpc_webPageNotModified: LOG(("API Error: webPageNotModified is unexpected in feedWebPage().")); break; } return nullptr; } diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 401ffc65e6..e197fc2b2f 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1069,7 +1069,7 @@ void AppClass::checkMapVersion() { } if (!versionFeatures.isEmpty()) { versionFeatures = lng_new_version_wrap(lt_version, QString::fromLatin1(AppVersionStr.c_str()), lt_changes, versionFeatures, lt_link, qsl("https://desktop.telegram.org/#changelog")); - _window->serviceNotification(versionFeatures); + _window->serviceNotificationLocal(versionFeatures); } } } diff --git a/Telegram/SourceFiles/boxes/sessionsbox.cpp b/Telegram/SourceFiles/boxes/sessionsbox.cpp index 4d9f458344..49df138ac3 100644 --- a/Telegram/SourceFiles/boxes/sessionsbox.cpp +++ b/Telegram/SourceFiles/boxes/sessionsbox.cpp @@ -44,7 +44,7 @@ SessionsBox::SessionsBox() : ScrollableBox(st::sessionsScroll) connect(_inner, SIGNAL(oneTerminated()), this, SLOT(onOneTerminated())); connect(_inner, SIGNAL(allTerminated()), this, SLOT(onAllTerminated())); connect(_inner, SIGNAL(terminateAll()), this, SLOT(onTerminateAll())); - connect(App::wnd(), SIGNAL(newAuthorization()), this, SLOT(onNewAuthorization())); + connect(App::wnd(), SIGNAL(checkNewAuthorization()), this, SLOT(onCheckNewAuthorization())); connect(&_shortPollTimer, SIGNAL(timeout()), this, SLOT(onShortPollAuthorizations())); init(_inner, st::boxButtonPadding.bottom() + _done->height() + st::boxButtonPadding.top(), titleHeight()); @@ -216,7 +216,7 @@ void SessionsBox::onShortPollAuthorizations() { } } -void SessionsBox::onNewAuthorization() { +void SessionsBox::onCheckNewAuthorization() { onShortPollAuthorizations(); // _shortPollTimer.start(1000); } diff --git a/Telegram/SourceFiles/boxes/sessionsbox.h b/Telegram/SourceFiles/boxes/sessionsbox.h index 5a48aea7ea..ec67d84865 100644 --- a/Telegram/SourceFiles/boxes/sessionsbox.h +++ b/Telegram/SourceFiles/boxes/sessionsbox.h @@ -42,7 +42,7 @@ public slots: void onAllTerminated(); void onTerminateAll(); void onShortPollAuthorizations(); - void onNewAuthorization(); + void onCheckNewAuthorization(); protected: void resizeEvent(QResizeEvent *e) override; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index c6f443b789..0b5c00f10c 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -167,8 +167,6 @@ enum { ChoosePeerByDragTimeout = 1000, // 1 second mouse not moved to choose dialog when dragging a file ReloadChannelMembersTimeout = 1000, // 1 second wait before reload members in channel after adding - - PinnedMessageTextLimit = 16, }; inline bool isNotificationsUser(uint64 id) { diff --git a/Telegram/SourceFiles/dialogs/dialogs.style b/Telegram/SourceFiles/dialogs/dialogs.style index f56f64f070..c1a5429e90 100644 --- a/Telegram/SourceFiles/dialogs/dialogs.style +++ b/Telegram/SourceFiles/dialogs/dialogs.style @@ -152,6 +152,9 @@ dialogsSentIconActive: icon {{ "dialogs_sent", dialogsSentIconFgActive, point(10 dialogsReceivedIcon: icon {{ "dialogs_received", dialogsSentIconFg, point(5px, 4px) }}; dialogsReceivedIconOver: icon {{ "dialogs_received", dialogsSentIconFgOver, point(5px, 4px) }}; dialogsReceivedIconActive: icon {{ "dialogs_received", dialogsSentIconFgActive, point(5px, 4px) }}; +dialogsPinnedIcon: icon {{ "dialogs_pinned", dialogsUnreadBgMuted }}; +dialogsPinnedIconOver: icon {{ "dialogs_pinned", dialogsUnreadBgMutedOver }}; +dialogsPinnedIconActive: icon {{ "dialogs_pinned", dialogsUnreadBgMutedActive }}; dialogsVerifiedIcon: icon { { "dialogs_verified_star", dialogsVerifiedIconBg, point(4px, 2px) }, diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index b4b2bf3cb2..067e281d6b 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -283,6 +283,10 @@ void RowPainter::paint(Painter &p, const Row *row, int fullWidth, bool active, b st.muted = history->mute(); paintUnreadCount(p, counter, unreadRight, unreadTop, st, &unreadWidth); availableWidth -= unreadWidth + st.padding; + } else if (history->isPinnedDialog()) { + auto &icon = (active ? st::dialogsPinnedIconActive : (selected ? st::dialogsPinnedIconOver : st::dialogsPinnedIcon)); + icon.paint(p, fullWidth - st::dialogsPadding.x() - icon.width(), texttop, fullWidth); + availableWidth -= icon.width() + st::dialogsUnreadPadding; } auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService); if (!history->paintSendAction(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) { diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index f7ebd587f6..e93f2826ed 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1129,7 +1129,7 @@ void DialogsInner::dialogsReceived(const QVector &added) { } App::main()->applyNotifySetting(MTP_notifyPeer(d.vpeer), d.vnotify_settings, history); - if (!history->lastMsgDate.isNull()) { + if (!history->isPinnedDialog() && !history->lastMsgDate.isNull()) { addSavedPeersAfter(history->lastMsgDate); } _contactsNoDialogs->del(peer); @@ -2058,14 +2058,14 @@ void DialogsWidget::notify_historyMuteUpdated(History *history) { void DialogsWidget::unreadCountsReceived(const QVector &dialogs) { } -void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpRequestId req) { - if (_dialogsRequest != req) return; +void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpRequestId requestId) { + if (_dialogsRequestId != requestId) return; const QVector *dialogsList = 0; const QVector *messagesList = 0; switch (dialogs.type()) { case mtpc_messages_dialogs: { - const auto &data(dialogs.c_messages_dialogs()); + auto &data = dialogs.c_messages_dialogs(); App::feedUsers(data.vusers); App::feedChats(data.vchats); messagesList = &data.vmessages.c_vector().v; @@ -2073,7 +2073,7 @@ void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpReque _dialogsFull = true; } break; case mtpc_messages_dialogsSlice: { - const auto &data(dialogs.c_messages_dialogsSlice()); + auto &data = dialogs.c_messages_dialogsSlice(); App::feedUsers(data.vusers); App::feedChats(data.vchats); messagesList = &data.vmessages.c_vector().v; @@ -2081,18 +2081,11 @@ void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpReque } break; } - if (!_contactsRequest) { - _contactsRequest = MTP::send(MTPcontacts_GetContacts(MTP_string("")), rpcDone(&DialogsWidget::contactsReceived), rpcFail(&DialogsWidget::contactsFailed)); + if (!cContactsReceived() && !_contactsRequestId) { + _contactsRequestId = MTP::send(MTPcontacts_GetContacts(MTP_string("")), rpcDone(&DialogsWidget::contactsReceived), rpcFail(&DialogsWidget::contactsFailed)); } - if (messagesList) { - App::feedMsgs(*messagesList, NewMessageLast); - } if (dialogsList) { - unreadCountsReceived(*dialogsList); - _inner->dialogsReceived(*dialogsList); - onListScroll(); - TimeId lastDate = 0; PeerId lastPeer = 0; MsgId lastMsgId = 0; @@ -2102,20 +2095,25 @@ void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpReque continue; } - if (auto peer = peerFromMTP(dialog.c_dialog().vpeer)) { - if (!lastPeer) lastPeer = peer; - if (auto msgId = dialog.c_dialog().vtop_message.v) { - if (!lastMsgId) lastMsgId = msgId; - for (int j = messagesList->size(); j > 0;) { - auto &message = messagesList->at(--j); - if (idFromMessage(message) == msgId && peerFromMessage(message) == peer) { - if (auto date = dateFromMessage(message)) { - lastDate = date; + auto &dialogData = dialog.c_dialog(); + if (auto peer = peerFromMTP(dialogData.vpeer)) { + auto history = App::history(peer); + history->setPinnedDialog(dialogData.is_pinned()); + + if (!lastDate) { + if (!lastPeer) lastPeer = peer; + if (auto msgId = dialogData.vtop_message.v) { + if (!lastMsgId) lastMsgId = msgId; + for (int j = messagesList->size(); j > 0;) { + auto &message = messagesList->at(--j); + if (idFromMessage(message) == msgId && peerFromMessage(message) == peer) { + if (auto date = dateFromMessage(message)) { + lastDate = date; + } + break; } - break; } } - if (lastDate) break; } } } @@ -2126,20 +2124,61 @@ void DialogsWidget::dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpReque } else { _dialogsFull = true; } + + t_assert(messagesList != nullptr); + App::feedMsgs(*messagesList, NewMessageLast); + + unreadCountsReceived(*dialogsList); + _inner->dialogsReceived(*dialogsList); + onListScroll(); } else { _dialogsFull = true; } - _dialogsRequest = 0; + _dialogsRequestId = 0; loadDialogs(); } -bool DialogsWidget::dialogsFailed(const RPCError &error, mtpRequestId req) { +void DialogsWidget::pinnedDialogsReceived(const MTPmessages_PeerDialogs &dialogs, mtpRequestId requestId) { + if (_pinnedDialogsRequestId != requestId) return; + + if (dialogs.type() == mtpc_messages_peerDialogs) { + App::histories().clearPinned(); + + auto &dialogsData = dialogs.c_messages_peerDialogs(); + App::feedUsers(dialogsData.vusers); + App::feedChats(dialogsData.vchats); + auto &list = dialogsData.vdialogs.c_vector().v; + for (auto i = list.size(); i > 0;) { + auto &dialog = list[--i]; + if (dialog.type() != mtpc_dialog) { + continue; + } + + auto &dialogData = dialog.c_dialog(); + if (auto peer = peerFromMTP(dialogData.vpeer)) { + auto history = App::history(peer); + history->setPinnedDialog(dialogData.is_pinned()); + } + } + App::feedMsgs(dialogsData.vmessages, NewMessageLast); + unreadCountsReceived(list); + _inner->dialogsReceived(list); + onListScroll(); + } + + _pinnedDialogsRequestId = 0; + _pinnedDialogsReceived = true; +} + +bool DialogsWidget::dialogsFailed(const RPCError &error, mtpRequestId requestId) { if (MTP::isDefaultHandledError(error)) return false; LOG(("RPC Error: %1 %2: %3").arg(error.code()).arg(error.type()).arg(error.description())); - if (_dialogsRequest == req) { - _dialogsRequest = 0; + if (_dialogsRequestId == requestId) { + _dialogsRequestId = 0; + } else if (_pinnedDialogsRequestId == requestId) { + _pinnedDialogsRequestId = 0; } return true; } @@ -2245,18 +2284,31 @@ void DialogsWidget::onSearchMore() { } void DialogsWidget::loadDialogs() { - if (_dialogsRequest) return; + if (_dialogsRequestId) return; if (_dialogsFull) { _inner->addAllSavedPeers(); cSetDialogsReceived(true); return; } - int32 loadCount = _dialogsOffsetDate ? DialogsPerPage : DialogsFirstLoad; - _dialogsRequest = MTP::send(MTPmessages_GetDialogs(MTP_int(_dialogsOffsetDate), MTP_int(_dialogsOffsetId), _dialogsOffsetPeer ? _dialogsOffsetPeer->input : MTP_inputPeerEmpty(), MTP_int(loadCount)), rpcDone(&DialogsWidget::dialogsReceived), rpcFail(&DialogsWidget::dialogsFailed)); + auto firstLoad = !_dialogsOffsetDate; + auto loadCount = firstLoad ? DialogsFirstLoad : DialogsPerPage; + auto flags = qFlags(MTPmessages_GetDialogs::Flag::f_exclude_pinned); + _dialogsRequestId = MTP::send(MTPmessages_GetDialogs(MTP_flags(flags), MTP_int(_dialogsOffsetDate), MTP_int(_dialogsOffsetId), _dialogsOffsetPeer ? _dialogsOffsetPeer->input : MTP_inputPeerEmpty(), MTP_int(loadCount)), rpcDone(&DialogsWidget::dialogsReceived), rpcFail(&DialogsWidget::dialogsFailed)); + if (!_pinnedDialogsReceived) { + loadPinnedDialogs(); + } +} + +void DialogsWidget::loadPinnedDialogs() { + if (_pinnedDialogsRequestId) return; + + _pinnedDialogsReceived = false; + _pinnedDialogsRequestId = MTP::send(MTPmessages_GetPinnedDialogs(), rpcDone(&DialogsWidget::pinnedDialogsReceived), rpcFail(&DialogsWidget::dialogsFailed)); } void DialogsWidget::contactsReceived(const MTPcontacts_Contacts &result) { + _contactsRequestId = 0; cSetContactsReceived(true); if (result.type() == mtpc_contacts_contacts) { auto &d = result.c_contacts_contacts(); @@ -2268,7 +2320,7 @@ void DialogsWidget::contactsReceived(const MTPcontacts_Contacts &result) { bool DialogsWidget::contactsFailed(const RPCError &error) { if (MTP::isDefaultHandledError(error)) return false; - + _contactsRequestId = 0; return true; } diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index 072a952937..bda714578b 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -280,6 +280,7 @@ public: void searchInPeer(PeerData *peer); void loadDialogs(); + void loadPinnedDialogs(); void createDialog(History *history); void dlgUpdated(Dialogs::Mode list, Dialogs::Row *row); void dlgUpdated(PeerData *peer, MsgId msgId); @@ -350,10 +351,11 @@ protected: private: void animationCallback(); - void dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpRequestId req); + void dialogsReceived(const MTPmessages_Dialogs &dialogs, mtpRequestId requestId); + void pinnedDialogsReceived(const MTPmessages_PeerDialogs &dialogs, mtpRequestId requestId); void contactsReceived(const MTPcontacts_Contacts &result); - void searchReceived(DialogsSearchRequestType type, const MTPmessages_Messages &result, mtpRequestId req); - void peerSearchReceived(const MTPcontacts_Found &result, mtpRequestId req); + void searchReceived(DialogsSearchRequestType type, const MTPmessages_Messages &result, mtpRequestId requestId); + void peerSearchReceived(const MTPcontacts_Found &result, mtpRequestId requestId); void setSearchInPeer(PeerData *peer); void showMainMenu(); @@ -375,8 +377,10 @@ private: int32 _dialogsOffsetDate = 0; MsgId _dialogsOffsetId = 0; PeerData *_dialogsOffsetPeer = nullptr; - mtpRequestId _dialogsRequest = 0; - mtpRequestId _contactsRequest = 0; + mtpRequestId _dialogsRequestId = 0; + mtpRequestId _pinnedDialogsRequestId = 0; + mtpRequestId _contactsRequestId = 0; + bool _pinnedDialogsReceived = false; ChildWidget _forwardCancel = { nullptr }; ChildWidget _mainMenuToggle; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 815e3af967..b897e28a4a 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -633,6 +633,7 @@ struct Data { int32 SavedGifsLimit = 200; int32 EditTimeLimit = 172800; int32 StickersRecentLimit = 30; + int32 PinnedDialogsCountMax = 5; HiddenPinnedMessagesMap HiddenPinnedMessages; @@ -751,6 +752,7 @@ DefineVar(Global, int32, PushChatLimit); DefineVar(Global, int32, SavedGifsLimit); DefineVar(Global, int32, EditTimeLimit); DefineVar(Global, int32, StickersRecentLimit); +DefineVar(Global, int32, PinnedDialogsCountMax); DefineVar(Global, HiddenPinnedMessagesMap, HiddenPinnedMessages); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index d1227e6821..c6001df711 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -328,6 +328,7 @@ DeclareVar(int32, PushChatLimit); DeclareVar(int32, SavedGifsLimit); DeclareVar(int32, EditTimeLimit); DeclareVar(int32, StickersRecentLimit); +DeclareVar(int32, PinnedDialogsCountMax); typedef QMap HiddenPinnedMessagesMap; DeclareVar(HiddenPinnedMessagesMap, HiddenPinnedMessages); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2109f059ce..97a93a2dc1 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -46,6 +46,8 @@ constexpr int kStatusShowClientsideChooseContact = 6000; constexpr int kStatusShowClientsidePlayGame = 10000; constexpr int kSetMyActionForMs = 10000; +auto GlobalPinnedIndex = 0; + } // namespace void historyInit() { @@ -203,12 +205,12 @@ bool History::updateSendActionNeedsAnimating(UserData *user, const MTPSendMessag case mtpc_sendMessageUploadDocumentAction: _sendActions.insert(user, { Type::UploadFile, ms + kStatusShowClientsideUploadFile, action.c_sendMessageUploadDocumentAction().vprogress.v }); break; case mtpc_sendMessageGeoLocationAction: _sendActions.insert(user, { Type::ChooseLocation, ms + kStatusShowClientsideChooseLocation }); break; case mtpc_sendMessageChooseContactAction: _sendActions.insert(user, { Type::ChooseContact, ms + kStatusShowClientsideChooseContact }); break; - //case mtpc_sendMessageGamePlayAction: { // TODO - // auto it = _sendActions.find(user); - // if (it == _sendActions.end() || it->type == Type::PlayGame || it->until <= ms) { - // _sendActions.insert(user, { Type::PlayGame, ms + kStatusShowClientsidePlayGame }); - // } - //} break; + case mtpc_sendMessageGamePlayAction: { + auto it = _sendActions.find(user); + if (it == _sendActions.end() || it->type == Type::PlayGame || it->until <= ms) { + _sendActions.insert(user, { Type::PlayGame, ms + kStatusShowClientsidePlayGame }); + } + } break; default: return false; } return updateSendActionNeedsAnimating(ms, true); @@ -622,8 +624,8 @@ History *Histories::findOrInsert(const PeerId &peerId, int32 unreadCount, int32 void Histories::clear() { App::historyClearMsgs(); - Map temp; - std::swap(temp, map); + _pinnedDialogs.clear(); + auto temp = base::take(map); for_const (auto history, temp) { delete history; } @@ -712,6 +714,32 @@ bool Histories::unreadOnlyMuted() const { return Global::IncludeMuted() ? (_unreadMuted >= _unreadFull) : false; } +void Histories::setIsPinned(History *history, bool isPinned) { + if (isPinned) { + _pinnedDialogs.insert(history); + if (_pinnedDialogs.size() > Global::PinnedDialogsCountMax()) { + auto minIndex = GlobalPinnedIndex + 1; + auto minIndexHistory = (History*)nullptr; + for_const (auto pinned, _pinnedDialogs) { + if (pinned->getPinnedIndex() < minIndex) { + minIndex = pinned->getPinnedIndex(); + minIndexHistory = pinned; + } + } + t_assert(minIndexHistory != nullptr); + minIndexHistory->setPinnedDialog(false); + } + } else { + _pinnedDialogs.remove(history); + } +} + +void Histories::clearPinned() { + for (auto pinned : base::take(_pinnedDialogs)) { + pinned->setPinnedDialog(false); + } +} + HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, bool detachExistingItem) { MsgId msgId = 0; switch (msg.type()) { @@ -779,7 +807,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, case mtpc_webPage: case mtpc_webPageEmpty: case mtpc_webPagePending: break; -// case mtpc_webPageNotModified: // TODO + case mtpc_webPageNotModified: default: badMedia = 1; break; } break; @@ -1810,6 +1838,10 @@ inline uint64 dialogPosFromDate(const QDateTime &date) { return (uint64(date.toTime_t()) << 32) | (++_dialogsPosToTopShift); } +inline uint64 pinnedDialogPos(int pinnedIndex) { + return 0xFFFFFFFF00000000ULL + pinnedIndex; +} + void History::setLastMessage(HistoryItem *msg) { if (msg) { if (!lastMsg) Local::removeSavedPeer(peer); @@ -1822,7 +1854,7 @@ void History::setLastMessage(HistoryItem *msg) { } bool History::needUpdateInChatList() const { - if (inChatList(Dialogs::Mode::All)) { + if (inChatList(Dialogs::Mode::All) || isPinnedDialog()) { return true; } else if (peer->migrateTo()) { return false; @@ -1831,9 +1863,8 @@ bool History::needUpdateInChatList() const { } void History::setChatsListDate(const QDateTime &date) { - bool updateDialog = needUpdateInChatList(); if (!lastMsgDate.isNull() && lastMsgDate >= date) { - if (!updateDialog || !inChatList(Dialogs::Mode::All)) { + if (!needUpdateInChatList() || !inChatList(Dialogs::Mode::All)) { return; } } @@ -1851,7 +1882,7 @@ void History::updateChatListSortPosition() { return lastMsgDate; }; - _sortKeyInChatList = dialogPosFromDate(chatListDate()); + _sortKeyInChatList = isPinnedDialog() ? pinnedDialogPos(_pinnedIndex) : dialogPosFromDate(chatListDate()); if (auto m = App::main()) { if (needUpdateInChatList()) { if (_sortKeyInChatList) { @@ -2071,6 +2102,20 @@ void History::updateChatListEntry() const { } } +void History::setPinnedDialog(bool isPinned) { + auto pinnedIndex = isPinned ? (++GlobalPinnedIndex) : 0; + if (_pinnedIndex != pinnedIndex) { + auto wasPinned = isPinnedDialog(); + _pinnedIndex = pinnedIndex; + updateChatListSortPosition(); + updateChatListEntry(); + if (wasPinned != isPinnedDialog()) { + Notify::peerUpdatedDelayed(peer, Notify::PeerUpdate::Flag::PinnedChanged); + } + App::histories().setIsPinned(this, isPinnedDialog()); + } +} + void History::overviewSliceDone(int32 overviewIndex, const MTPmessages_Messages &result, bool onlyCounts) { const QVector *v = 0; switch (result.type()) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 30da42bcac..0da6a9285d 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -82,6 +82,9 @@ public: } } + void setIsPinned(History *history, bool isPinned); + void clearPinned(); + struct SendActionAnimationUpdate { History *history; int width; @@ -93,8 +96,10 @@ public: } private: - int _unreadFull, _unreadMuted; + int _unreadFull = 0; + int _unreadMuted = 0; base::Observable _sendActionAnimationUpdated; + OrderedSet _pinnedDialogs; }; @@ -281,6 +286,14 @@ public: void addChatListEntryByLetter(Dialogs::Mode list, QChar letter, Dialogs::Row *row); void updateChatListEntry() const; + bool isPinnedDialog() const { + return (_pinnedIndex > 0); + } + void setPinnedDialog(bool isPinned); + int getPinnedIndex() const { + return _pinnedIndex; + } + MsgId minMsgId() const; MsgId maxMsgId() const; MsgId msgIdForRead() const; @@ -564,6 +577,7 @@ private: Ui::SendActionAnimation _sendActionAnimation; QMap _mySendActions; + int _pinnedIndex = 0; // > 0 for pinned dialogs }; diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index ddd616344e..fe55da9b2d 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -68,12 +68,14 @@ MediaOverviewType serviceMediaToOverviewType(HistoryMedia *media) { ApiWrap::RequestMessageDataCallback historyDependentItemCallback(const FullMsgId &msgId) { return [dependent = msgId](ChannelData *channel, MsgId msgId) { - if (HistoryItem *item = App::histItemById(dependent)) { + if (auto item = App::histItemById(dependent)) { item->updateDependencyItem(); } }; } +constexpr auto kPinnedMessageTextLimit = 16; + } // namespace void historyInitMessages() { @@ -687,7 +689,7 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media) { case mtpc_webPage: { _media.reset(new HistoryWebPage(this, App::feedWebPage(d.c_webPage()))); } break; -// case mtpc_webPageNotModified: LOG(("API Error: webPageNotModified is unexpected in message media.")); break; // TODO + case mtpc_webPageNotModified: LOG(("API Error: webPageNotModified is unexpected in message media.")); break; } } break; case mtpc_messageMediaGame: { @@ -1975,19 +1977,21 @@ bool HistoryService::preparePinnedText(const QString &from, QString *outText, Li } break; } if (mediaText.isEmpty()) { - QString original = pinned->msg->originalText().text; - int32 cutat = 0, limit = PinnedMessageTextLimit, size = original.size(); - for (; limit > 0;) { + auto original = pinned->msg->originalText().text; + auto cutAt = 0; + auto limit = kPinnedMessageTextLimit; + auto size = original.size(); + for (; limit != 0;) { --limit; - if (cutat >= size) break; - if (original.at(cutat).isLowSurrogate() && cutat + 1 < size && original.at(cutat + 1).isHighSurrogate()) { - cutat += 2; + if (cutAt >= size) break; + if (original.at(cutAt).isLowSurrogate() && cutAt + 1 < size && original.at(cutAt + 1).isHighSurrogate()) { + cutAt += 2; } else { - ++cutat; + ++cutAt; } } - if (!limit && cutat + 5 < size) { - original = original.mid(0, cutat) + qstr("..."); + if (!limit && cutAt + 5 < size) { + original = original.mid(0, cutAt) + qstr("..."); } text = lng_action_pinned_message(lt_from, from, lt_text, textcmdLink(2, original)); } else { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 16bffe1def..a667778148 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3456,7 +3456,7 @@ void HistoryWidget::updateSendAction(History *history, SendAction::Type type, in case Type::UploadFile: action = MTP_sendMessageUploadDocumentAction(MTP_int(progress)); break; case Type::ChooseLocation: action = MTP_sendMessageGeoLocationAction(); break; case Type::ChooseContact: action = MTP_sendMessageChooseContactAction(); break; - case Type::PlayGame: return;// action = MTP_sendMessageGamePlayAction(); break; // TODO + case Type::PlayGame: action = MTP_sendMessageGamePlayAction(); break; } _sendActionRequests.insert(qMakePair(history, type), MTP::send(MTPmessages_SetTyping(history->peer->input, action), rpcDone(&HistoryWidget::sendActionDone))); if (type == Type::Typing) _sendActionStopTimer.start(5000); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 006e2e0b3f..a29cd64f95 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -834,10 +834,11 @@ void MainWidget::deleteConversation(PeerData *peer, bool deleteHistory) { if (activePeer() == peer) { Ui::showChatsList(); } - if (History *h = App::historyLoaded(peer->id)) { - removeDialog(h); + if (auto history = App::historyLoaded(peer->id)) { + history->setPinnedDialog(false); + removeDialog(history); if (peer->isMegagroup() && peer->asChannel()->mgInfo->migrateFromPtr) { - if (History *migrated = App::historyLoaded(peer->asChannel()->mgInfo->migrateFromPtr->id)) { + if (auto migrated = App::historyLoaded(peer->asChannel()->mgInfo->migrateFromPtr->id)) { if (migrated->lastMsg) { // return initial dialog migrated->setLastMessage(migrated->lastMsg); } else { @@ -845,9 +846,9 @@ void MainWidget::deleteConversation(PeerData *peer, bool deleteHistory) { } } } - h->clear(); - h->newLoaded = true; - h->oldLoaded = deleteHistory; + history->clear(); + history->newLoaded = true; + history->oldLoaded = deleteHistory; } if (peer->isChannel()) { peer->asChannel()->ptsWaitingForShortPoll(-1); @@ -1149,10 +1150,10 @@ void executeParsedCommand(const QString &command) { return; } if (command == qsl("new_version_text")) { - App::wnd()->serviceNotification(langNewVersionText()); + App::wnd()->serviceNotificationLocal(langNewVersionText()); } else if (command == qsl("all_new_version_texts")) { for (int i = 0; i < languageCount; ++i) { - App::wnd()->serviceNotification(langNewVersionTextForLang(i)); + App::wnd()->serviceNotificationLocal(langNewVersionTextForLang(i)); } } } @@ -1795,15 +1796,14 @@ void MainWidget::dialogsCancelled() { _history->activate(); } -void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia &media) { +void MainWidget::serviceNotification(const TextWithEntities &message, const MTPMessageMedia &media, int32 date) { MTPDmessage::Flags flags = MTPDmessage::Flag::f_entities | MTPDmessage::Flag::f_from_id | MTPDmessage_ClientFlag::f_clientside_unread; - QString sendingText, leftText = msg; - EntitiesInText sendingEntities, leftEntities; - textParseEntities(leftText, _historyTextNoMonoOptions.flags, &leftEntities); - HistoryItem *item = 0; + QString sendingText, leftText = message.text; + EntitiesInText sendingEntities, leftEntities = message.entities; + HistoryItem *item = nullptr; while (textSplit(sendingText, sendingEntities, leftText, leftEntities, MaxMessageSize)) { MTPVector localEntities = linksToMTP(sendingEntities); - item = App::histories().addNewMessage(MTP_message(MTP_flags(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPnullFwdHeader, MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint(), MTPint()), NewMessageUnread); + item = App::histories().addNewMessage(MTP_message(MTP_flags(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPnullFwdHeader, MTPint(), MTPint(), MTP_int(date), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint(), MTPint()), NewMessageUnread); } if (item) { _history->peerMessagesUpdated(item->history()->peer->id); @@ -1990,6 +1990,32 @@ void MainWidget::scheduleViewIncrement(HistoryItem *item) { } void MainWidget::fillPeerMenu(PeerData *peer, base::lambda &&handler)> &&callback) { + auto isPinned = false; + if (auto history = App::historyLoaded(peer)) { + isPinned = history->isPinnedDialog(); + } + auto pinSubscription = MakeShared(); + auto pinAction = callback(lang(isPinned ? lng_context_unpin_from_top : lng_context_pin_to_top), [peer, pinSubscription] { + auto history = App::history(peer); + auto isPinned = !history->isPinnedDialog(); + history->setPinnedDialog(isPinned); + auto flags = MTPmessages_ToggleDialogPin::Flags(0); + if (isPinned) { + flags |= MTPmessages_ToggleDialogPin::Flag::f_pinned; + } + MTP::send(MTPmessages_ToggleDialogPin(MTP_flags(flags), peer->input)); + if (isPinned) { + if (auto main = App::main()) { + main->dialogsToUp(); + } + } + }); + auto pinChangedHandler = Notify::PeerUpdatedHandler(Notify::PeerUpdate::Flag::PinnedChanged, [pinAction, peer](const Notify::PeerUpdate &update) { + if (update.peer != peer) return; + pinAction->setText(lang(App::history(peer)->isPinnedDialog() ? lng_context_unpin_from_top : lng_context_pin_to_top)); + }); + *pinSubscription = Notify::PeerUpdated().add_subscription(std_::move(pinChangedHandler)); + callback(lang((peer->isChat() || peer->isMegagroup()) ? lng_context_view_group : (peer->isUser() ? lng_context_view_profile : lng_context_view_channel)), [peer] { Ui::showPeerProfile(peer); }); @@ -4734,6 +4760,10 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { auto &d = update.c_updateEncryptedMessagesRead(); } break; + case mtpc_updatePhoneCall: { + auto &d = update.c_updatePhoneCall(); + } break; + case mtpc_updateUserBlocked: { auto &d = update.c_updateUserBlocked(); if (auto user = App::userLoaded(d.vuser_id.v)) { @@ -4742,25 +4772,13 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } break; - case mtpc_updateNewAuthorization: { - auto &d = update.c_updateNewAuthorization(); - QDateTime datetime = date(d.vdate); - - QString name = App::self()->firstName; - QString day = langDayOfWeekFull(datetime.date()), date = langDayOfMonthFull(datetime.date()), time = datetime.time().toString(cTimeFormat()); - QString device = qs(d.vdevice), location = qs(d.vlocation); - LangString text = lng_new_authorization(lt_name, App::self()->firstName, lt_day, day, lt_date, date, lt_time, time, lt_device, device, lt_location, location); - App::wnd()->serviceNotification(text); - - emit App::wnd()->newAuthorization(); - } break; - case mtpc_updateServiceNotification: { auto &d = update.c_updateServiceNotification(); - if (mtpIsTrue(d.vpopup)) { + if (d.is_popup()) { Ui::showLayer(new InformBox(qs(d.vmessage))); } else { - App::wnd()->serviceNotification(qs(d.vmessage), d.vmedia); + App::wnd()->serviceNotification({ qs(d.vmessage), entitiesFromMTP(d.ventities.c_vector().v) }, d.vmedia); + emit App::wnd()->checkNewAuthorization(); } } break; @@ -4768,6 +4786,45 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { auto &d = update.c_updatePrivacy(); } break; + case mtpc_updatePinnedDialogs: { + auto &d = update.c_updatePinnedDialogs(); + if (d.has_order()) { + auto allLoaded = true; + auto &order = d.vorder.c_vector().v; + for_const (auto &peer, order) { + auto peerId = peerFromMTP(peer); + if (!App::historyLoaded(peerId)) { + allLoaded = false; + DEBUG_LOG(("API Error: pinned chat not loaded for peer %1").arg(peerId)); + break; + } + } + if (allLoaded) { + App::histories().clearPinned(); + for (auto i = order.size(); i != 0;) { + auto history = App::historyLoaded(peerFromMTP(order[--i])); + t_assert(history != nullptr); + history->setPinnedDialog(true); + } + } else { + _dialogs->loadPinnedDialogs(); + } + } else { + _dialogs->loadPinnedDialogs(); + } + } break; + + case mtpc_updateDialogPinned: { + auto &d = update.c_updateDialogPinned(); + auto peerId = peerFromMTP(d.vpeer); + if (auto history = App::historyLoaded(peerId)) { + history->setPinnedDialog(d.is_pinned()); + } else { + DEBUG_LOG(("API Error: pinned chat not loaded for peer %1").arg(peerId)); + _dialogs->loadPinnedDialogs(); + } + } break; + /////// Channel updates case mtpc_updateChannel: { auto &d = update.c_updateChannel(); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index abefb88558..f615320d60 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -309,7 +309,7 @@ public: void checkLastUpdate(bool afterSleep); - void serviceNotification(const QString &msg, const MTPMessageMedia &media); + void serviceNotification(const TextWithEntities &message, const MTPMessageMedia &media, int32 date); void serviceHistoryDone(const MTPmessages_Messages &msgs); bool serviceHistoryFail(const RPCError &error); diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 35ad197985..b96a60b05f 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -329,21 +329,26 @@ void MainWindow::setupIntro() { } } -void MainWindow::serviceNotification(const QString &msg, const MTPMessageMedia &media, bool force) { - History *h = (_main && App::userLoaded(ServiceUserId)) ? App::history(ServiceUserId) : 0; +void MainWindow::serviceNotification(const TextWithEntities &message, const MTPMessageMedia &media, int32 date, bool force) { + if (date <= 0) date = unixtime(); + auto h = (_main && App::userLoaded(ServiceUserId)) ? App::history(ServiceUserId) : nullptr; if (!h || (!force && h->isEmpty())) { - _delayedServiceMsgs.push_back(DelayedServiceMsg(msg, media)); + _delayedServiceMsgs.push_back(DelayedServiceMsg(message, media, date)); return sendServiceHistoryRequest(); } - _main->serviceNotification(msg, media); + _main->serviceNotification(message, media, date); +} + +void MainWindow::serviceNotificationLocal(QString text) { + EntitiesInText entities; + textParseEntities(text, _historyTextNoMonoOptions.flags, &entities); + serviceNotification({ text, entities }); } void MainWindow::showDelayedServiceMsgs() { - QVector toAdd = _delayedServiceMsgs; - _delayedServiceMsgs.clear(); - for (QVector::const_iterator i = toAdd.cbegin(), e = toAdd.cend(); i != e; ++i) { - serviceNotification(i->first, i->second, true); + for (auto &delayed : base::take(_delayedServiceMsgs)) { + serviceNotification(delayed.message, delayed.media, delayed.date, true); } } diff --git a/Telegram/SourceFiles/mainwindow.h b/Telegram/SourceFiles/mainwindow.h index c88924056a..b39e372bde 100644 --- a/Telegram/SourceFiles/mainwindow.h +++ b/Telegram/SourceFiles/mainwindow.h @@ -96,7 +96,8 @@ public: void checkAutoLockIn(int msec); void setupIntro(); void setupMain(const MTPUser *user = 0); - void serviceNotification(const QString &msg, const MTPMessageMedia &media = MTP_messageMediaEmpty(), bool force = false); + void serviceNotification(const TextWithEntities &message, const MTPMessageMedia &media = MTP_messageMediaEmpty(), int32 date = 0, bool force = false); + void serviceNotificationLocal(QString text); void sendServiceHistoryRequest(); void showDelayedServiceMsgs(); @@ -215,7 +216,7 @@ public slots: signals: void tempDirCleared(int task); void tempDirClearFailed(int task); - void newAuthorization(); + void checkNewAuthorization(); private slots: void onStateChanged(Qt::WindowState state); @@ -236,8 +237,14 @@ private: void placeSmallCounter(QImage &img, int size, int count, const style::color &bg, const QPoint &shift, const style::color &color) override; QImage icon16, icon32, icon64, iconbig16, iconbig32, iconbig64; - typedef QPair DelayedServiceMsg; - QVector _delayedServiceMsgs; + struct DelayedServiceMsg { + DelayedServiceMsg(const TextWithEntities &message, const MTPMessageMedia &media, int32 date) : message(message), media(media), date(date) { + } + TextWithEntities message; + MTPMessageMedia media; + int32 date; + }; + QList _delayedServiceMsgs; mtpRequestId _serviceHistoryRequest = 0; ChildWidget _passcode = { nullptr }; diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp index f15fd2fc46..03a17d72ab 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -145,45 +145,50 @@ void Dcenter::destroyKey() { } namespace { - ConfigLoader *_configLoader = nullptr; - bool loadingConfig = false; - void configLoaded(const MTPConfig &result) { - loadingConfig = false; - const auto &data(result.c_config()); +ConfigLoader *_configLoader = nullptr; +auto loadingConfig = false; - DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(mtpIsTrue(data.vtest_mode)).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size())); +void configLoaded(const MTPConfig &result) { + loadingConfig = false; - updateDcOptions(data.vdc_options.c_vector().v); + auto &data = result.c_config(); - Global::SetChatSizeMax(data.vchat_size_max.v); - Global::SetMegagroupSizeMax(data.vmegagroup_size_max.v); - Global::SetForwardedCountMax(data.vforwarded_count_max.v); - Global::SetOnlineUpdatePeriod(data.vonline_update_period_ms.v); - Global::SetOfflineBlurTimeout(data.voffline_blur_timeout_ms.v); - Global::SetOfflineIdleTimeout(data.voffline_idle_timeout_ms.v); - Global::SetOnlineCloudTimeout(data.vonline_cloud_timeout_ms.v); - Global::SetNotifyCloudDelay(data.vnotify_cloud_delay_ms.v); - Global::SetNotifyDefaultDelay(data.vnotify_default_delay_ms.v); - Global::SetChatBigSize(data.vchat_big_size.v); // ? - Global::SetPushChatPeriod(data.vpush_chat_period_ms.v); // ? - Global::SetPushChatLimit(data.vpush_chat_limit.v); // ? - Global::SetSavedGifsLimit(data.vsaved_gifs_limit.v); - Global::SetEditTimeLimit(data.vedit_time_limit.v); // ? - Global::SetStickersRecentLimit(data.vstickers_recent_limit.v); + DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(mtpIsTrue(data.vtest_mode)).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size())); - configLoadedOnce = true; - Local::writeSettings(); + updateDcOptions(data.vdc_options.c_vector().v); - configLoader()->done(); - } - bool configFailed(const RPCError &error) { - if (MTP::isDefaultHandledError(error)) return false; + Global::SetChatSizeMax(data.vchat_size_max.v); + Global::SetMegagroupSizeMax(data.vmegagroup_size_max.v); + Global::SetForwardedCountMax(data.vforwarded_count_max.v); + Global::SetOnlineUpdatePeriod(data.vonline_update_period_ms.v); + Global::SetOfflineBlurTimeout(data.voffline_blur_timeout_ms.v); + Global::SetOfflineIdleTimeout(data.voffline_idle_timeout_ms.v); + Global::SetOnlineCloudTimeout(data.vonline_cloud_timeout_ms.v); + Global::SetNotifyCloudDelay(data.vnotify_cloud_delay_ms.v); + Global::SetNotifyDefaultDelay(data.vnotify_default_delay_ms.v); + Global::SetChatBigSize(data.vchat_big_size.v); // ? + Global::SetPushChatPeriod(data.vpush_chat_period_ms.v); // ? + Global::SetPushChatLimit(data.vpush_chat_limit.v); // ? + Global::SetSavedGifsLimit(data.vsaved_gifs_limit.v); + Global::SetEditTimeLimit(data.vedit_time_limit.v); // ? + Global::SetStickersRecentLimit(data.vstickers_recent_limit.v); + Global::SetPinnedDialogsCountMax(data.vpinned_dialogs_count_max.v); + + configLoadedOnce = true; + Local::writeSettings(); + + configLoader()->done(); +} + +bool configFailed(const RPCError &error) { + if (MTP::isDefaultHandledError(error)) return false; + + loadingConfig = false; + LOG(("MTP Error: failed to get config!")); + return false; +} - loadingConfig = false; - LOG(("MTP Error: failed to get config!")); - return false; - } }; void updateDcOptions(const QVector &options) { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 3b41368458..6b7cbbc8eb 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -254,7 +254,7 @@ messageActionPinMessage#94bd38ed = MessageAction; messageActionHistoryClear#9fbab604 = MessageAction; messageActionGameScore#92a72876 game_id:long score:int = MessageAction; -dialog#66ffba14 flags:# peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog; +dialog#66ffba14 flags:# pinned:flags.2?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage = Dialog; photoEmpty#2331b22d id:long = Photo; photo#9288dd29 flags:# has_stickers:flags.0?true id:long access_hash:long date:int sizes:Vector = Photo; @@ -328,7 +328,7 @@ messages.messagesSlice#b446ae3 count:int messages:Vector chats:Vector chats:Vector users:Vector = messages.Messages; messages.chats#64ff9fd5 chats:Vector = messages.Chats; -messages.chatsSlice#78f69146 count:int chats:Vector users:Vector = messages.Chats; +messages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats; messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull; @@ -357,7 +357,6 @@ updateUserName#a7332b73 user_id:int first_name:string last_name:string username: updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update; updateContactRegistered#2575bbb9 user_id:int date:int = Update; updateContactLink#9d2e67c5 user_id:int my_link:ContactLink foreign_link:ContactLink = Update; -updateNewAuthorization#8f06529a auth_key_id:long date:int device:string location:string = Update; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; updateEncryptedChatTyping#1710f156 chat_id:int = Update; updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update; @@ -367,7 +366,7 @@ updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Updat updateDcOptions#8e5e9873 dc_options:Vector = Update; updateUserBlocked#80ece81a user_id:int blocked:Bool = Update; updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update; -updateServiceNotification#382dd3e4 type:string message:string media:MessageMedia popup:Bool = Update; +updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update; updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; updateUserPhone#12b9417b user_id:int phone:string = Update; updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update; @@ -400,6 +399,9 @@ updateRecentStickers#9a422c20 = Update; updateConfig#a229dd06 = Update; updatePtsChanged#3354678f = Update; updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update; +updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; +updateDialogPinned#d711a2cc flags:# pinned:flags.0?true peer:Peer = Update; +updatePinnedDialogs#d8caf68d flags:# order:flags.0?Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -425,7 +427,7 @@ upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true id:int ip_address:string port:int = DcOption; -config#9a6b2e2a flags:# date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int tmp_sessions:flags.0?int disabled_features:Vector = Config; +config#3af6fb5f flags:# phonecalls_enabled:flags.1?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int rating_e_decay:int stickers_recent_limit:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int disabled_features:Vector = Config; nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc; @@ -482,14 +484,17 @@ sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction; sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction; sendMessageGeoLocationAction#176f8ba1 = SendMessageAction; sendMessageChooseContactAction#628cbc6f = SendMessageAction; +sendMessageGamePlayAction#dd6a8f48 = SendMessageAction; contacts.found#1aa1f784 results:Vector chats:Vector users:Vector = contacts.Found; inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey; +inputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey; privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; privacyKeyChatInvite#500e6dfa = PrivacyKey; +privacyKeyPhoneCall#3d662b7b = PrivacyKey; inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule; inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule; @@ -536,7 +541,8 @@ 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; +webPage#5f07b4bc flags:# id:long url:string display_url:string hash:int 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 cached_page:flags.10?Page = WebPage; +webPageNotModified#85849473 = 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; @@ -587,7 +593,7 @@ replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true replyInlineMarkup#48a30254 rows:Vector = ReplyMarkup; help.appChangelogEmpty#af7e0394 = help.AppChangelog; -help.appChangelog#4668e6bd text:string = help.AppChangelog; +help.appChangelog#2a137e7c message:string media:MessageMedia entities:Vector = help.AppChangelog; messageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity; messageEntityMention#fa04579d offset:int length:int = MessageEntity; @@ -737,6 +743,61 @@ highScore#58fffcd0 pos:int user_id:int score:int = HighScore; messages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores; +textEmpty#dc3d824f = RichText; +textPlain#744694e0 text:string = RichText; +textBold#6724abc4 text:RichText = RichText; +textItalic#d912a59c text:RichText = RichText; +textUnderline#c12622c4 text:RichText = RichText; +textStrike#9bf8bb95 text:RichText = RichText; +textFixed#6c3f19b9 text:RichText = RichText; +textUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText; +textEmail#de5a0dd6 text:RichText email:string = RichText; +textConcat#7e6260d7 texts:Vector = RichText; + +pageBlockUnsupported#13567e8a = PageBlock; +pageBlockTitle#70abc3fd text:RichText = PageBlock; +pageBlockSubtitle#8ffa9a1f text:RichText = PageBlock; +pageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock; +pageBlockHeader#bfd064ec text:RichText = PageBlock; +pageBlockSubheader#f12bb6e1 text:RichText = PageBlock; +pageBlockParagraph#467a0766 text:RichText = PageBlock; +pageBlockPreformatted#c070d93e text:RichText language:string = PageBlock; +pageBlockFooter#48870999 text:RichText = PageBlock; +pageBlockDivider#db20b188 = PageBlock; +pageBlockAnchor#ce0d37b0 name:string = PageBlock; +pageBlockList#3a58c7f4 ordered:Bool items:Vector = PageBlock; +pageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock; +pageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock; +pageBlockPhoto#e9c69982 photo_id:long caption:RichText = PageBlock; +pageBlockVideo#d9d71866 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:RichText = PageBlock; +pageBlockCover#39f23300 cover:PageBlock = PageBlock; +pageBlockEmbed#cde200d1 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:int h:int caption:RichText = PageBlock; +pageBlockEmbedPost#292c7be9 url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:RichText = PageBlock; +pageBlockCollage#8b31c4f items:Vector caption:RichText = PageBlock; +pageBlockSlideshow#130c8963 items:Vector caption:RichText = PageBlock; + +pagePart#8dee6c44 blocks:Vector photos:Vector videos:Vector = Page; +pageFull#d7a19d69 blocks:Vector photos:Vector videos:Vector = Page; + +inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; + +phoneCallEmpty#5366c915 id:long = PhoneCall; +phoneCallWaiting#1b8f4ad1 flags:# id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; +phoneCallRequested#6c448ae8 id:long access_hash:long date:int admin_id:int participant_id:int g_a:bytes protocol:PhoneCallProtocol = PhoneCall; +phoneCall#ffe6ab67 id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connection:PhoneConnection alternative_connections:Vector start_date:int = PhoneCall; +phoneCallDiscarded#50ca4de1 flags:# id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; + +phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; + +phoneCallProtocol#a2bb35cb flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int = PhoneCallProtocol; + +phone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall; + +phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason; +phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason; +phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason; +phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -809,7 +870,7 @@ contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags. contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; messages.getMessages#4222fa74 id:Vector = messages.Messages; -messages.getDialogs#6b47f94d offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs; +messages.getDialogs#191ba9c5 flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs; messages.getHistory#afa92846 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.search#d4569248 flags:# peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages; messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; @@ -880,12 +941,16 @@ messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool; messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers; messages.getMaskStickers#65b8c79f hash:int = messages.AllStickers; messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector; -messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true peer:InputPeer id:int user_id:InputUser score:int = Updates; -messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool; +messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates; +messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool; messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores; messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores; messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats; messages.getAllChats#eba80ff0 except_ids:Vector = messages.Chats; +messages.getWebPage#32ca8f91 url:string hash:int = WebPage; +messages.toggleDialogPin#3289be6a flags:# pinned:flags.0?true peer:InputPeer = Bool; +messages.reorderPinnedDialogs#959ff644 flags:# force:flags.0?true order:Vector = Bool; +messages.getPinnedDialogs#e254d64e = messages.PeerDialogs; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -938,4 +1003,9 @@ channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates; channels.getAdminedPublicChannels#8d8d82d7 = messages.Chats; -// LAYER 58 +phone.requestCall#a41aa5e4 user_id:InputUser random_id:int g_a:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +phone.acceptCall#220f0b20 peer:InputPhoneCall g_b:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall; +phone.discardCall#5dfbcddc peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Bool; +phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; + +// LAYER 61 diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp index f215742194..7f2d96e72f 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -1714,14 +1714,15 @@ void _serialize_dialog(MTPStringLogger &to, int32 stage, int32 lev, Types &types } 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" top_message: "); ++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(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" read_outbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" pts: "); ++stages.back(); if (flag & MTPDdialog::Flag::f_pts) { types.push_back(mtpc_int+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 8: to.add(" draft: "); ++stages.back(); if (flag & MTPDdialog::Flag::f_draft) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 1: to.add(" pinned: "); ++stages.back(); if (flag & MTPDdialog::Flag::f_pinned) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 2: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" read_outbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" pts: "); ++stages.back(); if (flag & MTPDdialog::Flag::f_pts) { types.push_back(mtpc_int+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 9: to.add(" draft: "); ++stages.back(); if (flag & MTPDdialog::Flag::f_draft) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2306,7 +2307,6 @@ void _serialize_messages_chatsSlice(MTPStringLogger &to, int32 stage, int32 lev, switch (stage) { case 0: to.add(" count: "); ++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(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" users: "); ++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; } } @@ -2546,22 +2546,6 @@ void _serialize_updateContactLink(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_updateNewAuthorization(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("{ updateNewAuthorization"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" auth_key_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(" date: "); ++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(" device: "); ++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(" location: "); ++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_updateNewEncryptedMessage(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); @@ -2692,6 +2676,8 @@ void _serialize_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev } void _serialize_updateServiceNotification(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateServiceNotification::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2699,10 +2685,13 @@ void _serialize_updateServiceNotification(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" popup: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" popup: "); ++stages.back(); if (flag & MTPDupdateServiceNotification::Flag::f_popup) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" inbox_date: "); ++stages.back(); if (flag & MTPDupdateServiceNotification::Flag::f_inbox_date) { types.push_back(mtpc_int+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 3: 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 4: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" entities: "); ++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; } } @@ -3143,6 +3132,52 @@ void _serialize_updateChannelWebPage(MTPStringLogger &to, int32 stage, int32 lev } } +void _serialize_updatePhoneCall(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("{ updatePhoneCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" phone_call: "); ++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_updateDialogPinned(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateDialogPinned::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateDialogPinned"); + 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(" pinned: "); ++stages.back(); if (flag & MTPDupdateDialogPinned::Flag::f_pinned) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" peer: "); ++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_updatePinnedDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdatePinnedDialogs::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updatePinnedDialogs"); + 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(" order: "); ++stages.back(); if (flag & MTPDupdatePinnedDialogs::Flag::f_order) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_updates_state(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -3447,29 +3482,35 @@ void _serialize_config(MTPStringLogger &to, int32 stage, int32 lev, Types &types } 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(" date: "); ++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(" expires: "); ++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(" test_mode: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" dc_options: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" chat_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" megagroup_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" forwarded_count_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" online_update_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" offline_blur_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" offline_idle_timeout_ms: "); ++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(" online_cloud_timeout_ms: "); ++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(" notify_cloud_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: to.add(" notify_default_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" chat_big_size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" push_chat_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: to.add(" push_chat_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 18: to.add(" saved_gifs_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 19: to.add(" edit_time_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 20: to.add(" rating_e_decay: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 21: to.add(" stickers_recent_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 22: to.add(" tmp_sessions: "); ++stages.back(); if (flag & MTPDconfig::Flag::f_tmp_sessions) { types.push_back(mtpc_int+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 23: to.add(" disabled_features: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phonecalls_enabled: "); ++stages.back(); if (flag & MTPDconfig::Flag::f_phonecalls_enabled) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 2: to.add(" date: "); ++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(" expires: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" test_mode: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" dc_options: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" chat_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" megagroup_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" forwarded_count_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" online_update_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" offline_blur_timeout_ms: "); ++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(" offline_idle_timeout_ms: "); ++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(" online_cloud_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 14: to.add(" notify_cloud_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 15: to.add(" notify_default_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" chat_big_size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 17: to.add(" push_chat_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 18: to.add(" push_chat_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 19: to.add(" saved_gifs_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 20: to.add(" edit_time_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 21: to.add(" rating_e_decay: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 22: to.add(" stickers_recent_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 23: to.add(" tmp_sessions: "); ++stages.back(); if (flag & MTPDconfig::Flag::f_tmp_sessions) { types.push_back(mtpc_int+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 24: to.add(" pinned_dialogs_count_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 25: to.add(" call_receive_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 26: to.add(" call_ring_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 27: to.add(" call_connect_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 28: to.add(" call_packet_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 29: to.add(" disabled_features: "); ++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; } } @@ -3942,6 +3983,10 @@ void _serialize_sendMessageChooseContactAction(MTPStringLogger &to, int32 stage, to.add("{ sendMessageChooseContactAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } +void _serialize_sendMessageGamePlayAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ sendMessageGamePlayAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_contacts_found(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); @@ -3965,6 +4010,10 @@ void _serialize_inputPrivacyKeyChatInvite(MTPStringLogger &to, int32 stage, int3 to.add("{ inputPrivacyKeyChatInvite }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } +void _serialize_inputPrivacyKeyPhoneCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ inputPrivacyKeyPhoneCall }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_privacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyKeyStatusTimestamp }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -3973,6 +4022,10 @@ void _serialize_privacyKeyChatInvite(MTPStringLogger &to, int32 stage, int32 lev to.add("{ privacyKeyChatInvite }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } +void _serialize_privacyKeyPhoneCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ privacyKeyPhoneCall }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_inputPrivacyValueAllowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyValueAllowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -4308,22 +4361,28 @@ void _serialize_webPage(MTPStringLogger &to, int32 stage, int32 lev, Types &type case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" url: "); ++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(" display_url: "); ++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(" type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_type) { types.push_back(mtpc_string+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(" site_name: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_site_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 6: to.add(" title: "); ++stages.back(); if (flag & MTPDwebPage::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 2 IN FIELD flags ]"); } break; - case 7: to.add(" description: "); ++stages.back(); if (flag & MTPDwebPage::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 3 IN FIELD flags ]"); } break; - case 8: to.add(" photo: "); ++stages.back(); if (flag & MTPDwebPage::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 4 IN FIELD flags ]"); } break; - case 9: to.add(" embed_url: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_url) { types.push_back(mtpc_string+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 10: to.add(" embed_type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_type) { types.push_back(mtpc_string+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 11: to.add(" embed_width: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_width) { types.push_back(mtpc_int+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 12: to.add(" embed_height: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_height) { types.push_back(mtpc_int+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 13: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; - case 14: to.add(" author: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_author) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; - case 15: to.add(" document: "); ++stages.back(); if (flag & MTPDwebPage::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 9 IN FIELD flags ]"); } break; + case 4: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_type) { types.push_back(mtpc_string+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 6: to.add(" site_name: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_site_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 7: to.add(" title: "); ++stages.back(); if (flag & MTPDwebPage::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 2 IN FIELD flags ]"); } break; + case 8: to.add(" description: "); ++stages.back(); if (flag & MTPDwebPage::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 3 IN FIELD flags ]"); } break; + case 9: to.add(" photo: "); ++stages.back(); if (flag & MTPDwebPage::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 4 IN FIELD flags ]"); } break; + case 10: to.add(" embed_url: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_url) { types.push_back(mtpc_string+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 11: to.add(" embed_type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_type) { types.push_back(mtpc_string+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 12: to.add(" embed_width: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_width) { types.push_back(mtpc_int+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 13: to.add(" embed_height: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_height) { types.push_back(mtpc_int+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 14: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 15: to.add(" author: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_author) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 16: to.add(" document: "); ++stages.back(); if (flag & MTPDwebPage::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 9 IN FIELD flags ]"); } break; + case 17: to.add(" cached_page: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_cached_page) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } +void _serialize_webPageNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ webPageNotModified }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_authorization(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); @@ -4793,7 +4852,9 @@ void _serialize_help_appChangelog(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" text: "); ++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(" message: "); ++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(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" entities: "); ++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; } } @@ -6177,6 +6238,620 @@ void _serialize_messages_highScores(MTPStringLogger &to, int32 stage, int32 lev, } } +void _serialize_textEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ textEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_textPlain(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("{ textPlain"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textBold(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("{ textBold"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textItalic(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("{ textItalic"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textUnderline(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("{ textUnderline"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textStrike(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("{ textStrike"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textFixed(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("{ textFixed"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_textUrl(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("{ textUrl"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(0); 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+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" webpage_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_textEmail(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("{ textEmail"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" email: "); ++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_textConcat(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("{ textConcat"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" texts: "); ++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_pageBlockUnsupported(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ pageBlockUnsupported }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_pageBlockTitle(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("{ pageBlockTitle"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockSubtitle(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("{ pageBlockSubtitle"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockAuthorDate(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("{ pageBlockAuthorDate"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" author: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" published_date: "); ++stages.back(); types.push_back(mtpc_int+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_pageBlockHeader(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("{ pageBlockHeader"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockSubheader(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("{ pageBlockSubheader"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockParagraph(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("{ pageBlockParagraph"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockPreformatted(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("{ pageBlockPreformatted"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" language: "); ++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_pageBlockFooter(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("{ pageBlockFooter"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++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_pageBlockDivider(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ pageBlockDivider }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_pageBlockAnchor(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("{ pageBlockAnchor"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" 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_pageBlockList(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("{ pageBlockList"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" ordered: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" items: "); ++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_pageBlockBlockquote(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("{ pageBlockBlockquote"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++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_pageBlockPullquote(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("{ pageBlockPullquote"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++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_pageBlockPhoto(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("{ pageBlockPhoto"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" photo_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(" caption: "); ++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_pageBlockVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDpageBlockVideo::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ pageBlockVideo"); + 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(" autoplay: "); ++stages.back(); if (flag & MTPDpageBlockVideo::Flag::f_autoplay) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" loop: "); ++stages.back(); if (flag & MTPDpageBlockVideo::Flag::f_loop) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" video_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" caption: "); ++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_pageBlockCover(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("{ pageBlockCover"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" cover: "); ++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_pageBlockEmbed(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDpageBlockEmbed::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ pageBlockEmbed"); + 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(" full_width: "); ++stages.back(); if (flag & MTPDpageBlockEmbed::Flag::f_full_width) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" allow_scrolling: "); ++stages.back(); if (flag & MTPDpageBlockEmbed::Flag::f_allow_scrolling) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 3: to.add(" url: "); ++stages.back(); if (flag & MTPDpageBlockEmbed::Flag::f_url) { 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(" html: "); ++stages.back(); if (flag & MTPDpageBlockEmbed::Flag::f_html) { 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(" poster_photo_id: "); ++stages.back(); if (flag & MTPDpageBlockEmbed::Flag::f_poster_photo_id) { types.push_back(mtpc_long+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 6: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" caption: "); ++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_pageBlockEmbedPost(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("{ pageBlockEmbedPost"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" url: "); ++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(" webpage_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(" author_photo_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" author: "); ++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(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" blocks: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" caption: "); ++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_pageBlockCollage(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("{ pageBlockCollage"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" items: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++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_pageBlockSlideshow(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("{ pageBlockSlideshow"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" items: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++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_pagePart(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("{ pagePart"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" blocks: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" photos: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" videos: "); ++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_pageFull(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("{ pageFull"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" blocks: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" photos: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" videos: "); ++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_inputPhoneCall(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("{ inputPhoneCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phoneCallEmpty(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("{ phoneCallEmpty"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phoneCallWaiting(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDphoneCallWaiting::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ phoneCallWaiting"); + 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_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" protocol: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" receive_date: "); ++stages.back(); if (flag & MTPDphoneCallWaiting::Flag::f_receive_date) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phoneCallRequested(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("{ phoneCallRequested"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++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(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" protocol: "); ++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_phoneCall(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("{ phoneCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++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(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" g_a_or_b: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" protocol: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" connection: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" alternative_connections: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" start_date: "); ++stages.back(); types.push_back(mtpc_int+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_phoneCallDiscarded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDphoneCallDiscarded::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ phoneCallDiscarded"); + 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_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" reason: "); ++stages.back(); if (flag & MTPDphoneCallDiscarded::Flag::f_reason) { 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(" duration: "); ++stages.back(); if (flag & MTPDphoneCallDiscarded::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phoneConnection(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("{ phoneConnection"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" ip: "); ++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(" ipv6: "); ++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(" port: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" peer_tag: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phoneCallProtocol(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDphoneCallProtocol::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ phoneCallProtocol"); + 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(" udp_p2p: "); ++stages.back(); if (flag & MTPDphoneCallProtocol::Flag::f_udp_p2p) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" udp_reflector: "); ++stages.back(); if (flag & MTPDphoneCallProtocol::Flag::f_udp_reflector) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" min_layer: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" max_layer: "); ++stages.back(); types.push_back(mtpc_int+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_phone_phoneCall(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("{ phone_phoneCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" phone_call: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" users: "); ++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_phoneCallDiscardReasonMissed(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ phoneCallDiscardReasonMissed }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_phoneCallDiscardReasonDisconnect(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ phoneCallDiscardReasonDisconnect }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_phoneCallDiscardReasonHangup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ phoneCallDiscardReasonHangup }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_phoneCallDiscardReasonBusy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ phoneCallDiscardReasonBusy }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6871,9 +7546,44 @@ void _serialize_messages_setInlineGameScore(MTPStringLogger &to, int32 stage, in 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(" edit_message: "); ++stages.back(); if (flag & MTPmessages_setInlineGameScore::Flag::f_edit_message) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" score: "); ++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(" force: "); ++stages.back(); if (flag & MTPmessages_setInlineGameScore::Flag::f_force) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" score: "); ++stages.back(); types.push_back(mtpc_int+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_toggleDialogPin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_toggleDialogPin::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_toggleDialogPin"); + 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(" pinned: "); ++stages.back(); if (flag & MTPmessages_toggleDialogPin::Flag::f_pinned) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" peer: "); ++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_reorderPinnedDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_reorderPinnedDialogs::Flags flag(iflag); + + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_reorderPinnedDialogs"); + 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(" force: "); ++stages.back(); if (flag & MTPmessages_reorderPinnedDialogs::Flag::f_force) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" order: "); ++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; } } @@ -7007,6 +7717,35 @@ void _serialize_channels_updateUsername(MTPStringLogger &to, int32 stage, int32 } } +void _serialize_phone_discardCall(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("{ phone_discardCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" duration: "); ++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(" reason: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" connection_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_phone_receivedCall(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("{ phone_receivedCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++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_invokeAfterMsg(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); @@ -7634,6 +8373,8 @@ void _serialize_channels_getMessages(MTPStringLogger &to, int32 stage, int32 lev } void _serialize_messages_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_getDialogs::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7641,10 +8382,12 @@ void _serialize_messages_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset_date: "); ++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(" offset_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(" offset_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+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(" exclude_pinned: "); ++stages.back(); if (flag & MTPmessages_getDialogs::Flag::f_exclude_pinned) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" offset_date: "); ++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(" offset_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" offset_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+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; } } @@ -8020,10 +8763,11 @@ void _serialize_messages_setGameScore(MTPStringLogger &to, int32 stage, int32 le 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(" edit_message: "); ++stages.back(); if (flag & MTPmessages_setGameScore::Flag::f_edit_message) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: 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 4: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" score: "); ++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(" force: "); ++stages.back(); if (flag & MTPmessages_setGameScore::Flag::f_force) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: 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 5: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" score: "); ++stages.back(); types.push_back(mtpc_int+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; } } @@ -8630,6 +9374,10 @@ void _serialize_messages_getPeerDialogs(MTPStringLogger &to, int32 stage, int32 } } +void _serialize_messages_getPinnedDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ messages_getPinnedDialogs }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_messages_getFeaturedStickers(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); @@ -8720,6 +9468,20 @@ void _serialize_messages_getInlineGameHighScores(MTPStringLogger &to, int32 stag } } +void _serialize_messages_getWebPage(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("{ messages_getWebPage"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" url: "); ++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(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_updates_getState(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -8892,6 +9654,38 @@ void _serialize_channels_exportMessageLink(MTPStringLogger &to, int32 stage, int } } +void _serialize_phone_requestCall(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("{ phone_requestCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_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(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" protocol: "); ++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_phone_acceptCall(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("{ phone_acceptCall"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" g_b: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" protocol: "); ++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_rpc_result(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); @@ -9147,7 +9941,6 @@ namespace { _serializers.insert(mtpc_updateUserPhoto, _serialize_updateUserPhoto); _serializers.insert(mtpc_updateContactRegistered, _serialize_updateContactRegistered); _serializers.insert(mtpc_updateContactLink, _serialize_updateContactLink); - _serializers.insert(mtpc_updateNewAuthorization, _serialize_updateNewAuthorization); _serializers.insert(mtpc_updateNewEncryptedMessage, _serialize_updateNewEncryptedMessage); _serializers.insert(mtpc_updateEncryptedChatTyping, _serialize_updateEncryptedChatTyping); _serializers.insert(mtpc_updateEncryption, _serialize_updateEncryption); @@ -9190,6 +9983,9 @@ namespace { _serializers.insert(mtpc_updateConfig, _serialize_updateConfig); _serializers.insert(mtpc_updatePtsChanged, _serialize_updatePtsChanged); _serializers.insert(mtpc_updateChannelWebPage, _serialize_updateChannelWebPage); + _serializers.insert(mtpc_updatePhoneCall, _serialize_updatePhoneCall); + _serializers.insert(mtpc_updateDialogPinned, _serialize_updateDialogPinned); + _serializers.insert(mtpc_updatePinnedDialogs, _serialize_updatePinnedDialogs); _serializers.insert(mtpc_updates_state, _serialize_updates_state); _serializers.insert(mtpc_updates_differenceEmpty, _serialize_updates_differenceEmpty); _serializers.insert(mtpc_updates_difference, _serialize_updates_difference); @@ -9249,11 +10045,14 @@ namespace { _serializers.insert(mtpc_sendMessageUploadDocumentAction, _serialize_sendMessageUploadDocumentAction); _serializers.insert(mtpc_sendMessageGeoLocationAction, _serialize_sendMessageGeoLocationAction); _serializers.insert(mtpc_sendMessageChooseContactAction, _serialize_sendMessageChooseContactAction); + _serializers.insert(mtpc_sendMessageGamePlayAction, _serialize_sendMessageGamePlayAction); _serializers.insert(mtpc_contacts_found, _serialize_contacts_found); _serializers.insert(mtpc_inputPrivacyKeyStatusTimestamp, _serialize_inputPrivacyKeyStatusTimestamp); _serializers.insert(mtpc_inputPrivacyKeyChatInvite, _serialize_inputPrivacyKeyChatInvite); + _serializers.insert(mtpc_inputPrivacyKeyPhoneCall, _serialize_inputPrivacyKeyPhoneCall); _serializers.insert(mtpc_privacyKeyStatusTimestamp, _serialize_privacyKeyStatusTimestamp); _serializers.insert(mtpc_privacyKeyChatInvite, _serialize_privacyKeyChatInvite); + _serializers.insert(mtpc_privacyKeyPhoneCall, _serialize_privacyKeyPhoneCall); _serializers.insert(mtpc_inputPrivacyValueAllowContacts, _serialize_inputPrivacyValueAllowContacts); _serializers.insert(mtpc_inputPrivacyValueAllowAll, _serialize_inputPrivacyValueAllowAll); _serializers.insert(mtpc_inputPrivacyValueAllowUsers, _serialize_inputPrivacyValueAllowUsers); @@ -9289,6 +10088,7 @@ namespace { _serializers.insert(mtpc_webPageEmpty, _serialize_webPageEmpty); _serializers.insert(mtpc_webPagePending, _serialize_webPagePending); _serializers.insert(mtpc_webPage, _serialize_webPage); + _serializers.insert(mtpc_webPageNotModified, _serialize_webPageNotModified); _serializers.insert(mtpc_authorization, _serialize_authorization); _serializers.insert(mtpc_account_authorizations, _serialize_account_authorizations); _serializers.insert(mtpc_account_noPassword, _serialize_account_noPassword); @@ -9425,6 +10225,52 @@ namespace { _serializers.insert(mtpc_inputGameShortName, _serialize_inputGameShortName); _serializers.insert(mtpc_highScore, _serialize_highScore); _serializers.insert(mtpc_messages_highScores, _serialize_messages_highScores); + _serializers.insert(mtpc_textEmpty, _serialize_textEmpty); + _serializers.insert(mtpc_textPlain, _serialize_textPlain); + _serializers.insert(mtpc_textBold, _serialize_textBold); + _serializers.insert(mtpc_textItalic, _serialize_textItalic); + _serializers.insert(mtpc_textUnderline, _serialize_textUnderline); + _serializers.insert(mtpc_textStrike, _serialize_textStrike); + _serializers.insert(mtpc_textFixed, _serialize_textFixed); + _serializers.insert(mtpc_textUrl, _serialize_textUrl); + _serializers.insert(mtpc_textEmail, _serialize_textEmail); + _serializers.insert(mtpc_textConcat, _serialize_textConcat); + _serializers.insert(mtpc_pageBlockUnsupported, _serialize_pageBlockUnsupported); + _serializers.insert(mtpc_pageBlockTitle, _serialize_pageBlockTitle); + _serializers.insert(mtpc_pageBlockSubtitle, _serialize_pageBlockSubtitle); + _serializers.insert(mtpc_pageBlockAuthorDate, _serialize_pageBlockAuthorDate); + _serializers.insert(mtpc_pageBlockHeader, _serialize_pageBlockHeader); + _serializers.insert(mtpc_pageBlockSubheader, _serialize_pageBlockSubheader); + _serializers.insert(mtpc_pageBlockParagraph, _serialize_pageBlockParagraph); + _serializers.insert(mtpc_pageBlockPreformatted, _serialize_pageBlockPreformatted); + _serializers.insert(mtpc_pageBlockFooter, _serialize_pageBlockFooter); + _serializers.insert(mtpc_pageBlockDivider, _serialize_pageBlockDivider); + _serializers.insert(mtpc_pageBlockAnchor, _serialize_pageBlockAnchor); + _serializers.insert(mtpc_pageBlockList, _serialize_pageBlockList); + _serializers.insert(mtpc_pageBlockBlockquote, _serialize_pageBlockBlockquote); + _serializers.insert(mtpc_pageBlockPullquote, _serialize_pageBlockPullquote); + _serializers.insert(mtpc_pageBlockPhoto, _serialize_pageBlockPhoto); + _serializers.insert(mtpc_pageBlockVideo, _serialize_pageBlockVideo); + _serializers.insert(mtpc_pageBlockCover, _serialize_pageBlockCover); + _serializers.insert(mtpc_pageBlockEmbed, _serialize_pageBlockEmbed); + _serializers.insert(mtpc_pageBlockEmbedPost, _serialize_pageBlockEmbedPost); + _serializers.insert(mtpc_pageBlockCollage, _serialize_pageBlockCollage); + _serializers.insert(mtpc_pageBlockSlideshow, _serialize_pageBlockSlideshow); + _serializers.insert(mtpc_pagePart, _serialize_pagePart); + _serializers.insert(mtpc_pageFull, _serialize_pageFull); + _serializers.insert(mtpc_inputPhoneCall, _serialize_inputPhoneCall); + _serializers.insert(mtpc_phoneCallEmpty, _serialize_phoneCallEmpty); + _serializers.insert(mtpc_phoneCallWaiting, _serialize_phoneCallWaiting); + _serializers.insert(mtpc_phoneCallRequested, _serialize_phoneCallRequested); + _serializers.insert(mtpc_phoneCall, _serialize_phoneCall); + _serializers.insert(mtpc_phoneCallDiscarded, _serialize_phoneCallDiscarded); + _serializers.insert(mtpc_phoneConnection, _serialize_phoneConnection); + _serializers.insert(mtpc_phoneCallProtocol, _serialize_phoneCallProtocol); + _serializers.insert(mtpc_phone_phoneCall, _serialize_phone_phoneCall); + _serializers.insert(mtpc_phoneCallDiscardReasonMissed, _serialize_phoneCallDiscardReasonMissed); + _serializers.insert(mtpc_phoneCallDiscardReasonDisconnect, _serialize_phoneCallDiscardReasonDisconnect); + _serializers.insert(mtpc_phoneCallDiscardReasonHangup, _serialize_phoneCallDiscardReasonHangup); + _serializers.insert(mtpc_phoneCallDiscardReasonBusy, _serialize_phoneCallDiscardReasonBusy); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -9476,6 +10322,8 @@ namespace { _serializers.insert(mtpc_messages_saveRecentSticker, _serialize_messages_saveRecentSticker); _serializers.insert(mtpc_messages_clearRecentStickers, _serialize_messages_clearRecentStickers); _serializers.insert(mtpc_messages_setInlineGameScore, _serialize_messages_setInlineGameScore); + _serializers.insert(mtpc_messages_toggleDialogPin, _serialize_messages_toggleDialogPin); + _serializers.insert(mtpc_messages_reorderPinnedDialogs, _serialize_messages_reorderPinnedDialogs); _serializers.insert(mtpc_upload_saveFilePart, _serialize_upload_saveFilePart); _serializers.insert(mtpc_upload_saveBigFilePart, _serialize_upload_saveBigFilePart); _serializers.insert(mtpc_help_saveAppLog, _serialize_help_saveAppLog); @@ -9485,6 +10333,8 @@ namespace { _serializers.insert(mtpc_channels_editAbout, _serialize_channels_editAbout); _serializers.insert(mtpc_channels_checkUsername, _serialize_channels_checkUsername); _serializers.insert(mtpc_channels_updateUsername, _serialize_channels_updateUsername); + _serializers.insert(mtpc_phone_discardCall, _serialize_phone_discardCall); + _serializers.insert(mtpc_phone_receivedCall, _serialize_phone_receivedCall); _serializers.insert(mtpc_invokeAfterMsg, _serialize_invokeAfterMsg); _serializers.insert(mtpc_invokeAfterMsgs, _serialize_invokeAfterMsgs); _serializers.insert(mtpc_initConnection, _serialize_initConnection); @@ -9600,12 +10450,14 @@ namespace { _serializers.insert(mtpc_messages_getMessageEditData, _serialize_messages_getMessageEditData); _serializers.insert(mtpc_messages_getBotCallbackAnswer, _serialize_messages_getBotCallbackAnswer); _serializers.insert(mtpc_messages_getPeerDialogs, _serialize_messages_getPeerDialogs); + _serializers.insert(mtpc_messages_getPinnedDialogs, _serialize_messages_getPinnedDialogs); _serializers.insert(mtpc_messages_getFeaturedStickers, _serialize_messages_getFeaturedStickers); _serializers.insert(mtpc_messages_getRecentStickers, _serialize_messages_getRecentStickers); _serializers.insert(mtpc_messages_getArchivedStickers, _serialize_messages_getArchivedStickers); _serializers.insert(mtpc_messages_getAttachedStickers, _serialize_messages_getAttachedStickers); _serializers.insert(mtpc_messages_getGameHighScores, _serialize_messages_getGameHighScores); _serializers.insert(mtpc_messages_getInlineGameHighScores, _serialize_messages_getInlineGameHighScores); + _serializers.insert(mtpc_messages_getWebPage, _serialize_messages_getWebPage); _serializers.insert(mtpc_updates_getState, _serialize_updates_getState); _serializers.insert(mtpc_updates_getDifference, _serialize_updates_getDifference); _serializers.insert(mtpc_updates_getChannelDifference, _serialize_updates_getChannelDifference); @@ -9623,6 +10475,8 @@ namespace { _serializers.insert(mtpc_channels_getParticipants, _serialize_channels_getParticipants); _serializers.insert(mtpc_channels_getParticipant, _serialize_channels_getParticipant); _serializers.insert(mtpc_channels_exportMessageLink, _serialize_channels_exportMessageLink); + _serializers.insert(mtpc_phone_requestCall, _serialize_phone_requestCall); + _serializers.insert(mtpc_phone_acceptCall, _serialize_phone_acceptCall); _serializers.insert(mtpc_rpc_result, _serialize_rpc_result); _serializers.insert(mtpc_msg_container, _serialize_msg_container); diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.h b/Telegram/SourceFiles/mtproto/scheme_auto.h index b6c43dace8..e926619075 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -30,7 +30,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org namespace MTP { namespace internal { -static constexpr mtpPrime CurrentLayer = 58; +static constexpr mtpPrime CurrentLayer = 61; class TypeCreator; @@ -229,7 +229,7 @@ enum { mtpc_messages_messagesSlice = 0xb446ae3, mtpc_messages_channelMessages = 0x99262e37, mtpc_messages_chats = 0x64ff9fd5, - mtpc_messages_chatsSlice = 0x78f69146, + mtpc_messages_chatsSlice = 0x9cd81144, mtpc_messages_chatFull = 0xe5d7d19c, mtpc_messages_affectedHistory = 0xb45c69d1, mtpc_inputMessagesFilterEmpty = 0x57e2f66c, @@ -254,7 +254,6 @@ enum { mtpc_updateUserPhoto = 0x95313b0c, mtpc_updateContactRegistered = 0x2575bbb9, mtpc_updateContactLink = 0x9d2e67c5, - mtpc_updateNewAuthorization = 0x8f06529a, mtpc_updateNewEncryptedMessage = 0x12bcbd9a, mtpc_updateEncryptedChatTyping = 0x1710f156, mtpc_updateEncryption = 0xb4a2e88d, @@ -264,7 +263,7 @@ enum { mtpc_updateDcOptions = 0x8e5e9873, mtpc_updateUserBlocked = 0x80ece81a, mtpc_updateNotifySettings = 0xbec268ef, - mtpc_updateServiceNotification = 0x382dd3e4, + mtpc_updateServiceNotification = 0xebe46819, mtpc_updatePrivacy = 0xee3b272a, mtpc_updateUserPhone = 0x12b9417b, mtpc_updateReadHistoryInbox = 0x9961fd5c, @@ -297,6 +296,9 @@ enum { mtpc_updateConfig = 0xa229dd06, mtpc_updatePtsChanged = 0x3354678f, mtpc_updateChannelWebPage = 0x40771900, + mtpc_updatePhoneCall = 0xab0f6b1e, + mtpc_updateDialogPinned = 0xd711a2cc, + mtpc_updatePinnedDialogs = 0xd8caf68d, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, @@ -314,7 +316,7 @@ enum { mtpc_photos_photo = 0x20212ca8, mtpc_upload_file = 0x96a18d5, mtpc_dcOption = 0x5d8c6cc, - mtpc_config = 0x9a6b2e2a, + mtpc_config = 0x3af6fb5f, mtpc_nearestDc = 0x8e1a1775, mtpc_help_appUpdate = 0x8987f311, mtpc_help_noAppUpdate = 0xc45a6536, @@ -356,11 +358,14 @@ enum { mtpc_sendMessageUploadDocumentAction = 0xaa0cd9e4, mtpc_sendMessageGeoLocationAction = 0x176f8ba1, mtpc_sendMessageChooseContactAction = 0x628cbc6f, + mtpc_sendMessageGamePlayAction = 0xdd6a8f48, mtpc_contacts_found = 0x1aa1f784, mtpc_inputPrivacyKeyStatusTimestamp = 0x4f96cb18, mtpc_inputPrivacyKeyChatInvite = 0xbdfb0426, + mtpc_inputPrivacyKeyPhoneCall = 0xfabadc5f, mtpc_privacyKeyStatusTimestamp = 0xbc2eab30, mtpc_privacyKeyChatInvite = 0x500e6dfa, + mtpc_privacyKeyPhoneCall = 0x3d662b7b, mtpc_inputPrivacyValueAllowContacts = 0xd09e07b, mtpc_inputPrivacyValueAllowAll = 0x184b35ce, mtpc_inputPrivacyValueAllowUsers = 0x131cc67f, @@ -395,7 +400,8 @@ enum { mtpc_contactLinkContact = 0xd502c2d0, mtpc_webPageEmpty = 0xeb1477e8, mtpc_webPagePending = 0xc586da1c, - mtpc_webPage = 0xca820ed7, + mtpc_webPage = 0x5f07b4bc, + mtpc_webPageNotModified = 0x85849473, mtpc_authorization = 0x7bf2e6f6, mtpc_account_authorizations = 0x1250abde, mtpc_account_noPassword = 0x96dabc18, @@ -428,7 +434,7 @@ enum { mtpc_replyKeyboardMarkup = 0x3502758c, mtpc_replyInlineMarkup = 0x48a30254, mtpc_help_appChangelogEmpty = 0xaf7e0394, - mtpc_help_appChangelog = 0x4668e6bd, + mtpc_help_appChangelog = 0x2a137e7c, mtpc_messageEntityUnknown = 0xbb92ba95, mtpc_messageEntityMention = 0xfa04579d, mtpc_messageEntityHashtag = 0x6f635b0d, @@ -532,6 +538,52 @@ enum { mtpc_inputGameShortName = 0xc331e80a, mtpc_highScore = 0x58fffcd0, mtpc_messages_highScores = 0x9a3bfd99, + mtpc_textEmpty = 0xdc3d824f, + mtpc_textPlain = 0x744694e0, + mtpc_textBold = 0x6724abc4, + mtpc_textItalic = 0xd912a59c, + mtpc_textUnderline = 0xc12622c4, + mtpc_textStrike = 0x9bf8bb95, + mtpc_textFixed = 0x6c3f19b9, + mtpc_textUrl = 0x3c2884c1, + mtpc_textEmail = 0xde5a0dd6, + mtpc_textConcat = 0x7e6260d7, + mtpc_pageBlockUnsupported = 0x13567e8a, + mtpc_pageBlockTitle = 0x70abc3fd, + mtpc_pageBlockSubtitle = 0x8ffa9a1f, + mtpc_pageBlockAuthorDate = 0xbaafe5e0, + mtpc_pageBlockHeader = 0xbfd064ec, + mtpc_pageBlockSubheader = 0xf12bb6e1, + mtpc_pageBlockParagraph = 0x467a0766, + mtpc_pageBlockPreformatted = 0xc070d93e, + mtpc_pageBlockFooter = 0x48870999, + mtpc_pageBlockDivider = 0xdb20b188, + mtpc_pageBlockAnchor = 0xce0d37b0, + mtpc_pageBlockList = 0x3a58c7f4, + mtpc_pageBlockBlockquote = 0x263d7c26, + mtpc_pageBlockPullquote = 0x4f4456d3, + mtpc_pageBlockPhoto = 0xe9c69982, + mtpc_pageBlockVideo = 0xd9d71866, + mtpc_pageBlockCover = 0x39f23300, + mtpc_pageBlockEmbed = 0xcde200d1, + mtpc_pageBlockEmbedPost = 0x292c7be9, + mtpc_pageBlockCollage = 0x8b31c4f, + mtpc_pageBlockSlideshow = 0x130c8963, + mtpc_pagePart = 0x8dee6c44, + mtpc_pageFull = 0xd7a19d69, + mtpc_inputPhoneCall = 0x1e36fded, + mtpc_phoneCallEmpty = 0x5366c915, + mtpc_phoneCallWaiting = 0x1b8f4ad1, + mtpc_phoneCallRequested = 0x6c448ae8, + mtpc_phoneCall = 0xffe6ab67, + mtpc_phoneCallDiscarded = 0x50ca4de1, + mtpc_phoneConnection = 0x9d4c17c0, + mtpc_phoneCallProtocol = 0xa2bb35cb, + mtpc_phone_phoneCall = 0xec82e140, + mtpc_phoneCallDiscardReasonMissed = 0x85e42301, + mtpc_phoneCallDiscardReasonDisconnect = 0xe095c1a0, + mtpc_phoneCallDiscardReasonHangup = 0x57adc690, + mtpc_phoneCallDiscardReasonBusy = 0xfaf7e8c9, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -597,7 +649,7 @@ enum { mtpc_contacts_getTopPeers = 0xd4982db5, mtpc_contacts_resetTopPeerRating = 0x1ae373ac, mtpc_messages_getMessages = 0x4222fa74, - mtpc_messages_getDialogs = 0x6b47f94d, + mtpc_messages_getDialogs = 0x191ba9c5, mtpc_messages_getHistory = 0xafa92846, mtpc_messages_search = 0xd4569248, mtpc_messages_readHistory = 0xe306d3a, @@ -674,6 +726,10 @@ enum { mtpc_messages_getInlineGameHighScores = 0xf635e1b, mtpc_messages_getCommonChats = 0xd0a48c4, mtpc_messages_getAllChats = 0xeba80ff0, + mtpc_messages_getWebPage = 0x32ca8f91, + mtpc_messages_toggleDialogPin = 0x3289be6a, + mtpc_messages_reorderPinnedDialogs = 0x959ff644, + mtpc_messages_getPinnedDialogs = 0xe254d64e, mtpc_updates_getState = 0xedd4882a, mtpc_updates_getDifference = 0x25939651, mtpc_updates_getChannelDifference = 0x3173d78, @@ -719,7 +775,11 @@ enum { mtpc_channels_exportMessageLink = 0xc846d22d, mtpc_channels_toggleSignatures = 0x1f69b606, mtpc_channels_updatePinnedMessage = 0xa72ded52, - mtpc_channels_getAdminedPublicChannels = 0x8d8d82d7 + mtpc_channels_getAdminedPublicChannels = 0x8d8d82d7, + mtpc_phone_requestCall = 0xa41aa5e4, + mtpc_phone_acceptCall = 0x220f0b20, + mtpc_phone_discardCall = 0x5dfbcddc, + mtpc_phone_receivedCall = 0x17d54f61 }; // Type forward declarations @@ -1030,7 +1090,6 @@ class MTPDupdateUserName; class MTPDupdateUserPhoto; class MTPDupdateContactRegistered; class MTPDupdateContactLink; -class MTPDupdateNewAuthorization; class MTPDupdateNewEncryptedMessage; class MTPDupdateEncryptedChatTyping; class MTPDupdateEncryption; @@ -1067,6 +1126,9 @@ class MTPDupdateInlineBotCallbackQuery; class MTPDupdateReadChannelOutbox; class MTPDupdateDraftMessage; class MTPDupdateChannelWebPage; +class MTPDupdatePhoneCall; +class MTPDupdateDialogPinned; +class MTPDupdatePinnedDialogs; class MTPupdates_state; class MTPDupdates_state; @@ -1445,6 +1507,63 @@ class MTPDhighScore; class MTPmessages_highScores; class MTPDmessages_highScores; +class MTPrichText; +class MTPDtextPlain; +class MTPDtextBold; +class MTPDtextItalic; +class MTPDtextUnderline; +class MTPDtextStrike; +class MTPDtextFixed; +class MTPDtextUrl; +class MTPDtextEmail; +class MTPDtextConcat; + +class MTPpageBlock; +class MTPDpageBlockTitle; +class MTPDpageBlockSubtitle; +class MTPDpageBlockAuthorDate; +class MTPDpageBlockHeader; +class MTPDpageBlockSubheader; +class MTPDpageBlockParagraph; +class MTPDpageBlockPreformatted; +class MTPDpageBlockFooter; +class MTPDpageBlockAnchor; +class MTPDpageBlockList; +class MTPDpageBlockBlockquote; +class MTPDpageBlockPullquote; +class MTPDpageBlockPhoto; +class MTPDpageBlockVideo; +class MTPDpageBlockCover; +class MTPDpageBlockEmbed; +class MTPDpageBlockEmbedPost; +class MTPDpageBlockCollage; +class MTPDpageBlockSlideshow; + +class MTPpage; +class MTPDpagePart; +class MTPDpageFull; + +class MTPinputPhoneCall; +class MTPDinputPhoneCall; + +class MTPphoneCall; +class MTPDphoneCallEmpty; +class MTPDphoneCallWaiting; +class MTPDphoneCallRequested; +class MTPDphoneCall; +class MTPDphoneCallDiscarded; + +class MTPphoneConnection; +class MTPDphoneConnection; + +class MTPphoneCallProtocol; +class MTPDphoneCallProtocol; + +class MTPphone_phoneCall; +class MTPDphone_phoneCall; + +class MTPphoneCallDiscardReason; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1629,6 +1748,15 @@ typedef MTPBoxed MTPGame; typedef MTPBoxed MTPInputGame; typedef MTPBoxed MTPHighScore; typedef MTPBoxed MTPmessages_HighScores; +typedef MTPBoxed MTPRichText; +typedef MTPBoxed MTPPageBlock; +typedef MTPBoxed MTPPage; +typedef MTPBoxed MTPInputPhoneCall; +typedef MTPBoxed MTPPhoneCall; +typedef MTPBoxed MTPPhoneConnection; +typedef MTPBoxed MTPPhoneCallProtocol; +typedef MTPBoxed MTPphone_PhoneCall; +typedef MTPBoxed MTPPhoneCallDiscardReason; // Type classes definitions @@ -5013,16 +5141,6 @@ public: return *(const MTPDupdateContactLink*)data; } - MTPDupdateNewAuthorization &_updateNewAuthorization() { - t_assert(data != nullptr && _type == mtpc_updateNewAuthorization); - split(); - return *(MTPDupdateNewAuthorization*)data; - } - const MTPDupdateNewAuthorization &c_updateNewAuthorization() const { - t_assert(data != nullptr && _type == mtpc_updateNewAuthorization); - return *(const MTPDupdateNewAuthorization*)data; - } - MTPDupdateNewEncryptedMessage &_updateNewEncryptedMessage() { t_assert(data != nullptr && _type == mtpc_updateNewEncryptedMessage); split(); @@ -5383,6 +5501,36 @@ public: return *(const MTPDupdateChannelWebPage*)data; } + MTPDupdatePhoneCall &_updatePhoneCall() { + t_assert(data != nullptr && _type == mtpc_updatePhoneCall); + split(); + return *(MTPDupdatePhoneCall*)data; + } + const MTPDupdatePhoneCall &c_updatePhoneCall() const { + t_assert(data != nullptr && _type == mtpc_updatePhoneCall); + return *(const MTPDupdatePhoneCall*)data; + } + + MTPDupdateDialogPinned &_updateDialogPinned() { + t_assert(data != nullptr && _type == mtpc_updateDialogPinned); + split(); + return *(MTPDupdateDialogPinned*)data; + } + const MTPDupdateDialogPinned &c_updateDialogPinned() const { + t_assert(data != nullptr && _type == mtpc_updateDialogPinned); + return *(const MTPDupdateDialogPinned*)data; + } + + MTPDupdatePinnedDialogs &_updatePinnedDialogs() { + t_assert(data != nullptr && _type == mtpc_updatePinnedDialogs); + split(); + return *(MTPDupdatePinnedDialogs*)data; + } + const MTPDupdatePinnedDialogs &c_updatePinnedDialogs() const { + t_assert(data != nullptr && _type == mtpc_updatePinnedDialogs); + return *(const MTPDupdatePinnedDialogs*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5403,7 +5551,6 @@ private: explicit MTPupdate(MTPDupdateUserPhoto *_data); explicit MTPupdate(MTPDupdateContactRegistered *_data); explicit MTPupdate(MTPDupdateContactLink *_data); - explicit MTPupdate(MTPDupdateNewAuthorization *_data); explicit MTPupdate(MTPDupdateNewEncryptedMessage *_data); explicit MTPupdate(MTPDupdateEncryptedChatTyping *_data); explicit MTPupdate(MTPDupdateEncryption *_data); @@ -5440,6 +5587,9 @@ private: explicit MTPupdate(MTPDupdateReadChannelOutbox *_data); explicit MTPupdate(MTPDupdateDraftMessage *_data); explicit MTPupdate(MTPDupdateChannelWebPage *_data); + explicit MTPupdate(MTPDupdatePhoneCall *_data); + explicit MTPupdate(MTPDupdateDialogPinned *_data); + explicit MTPupdate(MTPDupdatePinnedDialogs *_data); friend class MTP::internal::TypeCreator; @@ -9608,6 +9758,635 @@ private: }; typedef MTPBoxed MTPmessages_HighScores; +class MTPrichText : private mtpDataOwner { +public: + MTPrichText() : mtpDataOwner(0), _type(0) { + } + MTPrichText(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + read(from, end, cons); + } + + MTPDtextPlain &_textPlain() { + t_assert(data != nullptr && _type == mtpc_textPlain); + split(); + return *(MTPDtextPlain*)data; + } + const MTPDtextPlain &c_textPlain() const { + t_assert(data != nullptr && _type == mtpc_textPlain); + return *(const MTPDtextPlain*)data; + } + + MTPDtextBold &_textBold() { + t_assert(data != nullptr && _type == mtpc_textBold); + split(); + return *(MTPDtextBold*)data; + } + const MTPDtextBold &c_textBold() const { + t_assert(data != nullptr && _type == mtpc_textBold); + return *(const MTPDtextBold*)data; + } + + MTPDtextItalic &_textItalic() { + t_assert(data != nullptr && _type == mtpc_textItalic); + split(); + return *(MTPDtextItalic*)data; + } + const MTPDtextItalic &c_textItalic() const { + t_assert(data != nullptr && _type == mtpc_textItalic); + return *(const MTPDtextItalic*)data; + } + + MTPDtextUnderline &_textUnderline() { + t_assert(data != nullptr && _type == mtpc_textUnderline); + split(); + return *(MTPDtextUnderline*)data; + } + const MTPDtextUnderline &c_textUnderline() const { + t_assert(data != nullptr && _type == mtpc_textUnderline); + return *(const MTPDtextUnderline*)data; + } + + MTPDtextStrike &_textStrike() { + t_assert(data != nullptr && _type == mtpc_textStrike); + split(); + return *(MTPDtextStrike*)data; + } + const MTPDtextStrike &c_textStrike() const { + t_assert(data != nullptr && _type == mtpc_textStrike); + return *(const MTPDtextStrike*)data; + } + + MTPDtextFixed &_textFixed() { + t_assert(data != nullptr && _type == mtpc_textFixed); + split(); + return *(MTPDtextFixed*)data; + } + const MTPDtextFixed &c_textFixed() const { + t_assert(data != nullptr && _type == mtpc_textFixed); + return *(const MTPDtextFixed*)data; + } + + MTPDtextUrl &_textUrl() { + t_assert(data != nullptr && _type == mtpc_textUrl); + split(); + return *(MTPDtextUrl*)data; + } + const MTPDtextUrl &c_textUrl() const { + t_assert(data != nullptr && _type == mtpc_textUrl); + return *(const MTPDtextUrl*)data; + } + + MTPDtextEmail &_textEmail() { + t_assert(data != nullptr && _type == mtpc_textEmail); + split(); + return *(MTPDtextEmail*)data; + } + const MTPDtextEmail &c_textEmail() const { + t_assert(data != nullptr && _type == mtpc_textEmail); + return *(const MTPDtextEmail*)data; + } + + MTPDtextConcat &_textConcat() { + t_assert(data != nullptr && _type == mtpc_textConcat); + split(); + return *(MTPDtextConcat*)data; + } + const MTPDtextConcat &c_textConcat() const { + t_assert(data != nullptr && _type == mtpc_textConcat); + return *(const MTPDtextConcat*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPrichText(mtpTypeId type); + explicit MTPrichText(MTPDtextPlain *_data); + explicit MTPrichText(MTPDtextBold *_data); + explicit MTPrichText(MTPDtextItalic *_data); + explicit MTPrichText(MTPDtextUnderline *_data); + explicit MTPrichText(MTPDtextStrike *_data); + explicit MTPrichText(MTPDtextFixed *_data); + explicit MTPrichText(MTPDtextUrl *_data); + explicit MTPrichText(MTPDtextEmail *_data); + explicit MTPrichText(MTPDtextConcat *_data); + + friend class MTP::internal::TypeCreator; + + mtpTypeId _type; +}; +typedef MTPBoxed MTPRichText; + +class MTPpageBlock : private mtpDataOwner { +public: + MTPpageBlock() : mtpDataOwner(0), _type(0) { + } + MTPpageBlock(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + read(from, end, cons); + } + + MTPDpageBlockTitle &_pageBlockTitle() { + t_assert(data != nullptr && _type == mtpc_pageBlockTitle); + split(); + return *(MTPDpageBlockTitle*)data; + } + const MTPDpageBlockTitle &c_pageBlockTitle() const { + t_assert(data != nullptr && _type == mtpc_pageBlockTitle); + return *(const MTPDpageBlockTitle*)data; + } + + MTPDpageBlockSubtitle &_pageBlockSubtitle() { + t_assert(data != nullptr && _type == mtpc_pageBlockSubtitle); + split(); + return *(MTPDpageBlockSubtitle*)data; + } + const MTPDpageBlockSubtitle &c_pageBlockSubtitle() const { + t_assert(data != nullptr && _type == mtpc_pageBlockSubtitle); + return *(const MTPDpageBlockSubtitle*)data; + } + + MTPDpageBlockAuthorDate &_pageBlockAuthorDate() { + t_assert(data != nullptr && _type == mtpc_pageBlockAuthorDate); + split(); + return *(MTPDpageBlockAuthorDate*)data; + } + const MTPDpageBlockAuthorDate &c_pageBlockAuthorDate() const { + t_assert(data != nullptr && _type == mtpc_pageBlockAuthorDate); + return *(const MTPDpageBlockAuthorDate*)data; + } + + MTPDpageBlockHeader &_pageBlockHeader() { + t_assert(data != nullptr && _type == mtpc_pageBlockHeader); + split(); + return *(MTPDpageBlockHeader*)data; + } + const MTPDpageBlockHeader &c_pageBlockHeader() const { + t_assert(data != nullptr && _type == mtpc_pageBlockHeader); + return *(const MTPDpageBlockHeader*)data; + } + + MTPDpageBlockSubheader &_pageBlockSubheader() { + t_assert(data != nullptr && _type == mtpc_pageBlockSubheader); + split(); + return *(MTPDpageBlockSubheader*)data; + } + const MTPDpageBlockSubheader &c_pageBlockSubheader() const { + t_assert(data != nullptr && _type == mtpc_pageBlockSubheader); + return *(const MTPDpageBlockSubheader*)data; + } + + MTPDpageBlockParagraph &_pageBlockParagraph() { + t_assert(data != nullptr && _type == mtpc_pageBlockParagraph); + split(); + return *(MTPDpageBlockParagraph*)data; + } + const MTPDpageBlockParagraph &c_pageBlockParagraph() const { + t_assert(data != nullptr && _type == mtpc_pageBlockParagraph); + return *(const MTPDpageBlockParagraph*)data; + } + + MTPDpageBlockPreformatted &_pageBlockPreformatted() { + t_assert(data != nullptr && _type == mtpc_pageBlockPreformatted); + split(); + return *(MTPDpageBlockPreformatted*)data; + } + const MTPDpageBlockPreformatted &c_pageBlockPreformatted() const { + t_assert(data != nullptr && _type == mtpc_pageBlockPreformatted); + return *(const MTPDpageBlockPreformatted*)data; + } + + MTPDpageBlockFooter &_pageBlockFooter() { + t_assert(data != nullptr && _type == mtpc_pageBlockFooter); + split(); + return *(MTPDpageBlockFooter*)data; + } + const MTPDpageBlockFooter &c_pageBlockFooter() const { + t_assert(data != nullptr && _type == mtpc_pageBlockFooter); + return *(const MTPDpageBlockFooter*)data; + } + + MTPDpageBlockAnchor &_pageBlockAnchor() { + t_assert(data != nullptr && _type == mtpc_pageBlockAnchor); + split(); + return *(MTPDpageBlockAnchor*)data; + } + const MTPDpageBlockAnchor &c_pageBlockAnchor() const { + t_assert(data != nullptr && _type == mtpc_pageBlockAnchor); + return *(const MTPDpageBlockAnchor*)data; + } + + MTPDpageBlockList &_pageBlockList() { + t_assert(data != nullptr && _type == mtpc_pageBlockList); + split(); + return *(MTPDpageBlockList*)data; + } + const MTPDpageBlockList &c_pageBlockList() const { + t_assert(data != nullptr && _type == mtpc_pageBlockList); + return *(const MTPDpageBlockList*)data; + } + + MTPDpageBlockBlockquote &_pageBlockBlockquote() { + t_assert(data != nullptr && _type == mtpc_pageBlockBlockquote); + split(); + return *(MTPDpageBlockBlockquote*)data; + } + const MTPDpageBlockBlockquote &c_pageBlockBlockquote() const { + t_assert(data != nullptr && _type == mtpc_pageBlockBlockquote); + return *(const MTPDpageBlockBlockquote*)data; + } + + MTPDpageBlockPullquote &_pageBlockPullquote() { + t_assert(data != nullptr && _type == mtpc_pageBlockPullquote); + split(); + return *(MTPDpageBlockPullquote*)data; + } + const MTPDpageBlockPullquote &c_pageBlockPullquote() const { + t_assert(data != nullptr && _type == mtpc_pageBlockPullquote); + return *(const MTPDpageBlockPullquote*)data; + } + + MTPDpageBlockPhoto &_pageBlockPhoto() { + t_assert(data != nullptr && _type == mtpc_pageBlockPhoto); + split(); + return *(MTPDpageBlockPhoto*)data; + } + const MTPDpageBlockPhoto &c_pageBlockPhoto() const { + t_assert(data != nullptr && _type == mtpc_pageBlockPhoto); + return *(const MTPDpageBlockPhoto*)data; + } + + MTPDpageBlockVideo &_pageBlockVideo() { + t_assert(data != nullptr && _type == mtpc_pageBlockVideo); + split(); + return *(MTPDpageBlockVideo*)data; + } + const MTPDpageBlockVideo &c_pageBlockVideo() const { + t_assert(data != nullptr && _type == mtpc_pageBlockVideo); + return *(const MTPDpageBlockVideo*)data; + } + + MTPDpageBlockCover &_pageBlockCover() { + t_assert(data != nullptr && _type == mtpc_pageBlockCover); + split(); + return *(MTPDpageBlockCover*)data; + } + const MTPDpageBlockCover &c_pageBlockCover() const { + t_assert(data != nullptr && _type == mtpc_pageBlockCover); + return *(const MTPDpageBlockCover*)data; + } + + MTPDpageBlockEmbed &_pageBlockEmbed() { + t_assert(data != nullptr && _type == mtpc_pageBlockEmbed); + split(); + return *(MTPDpageBlockEmbed*)data; + } + const MTPDpageBlockEmbed &c_pageBlockEmbed() const { + t_assert(data != nullptr && _type == mtpc_pageBlockEmbed); + return *(const MTPDpageBlockEmbed*)data; + } + + MTPDpageBlockEmbedPost &_pageBlockEmbedPost() { + t_assert(data != nullptr && _type == mtpc_pageBlockEmbedPost); + split(); + return *(MTPDpageBlockEmbedPost*)data; + } + const MTPDpageBlockEmbedPost &c_pageBlockEmbedPost() const { + t_assert(data != nullptr && _type == mtpc_pageBlockEmbedPost); + return *(const MTPDpageBlockEmbedPost*)data; + } + + MTPDpageBlockCollage &_pageBlockCollage() { + t_assert(data != nullptr && _type == mtpc_pageBlockCollage); + split(); + return *(MTPDpageBlockCollage*)data; + } + const MTPDpageBlockCollage &c_pageBlockCollage() const { + t_assert(data != nullptr && _type == mtpc_pageBlockCollage); + return *(const MTPDpageBlockCollage*)data; + } + + MTPDpageBlockSlideshow &_pageBlockSlideshow() { + t_assert(data != nullptr && _type == mtpc_pageBlockSlideshow); + split(); + return *(MTPDpageBlockSlideshow*)data; + } + const MTPDpageBlockSlideshow &c_pageBlockSlideshow() const { + t_assert(data != nullptr && _type == mtpc_pageBlockSlideshow); + return *(const MTPDpageBlockSlideshow*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPpageBlock(mtpTypeId type); + explicit MTPpageBlock(MTPDpageBlockTitle *_data); + explicit MTPpageBlock(MTPDpageBlockSubtitle *_data); + explicit MTPpageBlock(MTPDpageBlockAuthorDate *_data); + explicit MTPpageBlock(MTPDpageBlockHeader *_data); + explicit MTPpageBlock(MTPDpageBlockSubheader *_data); + explicit MTPpageBlock(MTPDpageBlockParagraph *_data); + explicit MTPpageBlock(MTPDpageBlockPreformatted *_data); + explicit MTPpageBlock(MTPDpageBlockFooter *_data); + explicit MTPpageBlock(MTPDpageBlockAnchor *_data); + explicit MTPpageBlock(MTPDpageBlockList *_data); + explicit MTPpageBlock(MTPDpageBlockBlockquote *_data); + explicit MTPpageBlock(MTPDpageBlockPullquote *_data); + explicit MTPpageBlock(MTPDpageBlockPhoto *_data); + explicit MTPpageBlock(MTPDpageBlockVideo *_data); + explicit MTPpageBlock(MTPDpageBlockCover *_data); + explicit MTPpageBlock(MTPDpageBlockEmbed *_data); + explicit MTPpageBlock(MTPDpageBlockEmbedPost *_data); + explicit MTPpageBlock(MTPDpageBlockCollage *_data); + explicit MTPpageBlock(MTPDpageBlockSlideshow *_data); + + friend class MTP::internal::TypeCreator; + + mtpTypeId _type; +}; +typedef MTPBoxed MTPPageBlock; + +class MTPpage : private mtpDataOwner { +public: + MTPpage() : mtpDataOwner(0), _type(0) { + } + MTPpage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + read(from, end, cons); + } + + MTPDpagePart &_pagePart() { + t_assert(data != nullptr && _type == mtpc_pagePart); + split(); + return *(MTPDpagePart*)data; + } + const MTPDpagePart &c_pagePart() const { + t_assert(data != nullptr && _type == mtpc_pagePart); + return *(const MTPDpagePart*)data; + } + + MTPDpageFull &_pageFull() { + t_assert(data != nullptr && _type == mtpc_pageFull); + split(); + return *(MTPDpageFull*)data; + } + const MTPDpageFull &c_pageFull() const { + t_assert(data != nullptr && _type == mtpc_pageFull); + return *(const MTPDpageFull*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPpage(mtpTypeId type); + explicit MTPpage(MTPDpagePart *_data); + explicit MTPpage(MTPDpageFull *_data); + + friend class MTP::internal::TypeCreator; + + mtpTypeId _type; +}; +typedef MTPBoxed MTPPage; + +class MTPinputPhoneCall : private mtpDataOwner { +public: + MTPinputPhoneCall(); + MTPinputPhoneCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputPhoneCall) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDinputPhoneCall &_inputPhoneCall() { + t_assert(data != nullptr); + split(); + return *(MTPDinputPhoneCall*)data; + } + const MTPDinputPhoneCall &c_inputPhoneCall() const { + t_assert(data != nullptr); + return *(const MTPDinputPhoneCall*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputPhoneCall); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPinputPhoneCall(MTPDinputPhoneCall *_data); + + friend class MTP::internal::TypeCreator; +}; +typedef MTPBoxed MTPInputPhoneCall; + +class MTPphoneCall : private mtpDataOwner { +public: + MTPphoneCall() : mtpDataOwner(0), _type(0) { + } + MTPphoneCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + read(from, end, cons); + } + + MTPDphoneCallEmpty &_phoneCallEmpty() { + t_assert(data != nullptr && _type == mtpc_phoneCallEmpty); + split(); + return *(MTPDphoneCallEmpty*)data; + } + const MTPDphoneCallEmpty &c_phoneCallEmpty() const { + t_assert(data != nullptr && _type == mtpc_phoneCallEmpty); + return *(const MTPDphoneCallEmpty*)data; + } + + MTPDphoneCallWaiting &_phoneCallWaiting() { + t_assert(data != nullptr && _type == mtpc_phoneCallWaiting); + split(); + return *(MTPDphoneCallWaiting*)data; + } + const MTPDphoneCallWaiting &c_phoneCallWaiting() const { + t_assert(data != nullptr && _type == mtpc_phoneCallWaiting); + return *(const MTPDphoneCallWaiting*)data; + } + + MTPDphoneCallRequested &_phoneCallRequested() { + t_assert(data != nullptr && _type == mtpc_phoneCallRequested); + split(); + return *(MTPDphoneCallRequested*)data; + } + const MTPDphoneCallRequested &c_phoneCallRequested() const { + t_assert(data != nullptr && _type == mtpc_phoneCallRequested); + return *(const MTPDphoneCallRequested*)data; + } + + MTPDphoneCall &_phoneCall() { + t_assert(data != nullptr && _type == mtpc_phoneCall); + split(); + return *(MTPDphoneCall*)data; + } + const MTPDphoneCall &c_phoneCall() const { + t_assert(data != nullptr && _type == mtpc_phoneCall); + return *(const MTPDphoneCall*)data; + } + + MTPDphoneCallDiscarded &_phoneCallDiscarded() { + t_assert(data != nullptr && _type == mtpc_phoneCallDiscarded); + split(); + return *(MTPDphoneCallDiscarded*)data; + } + const MTPDphoneCallDiscarded &c_phoneCallDiscarded() const { + t_assert(data != nullptr && _type == mtpc_phoneCallDiscarded); + return *(const MTPDphoneCallDiscarded*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPphoneCall(mtpTypeId type); + explicit MTPphoneCall(MTPDphoneCallEmpty *_data); + explicit MTPphoneCall(MTPDphoneCallWaiting *_data); + explicit MTPphoneCall(MTPDphoneCallRequested *_data); + explicit MTPphoneCall(MTPDphoneCall *_data); + explicit MTPphoneCall(MTPDphoneCallDiscarded *_data); + + friend class MTP::internal::TypeCreator; + + mtpTypeId _type; +}; +typedef MTPBoxed MTPPhoneCall; + +class MTPphoneConnection : private mtpDataOwner { +public: + MTPphoneConnection(); + MTPphoneConnection(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phoneConnection) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDphoneConnection &_phoneConnection() { + t_assert(data != nullptr); + split(); + return *(MTPDphoneConnection*)data; + } + const MTPDphoneConnection &c_phoneConnection() const { + t_assert(data != nullptr); + return *(const MTPDphoneConnection*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phoneConnection); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPphoneConnection(MTPDphoneConnection *_data); + + friend class MTP::internal::TypeCreator; +}; +typedef MTPBoxed MTPPhoneConnection; + +class MTPphoneCallProtocol : private mtpDataOwner { +public: + MTPphoneCallProtocol(); + MTPphoneCallProtocol(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phoneCallProtocol) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDphoneCallProtocol &_phoneCallProtocol() { + t_assert(data != nullptr); + split(); + return *(MTPDphoneCallProtocol*)data; + } + const MTPDphoneCallProtocol &c_phoneCallProtocol() const { + t_assert(data != nullptr); + return *(const MTPDphoneCallProtocol*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phoneCallProtocol); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPphoneCallProtocol(MTPDphoneCallProtocol *_data); + + friend class MTP::internal::TypeCreator; +}; +typedef MTPBoxed MTPPhoneCallProtocol; + +class MTPphone_phoneCall : private mtpDataOwner { +public: + MTPphone_phoneCall(); + MTPphone_phoneCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_phoneCall) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDphone_phoneCall &_phone_phoneCall() { + t_assert(data != nullptr); + split(); + return *(MTPDphone_phoneCall*)data; + } + const MTPDphone_phoneCall &c_phone_phoneCall() const { + t_assert(data != nullptr); + return *(const MTPDphone_phoneCall*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_phoneCall); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPphone_phoneCall(MTPDphone_phoneCall *_data); + + friend class MTP::internal::TypeCreator; +}; +typedef MTPBoxed MTPphone_PhoneCall; + +class MTPphoneCallDiscardReason { +public: + MTPphoneCallDiscardReason() : _type(0) { + } + MTPphoneCallDiscardReason(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : _type(0) { + read(from, end, cons); + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPphoneCallDiscardReason(mtpTypeId type); + + friend class MTP::internal::TypeCreator; + + mtpTypeId _type; +}; +typedef MTPBoxed MTPPhoneCallDiscardReason; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -11027,14 +11806,16 @@ public: class MTPDdialog : public mtpDataImpl { public: enum class Flag : int32 { + f_pinned = (1 << 2), f_pts = (1 << 0), f_draft = (1 << 1), - MAX_FIELD = (1 << 1), + MAX_FIELD = (1 << 2), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + bool is_pinned() const { return vflags.v & Flag::f_pinned; } bool has_pts() const { return vflags.v & Flag::f_pts; } bool has_draft() const { return vflags.v & Flag::f_draft; } @@ -11543,12 +12324,11 @@ class MTPDmessages_chatsSlice : public mtpDataImpl { public: MTPDmessages_chatsSlice() { } - MTPDmessages_chatsSlice(MTPint _count, const MTPVector &_chats, const MTPVector &_users) : vcount(_count), vchats(_chats), vusers(_users) { + MTPDmessages_chatsSlice(MTPint _count, const MTPVector &_chats) : vcount(_count), vchats(_chats) { } MTPint vcount; MTPVector vchats; - MTPVector vusers; }; class MTPDmessages_chatFull : public mtpDataImpl { @@ -11703,19 +12483,6 @@ public: MTPContactLink vforeign_link; }; -class MTPDupdateNewAuthorization : public mtpDataImpl { -public: - MTPDupdateNewAuthorization() { - } - MTPDupdateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) : vauth_key_id(_auth_key_id), vdate(_date), vdevice(_device), vlocation(_location) { - } - - MTPlong vauth_key_id; - MTPint vdate; - MTPstring vdevice; - MTPstring vlocation; -}; - class MTPDupdateNewEncryptedMessage : public mtpDataImpl { public: MTPDupdateNewEncryptedMessage() { @@ -11820,15 +12587,29 @@ public: class MTPDupdateServiceNotification : public mtpDataImpl { public: + enum class Flag : int32 { + f_popup = (1 << 0), + f_inbox_date = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_popup() const { return vflags.v & Flag::f_popup; } + bool has_inbox_date() const { return vflags.v & Flag::f_inbox_date; } + MTPDupdateServiceNotification() { } - MTPDupdateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup) : vtype(_type), vmessage(_message), vmedia(_media), vpopup(_popup) { + MTPDupdateServiceNotification(const MTPflags &_flags, MTPint _inbox_date, const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) : vflags(_flags), vinbox_date(_inbox_date), vtype(_type), vmessage(_message), vmedia(_media), ventities(_entities) { } + MTPflags vflags; + MTPint vinbox_date; MTPstring vtype; MTPstring vmessage; MTPMessageMedia vmedia; - MTPBool vpopup; + MTPVector ventities; }; class MTPDupdatePrivacy : public mtpDataImpl { @@ -12215,6 +12996,56 @@ public: MTPint vpts_count; }; +class MTPDupdatePhoneCall : public mtpDataImpl { +public: + MTPDupdatePhoneCall() { + } + MTPDupdatePhoneCall(const MTPPhoneCall &_phone_call) : vphone_call(_phone_call) { + } + + MTPPhoneCall vphone_call; +}; + +class MTPDupdateDialogPinned : public mtpDataImpl { +public: + enum class Flag : int32 { + f_pinned = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_pinned() const { return vflags.v & Flag::f_pinned; } + + MTPDupdateDialogPinned() { + } + MTPDupdateDialogPinned(const MTPflags &_flags, const MTPPeer &_peer) : vflags(_flags), vpeer(_peer) { + } + + MTPflags vflags; + MTPPeer vpeer; +}; + +class MTPDupdatePinnedDialogs : public mtpDataImpl { +public: + enum class Flag : int32 { + f_order = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_order() const { return vflags.v & Flag::f_order; } + + MTPDupdatePinnedDialogs() { + } + MTPDupdatePinnedDialogs(const MTPflags &_flags, const MTPVector &_order) : vflags(_flags), vorder(_order) { + } + + MTPflags vflags; + MTPVector vorder; +}; + class MTPDupdates_state : public mtpDataImpl { public: MTPDupdates_state() { @@ -12515,17 +13346,20 @@ public: class MTPDconfig : public mtpDataImpl { public: enum class Flag : int32 { + f_phonecalls_enabled = (1 << 1), f_tmp_sessions = (1 << 0), - MAX_FIELD = (1 << 0), + + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + bool is_phonecalls_enabled() const { return vflags.v & Flag::f_phonecalls_enabled; } bool has_tmp_sessions() const { return vflags.v & Flag::f_tmp_sessions; } MTPDconfig() { } - MTPDconfig(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, const MTPVector &_disabled_features) : vflags(_flags), vdate(_date), vexpires(_expires), vtest_mode(_test_mode), vthis_dc(_this_dc), vdc_options(_dc_options), vchat_size_max(_chat_size_max), vmegagroup_size_max(_megagroup_size_max), vforwarded_count_max(_forwarded_count_max), vonline_update_period_ms(_online_update_period_ms), voffline_blur_timeout_ms(_offline_blur_timeout_ms), voffline_idle_timeout_ms(_offline_idle_timeout_ms), vonline_cloud_timeout_ms(_online_cloud_timeout_ms), vnotify_cloud_delay_ms(_notify_cloud_delay_ms), vnotify_default_delay_ms(_notify_default_delay_ms), vchat_big_size(_chat_big_size), vpush_chat_period_ms(_push_chat_period_ms), vpush_chat_limit(_push_chat_limit), vsaved_gifs_limit(_saved_gifs_limit), vedit_time_limit(_edit_time_limit), vrating_e_decay(_rating_e_decay), vstickers_recent_limit(_stickers_recent_limit), vtmp_sessions(_tmp_sessions), vdisabled_features(_disabled_features) { + MTPDconfig(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, MTPint _pinned_dialogs_count_max, MTPint _call_receive_timeout_ms, MTPint _call_ring_timeout_ms, MTPint _call_connect_timeout_ms, MTPint _call_packet_timeout_ms, const MTPVector &_disabled_features) : vflags(_flags), vdate(_date), vexpires(_expires), vtest_mode(_test_mode), vthis_dc(_this_dc), vdc_options(_dc_options), vchat_size_max(_chat_size_max), vmegagroup_size_max(_megagroup_size_max), vforwarded_count_max(_forwarded_count_max), vonline_update_period_ms(_online_update_period_ms), voffline_blur_timeout_ms(_offline_blur_timeout_ms), voffline_idle_timeout_ms(_offline_idle_timeout_ms), vonline_cloud_timeout_ms(_online_cloud_timeout_ms), vnotify_cloud_delay_ms(_notify_cloud_delay_ms), vnotify_default_delay_ms(_notify_default_delay_ms), vchat_big_size(_chat_big_size), vpush_chat_period_ms(_push_chat_period_ms), vpush_chat_limit(_push_chat_limit), vsaved_gifs_limit(_saved_gifs_limit), vedit_time_limit(_edit_time_limit), vrating_e_decay(_rating_e_decay), vstickers_recent_limit(_stickers_recent_limit), vtmp_sessions(_tmp_sessions), vpinned_dialogs_count_max(_pinned_dialogs_count_max), vcall_receive_timeout_ms(_call_receive_timeout_ms), vcall_ring_timeout_ms(_call_ring_timeout_ms), vcall_connect_timeout_ms(_call_connect_timeout_ms), vcall_packet_timeout_ms(_call_packet_timeout_ms), vdisabled_features(_disabled_features) { } MTPflags vflags; @@ -12551,6 +13385,11 @@ public: MTPint vrating_e_decay; MTPint vstickers_recent_limit; MTPint vtmp_sessions; + MTPint vpinned_dialogs_count_max; + MTPint vcall_receive_timeout_ms; + MTPint vcall_ring_timeout_ms; + MTPint vcall_connect_timeout_ms; + MTPint vcall_packet_timeout_ms; MTPVector vdisabled_features; }; @@ -13138,8 +13977,9 @@ public: f_duration = (1 << 7), f_author = (1 << 8), f_document = (1 << 9), + f_cached_page = (1 << 10), - MAX_FIELD = (1 << 9), + MAX_FIELD = (1 << 10), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -13156,16 +13996,18 @@ public: bool has_duration() const { return vflags.v & Flag::f_duration; } bool has_author() const { return vflags.v & Flag::f_author; } bool has_document() const { return vflags.v & Flag::f_document; } + bool has_cached_page() const { return vflags.v & Flag::f_cached_page; } MTPDwebPage() { } - MTPDwebPage(const MTPflags &_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) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author), vdocument(_document) { + MTPDwebPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, MTPint _hash, 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, const MTPPage &_cached_page) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vhash(_hash), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author), vdocument(_document), vcached_page(_cached_page) { } MTPflags vflags; MTPlong vid; MTPstring vurl; MTPstring vdisplay_url; + MTPint vhash; MTPstring vtype; MTPstring vsite_name; MTPstring vtitle; @@ -13178,6 +14020,7 @@ public: MTPint vduration; MTPstring vauthor; MTPDocument vdocument; + MTPPage vcached_page; }; class MTPDauthorization : public mtpDataImpl { @@ -13612,10 +14455,12 @@ class MTPDhelp_appChangelog : public mtpDataImpl { public: MTPDhelp_appChangelog() { } - MTPDhelp_appChangelog(const MTPstring &_text) : vtext(_text) { + MTPDhelp_appChangelog(const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) : vmessage(_message), vmedia(_media), ventities(_entities) { } - MTPstring vtext; + MTPstring vmessage; + MTPMessageMedia vmedia; + MTPVector ventities; }; class MTPDmessageEntityUnknown : public mtpDataImpl { @@ -14924,6 +15769,522 @@ public: MTPVector vusers; }; +class MTPDtextPlain : public mtpDataImpl { +public: + MTPDtextPlain() { + } + MTPDtextPlain(const MTPstring &_text) : vtext(_text) { + } + + MTPstring vtext; +}; + +class MTPDtextBold : public mtpDataImpl { +public: + MTPDtextBold() { + } + MTPDtextBold(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDtextItalic : public mtpDataImpl { +public: + MTPDtextItalic() { + } + MTPDtextItalic(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDtextUnderline : public mtpDataImpl { +public: + MTPDtextUnderline() { + } + MTPDtextUnderline(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDtextStrike : public mtpDataImpl { +public: + MTPDtextStrike() { + } + MTPDtextStrike(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDtextFixed : public mtpDataImpl { +public: + MTPDtextFixed() { + } + MTPDtextFixed(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDtextUrl : public mtpDataImpl { +public: + MTPDtextUrl() { + } + MTPDtextUrl(const MTPRichText &_text, const MTPstring &_url, const MTPlong &_webpage_id) : vtext(_text), vurl(_url), vwebpage_id(_webpage_id) { + } + + MTPRichText vtext; + MTPstring vurl; + MTPlong vwebpage_id; +}; + +class MTPDtextEmail : public mtpDataImpl { +public: + MTPDtextEmail() { + } + MTPDtextEmail(const MTPRichText &_text, const MTPstring &_email) : vtext(_text), vemail(_email) { + } + + MTPRichText vtext; + MTPstring vemail; +}; + +class MTPDtextConcat : public mtpDataImpl { +public: + MTPDtextConcat() { + } + MTPDtextConcat(const MTPVector &_texts) : vtexts(_texts) { + } + + MTPVector vtexts; +}; + +class MTPDpageBlockTitle : public mtpDataImpl { +public: + MTPDpageBlockTitle() { + } + MTPDpageBlockTitle(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockSubtitle : public mtpDataImpl { +public: + MTPDpageBlockSubtitle() { + } + MTPDpageBlockSubtitle(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockAuthorDate : public mtpDataImpl { +public: + MTPDpageBlockAuthorDate() { + } + MTPDpageBlockAuthorDate(const MTPRichText &_author, MTPint _published_date) : vauthor(_author), vpublished_date(_published_date) { + } + + MTPRichText vauthor; + MTPint vpublished_date; +}; + +class MTPDpageBlockHeader : public mtpDataImpl { +public: + MTPDpageBlockHeader() { + } + MTPDpageBlockHeader(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockSubheader : public mtpDataImpl { +public: + MTPDpageBlockSubheader() { + } + MTPDpageBlockSubheader(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockParagraph : public mtpDataImpl { +public: + MTPDpageBlockParagraph() { + } + MTPDpageBlockParagraph(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockPreformatted : public mtpDataImpl { +public: + MTPDpageBlockPreformatted() { + } + MTPDpageBlockPreformatted(const MTPRichText &_text, const MTPstring &_language) : vtext(_text), vlanguage(_language) { + } + + MTPRichText vtext; + MTPstring vlanguage; +}; + +class MTPDpageBlockFooter : public mtpDataImpl { +public: + MTPDpageBlockFooter() { + } + MTPDpageBlockFooter(const MTPRichText &_text) : vtext(_text) { + } + + MTPRichText vtext; +}; + +class MTPDpageBlockAnchor : public mtpDataImpl { +public: + MTPDpageBlockAnchor() { + } + MTPDpageBlockAnchor(const MTPstring &_name) : vname(_name) { + } + + MTPstring vname; +}; + +class MTPDpageBlockList : public mtpDataImpl { +public: + MTPDpageBlockList() { + } + MTPDpageBlockList(MTPBool _ordered, const MTPVector &_items) : vordered(_ordered), vitems(_items) { + } + + MTPBool vordered; + MTPVector vitems; +}; + +class MTPDpageBlockBlockquote : public mtpDataImpl { +public: + MTPDpageBlockBlockquote() { + } + MTPDpageBlockBlockquote(const MTPRichText &_text, const MTPRichText &_caption) : vtext(_text), vcaption(_caption) { + } + + MTPRichText vtext; + MTPRichText vcaption; +}; + +class MTPDpageBlockPullquote : public mtpDataImpl { +public: + MTPDpageBlockPullquote() { + } + MTPDpageBlockPullquote(const MTPRichText &_text, const MTPRichText &_caption) : vtext(_text), vcaption(_caption) { + } + + MTPRichText vtext; + MTPRichText vcaption; +}; + +class MTPDpageBlockPhoto : public mtpDataImpl { +public: + MTPDpageBlockPhoto() { + } + MTPDpageBlockPhoto(const MTPlong &_photo_id, const MTPRichText &_caption) : vphoto_id(_photo_id), vcaption(_caption) { + } + + MTPlong vphoto_id; + MTPRichText vcaption; +}; + +class MTPDpageBlockVideo : public mtpDataImpl { +public: + enum class Flag : int32 { + f_autoplay = (1 << 0), + f_loop = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_autoplay() const { return vflags.v & Flag::f_autoplay; } + bool is_loop() const { return vflags.v & Flag::f_loop; } + + MTPDpageBlockVideo() { + } + MTPDpageBlockVideo(const MTPflags &_flags, const MTPlong &_video_id, const MTPRichText &_caption) : vflags(_flags), vvideo_id(_video_id), vcaption(_caption) { + } + + MTPflags vflags; + MTPlong vvideo_id; + MTPRichText vcaption; +}; + +class MTPDpageBlockCover : public mtpDataImpl { +public: + MTPDpageBlockCover() { + } + MTPDpageBlockCover(const MTPPageBlock &_cover) : vcover(_cover) { + } + + MTPPageBlock vcover; +}; + +class MTPDpageBlockEmbed : public mtpDataImpl { +public: + enum class Flag : int32 { + f_full_width = (1 << 0), + f_allow_scrolling = (1 << 3), + f_url = (1 << 1), + f_html = (1 << 2), + f_poster_photo_id = (1 << 4), + + MAX_FIELD = (1 << 4), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_full_width() const { return vflags.v & Flag::f_full_width; } + bool is_allow_scrolling() const { return vflags.v & Flag::f_allow_scrolling; } + bool has_url() const { return vflags.v & Flag::f_url; } + bool has_html() const { return vflags.v & Flag::f_html; } + bool has_poster_photo_id() const { return vflags.v & Flag::f_poster_photo_id; } + + MTPDpageBlockEmbed() { + } + MTPDpageBlockEmbed(const MTPflags &_flags, const MTPstring &_url, const MTPstring &_html, const MTPlong &_poster_photo_id, MTPint _w, MTPint _h, const MTPRichText &_caption) : vflags(_flags), vurl(_url), vhtml(_html), vposter_photo_id(_poster_photo_id), vw(_w), vh(_h), vcaption(_caption) { + } + + MTPflags vflags; + MTPstring vurl; + MTPstring vhtml; + MTPlong vposter_photo_id; + MTPint vw; + MTPint vh; + MTPRichText vcaption; +}; + +class MTPDpageBlockEmbedPost : public mtpDataImpl { +public: + MTPDpageBlockEmbedPost() { + } + MTPDpageBlockEmbedPost(const MTPstring &_url, const MTPlong &_webpage_id, const MTPlong &_author_photo_id, const MTPstring &_author, MTPint _date, const MTPVector &_blocks, const MTPRichText &_caption) : vurl(_url), vwebpage_id(_webpage_id), vauthor_photo_id(_author_photo_id), vauthor(_author), vdate(_date), vblocks(_blocks), vcaption(_caption) { + } + + MTPstring vurl; + MTPlong vwebpage_id; + MTPlong vauthor_photo_id; + MTPstring vauthor; + MTPint vdate; + MTPVector vblocks; + MTPRichText vcaption; +}; + +class MTPDpageBlockCollage : public mtpDataImpl { +public: + MTPDpageBlockCollage() { + } + MTPDpageBlockCollage(const MTPVector &_items, const MTPRichText &_caption) : vitems(_items), vcaption(_caption) { + } + + MTPVector vitems; + MTPRichText vcaption; +}; + +class MTPDpageBlockSlideshow : public mtpDataImpl { +public: + MTPDpageBlockSlideshow() { + } + MTPDpageBlockSlideshow(const MTPVector &_items, const MTPRichText &_caption) : vitems(_items), vcaption(_caption) { + } + + MTPVector vitems; + MTPRichText vcaption; +}; + +class MTPDpagePart : public mtpDataImpl { +public: + MTPDpagePart() { + } + MTPDpagePart(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) : vblocks(_blocks), vphotos(_photos), vvideos(_videos) { + } + + MTPVector vblocks; + MTPVector vphotos; + MTPVector vvideos; +}; + +class MTPDpageFull : public mtpDataImpl { +public: + MTPDpageFull() { + } + MTPDpageFull(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) : vblocks(_blocks), vphotos(_photos), vvideos(_videos) { + } + + MTPVector vblocks; + MTPVector vphotos; + MTPVector vvideos; +}; + +class MTPDinputPhoneCall : public mtpDataImpl { +public: + MTPDinputPhoneCall() { + } + MTPDinputPhoneCall(const MTPlong &_id, const MTPlong &_access_hash) : vid(_id), vaccess_hash(_access_hash) { + } + + MTPlong vid; + MTPlong vaccess_hash; +}; + +class MTPDphoneCallEmpty : public mtpDataImpl { +public: + MTPDphoneCallEmpty() { + } + MTPDphoneCallEmpty(const MTPlong &_id) : vid(_id) { + } + + MTPlong vid; +}; + +class MTPDphoneCallWaiting : public mtpDataImpl { +public: + enum class Flag : int32 { + f_receive_date = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_receive_date() const { return vflags.v & Flag::f_receive_date; } + + MTPDphoneCallWaiting() { + } + MTPDphoneCallWaiting(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPPhoneCallProtocol &_protocol, MTPint _receive_date) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vdate(_date), vadmin_id(_admin_id), vparticipant_id(_participant_id), vprotocol(_protocol), vreceive_date(_receive_date) { + } + + MTPflags vflags; + MTPlong vid; + MTPlong vaccess_hash; + MTPint vdate; + MTPint vadmin_id; + MTPint vparticipant_id; + MTPPhoneCallProtocol vprotocol; + MTPint vreceive_date; +}; + +class MTPDphoneCallRequested : public mtpDataImpl { +public: + MTPDphoneCallRequested() { + } + MTPDphoneCallRequested(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a, const MTPPhoneCallProtocol &_protocol) : vid(_id), vaccess_hash(_access_hash), vdate(_date), vadmin_id(_admin_id), vparticipant_id(_participant_id), vg_a(_g_a), vprotocol(_protocol) { + } + + MTPlong vid; + MTPlong vaccess_hash; + MTPint vdate; + MTPint vadmin_id; + MTPint vparticipant_id; + MTPbytes vg_a; + MTPPhoneCallProtocol vprotocol; +}; + +class MTPDphoneCall : public mtpDataImpl { +public: + MTPDphoneCall() { + } + MTPDphoneCall(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint, const MTPPhoneCallProtocol &_protocol, const MTPPhoneConnection &_connection, const MTPVector &_alternative_connections, MTPint _start_date) : vid(_id), vaccess_hash(_access_hash), vdate(_date), vadmin_id(_admin_id), vparticipant_id(_participant_id), vg_a_or_b(_g_a_or_b), vkey_fingerprint(_key_fingerprint), vprotocol(_protocol), vconnection(_connection), valternative_connections(_alternative_connections), vstart_date(_start_date) { + } + + MTPlong vid; + MTPlong vaccess_hash; + MTPint vdate; + MTPint vadmin_id; + MTPint vparticipant_id; + MTPbytes vg_a_or_b; + MTPlong vkey_fingerprint; + MTPPhoneCallProtocol vprotocol; + MTPPhoneConnection vconnection; + MTPVector valternative_connections; + MTPint vstart_date; +}; + +class MTPDphoneCallDiscarded : public mtpDataImpl { +public: + enum class Flag : int32 { + f_reason = (1 << 0), + f_duration = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reason() const { return vflags.v & Flag::f_reason; } + bool has_duration() const { return vflags.v & Flag::f_duration; } + + MTPDphoneCallDiscarded() { + } + MTPDphoneCallDiscarded(const MTPflags &_flags, const MTPlong &_id, const MTPPhoneCallDiscardReason &_reason, MTPint _duration) : vflags(_flags), vid(_id), vreason(_reason), vduration(_duration) { + } + + MTPflags vflags; + MTPlong vid; + MTPPhoneCallDiscardReason vreason; + MTPint vduration; +}; + +class MTPDphoneConnection : public mtpDataImpl { +public: + MTPDphoneConnection() { + } + MTPDphoneConnection(const MTPlong &_id, const MTPstring &_ip, const MTPstring &_ipv6, MTPint _port, const MTPbytes &_peer_tag) : vid(_id), vip(_ip), vipv6(_ipv6), vport(_port), vpeer_tag(_peer_tag) { + } + + MTPlong vid; + MTPstring vip; + MTPstring vipv6; + MTPint vport; + MTPbytes vpeer_tag; +}; + +class MTPDphoneCallProtocol : public mtpDataImpl { +public: + enum class Flag : int32 { + f_udp_p2p = (1 << 0), + f_udp_reflector = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_udp_p2p() const { return vflags.v & Flag::f_udp_p2p; } + bool is_udp_reflector() const { return vflags.v & Flag::f_udp_reflector; } + + MTPDphoneCallProtocol() { + } + MTPDphoneCallProtocol(const MTPflags &_flags, MTPint _min_layer, MTPint _max_layer) : vflags(_flags), vmin_layer(_min_layer), vmax_layer(_max_layer) { + } + + MTPflags vflags; + MTPint vmin_layer; + MTPint vmax_layer; +}; + +class MTPDphone_phoneCall : public mtpDataImpl { +public: + MTPDphone_phoneCall() { + } + MTPDphone_phoneCall(const MTPPhoneCall &_phone_call, const MTPVector &_users) : vphone_call(_phone_call), vusers(_users) { + } + + MTPPhoneCall vphone_call; + MTPVector vusers; +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -17998,6 +19359,16 @@ public: class MTPmessages_getDialogs { // RPC method 'messages.getDialogs' public: + enum class Flag : int32 { + f_exclude_pinned = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_exclude_pinned() const { return vflags.v & Flag::f_exclude_pinned; } + + MTPflags vflags; MTPint voffset_date; MTPint voffset_id; MTPInputPeer voffset_peer; @@ -18008,22 +19379,24 @@ public: MTPmessages_getDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDialogs) { read(from, end, cons); } - MTPmessages_getDialogs(MTPint _offset_date, MTPint _offset_id, const MTPInputPeer &_offset_peer, MTPint _limit) : voffset_date(_offset_date), voffset_id(_offset_id), voffset_peer(_offset_peer), vlimit(_limit) { + MTPmessages_getDialogs(const MTPflags &_flags, MTPint _offset_date, MTPint _offset_id, const MTPInputPeer &_offset_peer, MTPint _limit) : vflags(_flags), voffset_date(_offset_date), voffset_id(_offset_id), voffset_peer(_offset_peer), vlimit(_limit) { } uint32 innerLength() const { - return voffset_date.innerLength() + voffset_id.innerLength() + voffset_peer.innerLength() + vlimit.innerLength(); + return vflags.innerLength() + voffset_date.innerLength() + voffset_id.innerLength() + voffset_peer.innerLength() + vlimit.innerLength(); } mtpTypeId type() const { return mtpc_messages_getDialogs; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDialogs) { + vflags.read(from, end); voffset_date.read(from, end); voffset_id.read(from, end); voffset_peer.read(from, end); vlimit.read(from, end); } void write(mtpBuffer &to) const { + vflags.write(to); voffset_date.write(to); voffset_id.write(to); voffset_peer.write(to); @@ -18032,6 +19405,8 @@ public: typedef MTPmessages_Dialogs ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_getDialogs::Flags) + class MTPmessages_GetDialogs : public MTPBoxed { public: MTPmessages_GetDialogs() { @@ -18040,7 +19415,7 @@ public: } MTPmessages_GetDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_GetDialogs(MTPint _offset_date, MTPint _offset_id, const MTPInputPeer &_offset_peer, MTPint _limit) : MTPBoxed(MTPmessages_getDialogs(_offset_date, _offset_id, _offset_peer, _limit)) { + MTPmessages_GetDialogs(const MTPflags &_flags, MTPint _offset_date, MTPint _offset_id, const MTPInputPeer &_offset_peer, MTPint _limit) : MTPBoxed(MTPmessages_getDialogs(_flags, _offset_date, _offset_id, _offset_peer, _limit)) { } }; @@ -21373,12 +22748,15 @@ class MTPmessages_setGameScore { // RPC method 'messages.setGameScore' public: enum class Flag : int32 { f_edit_message = (1 << 0), - MAX_FIELD = (1 << 0), + f_force = (1 << 1), + + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } bool is_edit_message() const { return vflags.v & Flag::f_edit_message; } + bool is_force() const { return vflags.v & Flag::f_force; } MTPflags vflags; MTPInputPeer vpeer; @@ -21435,12 +22813,15 @@ class MTPmessages_setInlineGameScore { // RPC method 'messages.setInlineGameScor public: enum class Flag : int32 { f_edit_message = (1 << 0), - MAX_FIELD = (1 << 0), + f_force = (1 << 1), + + MAX_FIELD = (1 << 1), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } bool is_edit_message() const { return vflags.v & Flag::f_edit_message; } + bool is_force() const { return vflags.v & Flag::f_force; } MTPflags vflags; MTPInputBotInlineMessageID vid; @@ -21661,6 +23042,185 @@ public: } }; +class MTPmessages_getWebPage { // RPC method 'messages.getWebPage' +public: + MTPstring vurl; + MTPint vhash; + + MTPmessages_getWebPage() { + } + MTPmessages_getWebPage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getWebPage) { + read(from, end, cons); + } + MTPmessages_getWebPage(const MTPstring &_url, MTPint _hash) : vurl(_url), vhash(_hash) { + } + + uint32 innerLength() const { + return vurl.innerLength() + vhash.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_getWebPage; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getWebPage) { + vurl.read(from, end); + vhash.read(from, end); + } + void write(mtpBuffer &to) const { + vurl.write(to); + vhash.write(to); + } + + typedef MTPWebPage ResponseType; +}; +class MTPmessages_GetWebPage : public MTPBoxed { +public: + MTPmessages_GetWebPage() { + } + MTPmessages_GetWebPage(const MTPmessages_getWebPage &v) : MTPBoxed(v) { + } + MTPmessages_GetWebPage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_GetWebPage(const MTPstring &_url, MTPint _hash) : MTPBoxed(MTPmessages_getWebPage(_url, _hash)) { + } +}; + +class MTPmessages_toggleDialogPin { // RPC method 'messages.toggleDialogPin' +public: + enum class Flag : int32 { + f_pinned = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_pinned() const { return vflags.v & Flag::f_pinned; } + + MTPflags vflags; + MTPInputPeer vpeer; + + MTPmessages_toggleDialogPin() { + } + MTPmessages_toggleDialogPin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_toggleDialogPin) { + read(from, end, cons); + } + MTPmessages_toggleDialogPin(const MTPflags &_flags, const MTPInputPeer &_peer) : vflags(_flags), vpeer(_peer) { + } + + uint32 innerLength() const { + return vflags.innerLength() + vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_toggleDialogPin; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_toggleDialogPin) { + vflags.read(from, end); + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vflags.write(to); + vpeer.write(to); + } + + typedef MTPBool ResponseType; +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_toggleDialogPin::Flags) + +class MTPmessages_ToggleDialogPin : public MTPBoxed { +public: + MTPmessages_ToggleDialogPin() { + } + MTPmessages_ToggleDialogPin(const MTPmessages_toggleDialogPin &v) : MTPBoxed(v) { + } + MTPmessages_ToggleDialogPin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_ToggleDialogPin(const MTPflags &_flags, const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_toggleDialogPin(_flags, _peer)) { + } +}; + +class MTPmessages_reorderPinnedDialogs { // RPC method 'messages.reorderPinnedDialogs' +public: + enum class Flag : int32 { + f_force = (1 << 0), + MAX_FIELD = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_force() const { return vflags.v & Flag::f_force; } + + MTPflags vflags; + MTPVector vorder; + + MTPmessages_reorderPinnedDialogs() { + } + MTPmessages_reorderPinnedDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reorderPinnedDialogs) { + read(from, end, cons); + } + MTPmessages_reorderPinnedDialogs(const MTPflags &_flags, const MTPVector &_order) : vflags(_flags), vorder(_order) { + } + + uint32 innerLength() const { + return vflags.innerLength() + vorder.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_reorderPinnedDialogs; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reorderPinnedDialogs) { + vflags.read(from, end); + vorder.read(from, end); + } + void write(mtpBuffer &to) const { + vflags.write(to); + vorder.write(to); + } + + typedef MTPBool ResponseType; +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_reorderPinnedDialogs::Flags) + +class MTPmessages_ReorderPinnedDialogs : public MTPBoxed { +public: + MTPmessages_ReorderPinnedDialogs() { + } + MTPmessages_ReorderPinnedDialogs(const MTPmessages_reorderPinnedDialogs &v) : MTPBoxed(v) { + } + MTPmessages_ReorderPinnedDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_ReorderPinnedDialogs(const MTPflags &_flags, const MTPVector &_order) : MTPBoxed(MTPmessages_reorderPinnedDialogs(_flags, _order)) { + } +}; + +class MTPmessages_getPinnedDialogs { // RPC method 'messages.getPinnedDialogs' +public: + MTPmessages_getPinnedDialogs() { + } + MTPmessages_getPinnedDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getPinnedDialogs) { + read(from, end, cons); + } + + uint32 innerLength() const { + return 0; + } + mtpTypeId type() const { + return mtpc_messages_getPinnedDialogs; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getPinnedDialogs) { + } + void write(mtpBuffer &to) const { + } + + typedef MTPmessages_PeerDialogs ResponseType; +}; +class MTPmessages_GetPinnedDialogs : public MTPBoxed { +public: + MTPmessages_GetPinnedDialogs() { + } + MTPmessages_GetPinnedDialogs(const MTPmessages_getPinnedDialogs &v) : MTPBoxed(v) { + } + MTPmessages_GetPinnedDialogs(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } +}; + class MTPupdates_getState { // RPC method 'updates.getState' public: MTPupdates_getState() { @@ -23568,6 +25128,189 @@ public: } }; +class MTPphone_requestCall { // RPC method 'phone.requestCall' +public: + MTPInputUser vuser_id; + MTPint vrandom_id; + MTPbytes vg_a; + MTPPhoneCallProtocol vprotocol; + + MTPphone_requestCall() { + } + MTPphone_requestCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_requestCall) { + read(from, end, cons); + } + MTPphone_requestCall(const MTPInputUser &_user_id, MTPint _random_id, const MTPbytes &_g_a, const MTPPhoneCallProtocol &_protocol) : vuser_id(_user_id), vrandom_id(_random_id), vg_a(_g_a), vprotocol(_protocol) { + } + + uint32 innerLength() const { + return vuser_id.innerLength() + vrandom_id.innerLength() + vg_a.innerLength() + vprotocol.innerLength(); + } + mtpTypeId type() const { + return mtpc_phone_requestCall; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_requestCall) { + vuser_id.read(from, end); + vrandom_id.read(from, end); + vg_a.read(from, end); + vprotocol.read(from, end); + } + void write(mtpBuffer &to) const { + vuser_id.write(to); + vrandom_id.write(to); + vg_a.write(to); + vprotocol.write(to); + } + + typedef MTPphone_PhoneCall ResponseType; +}; +class MTPphone_RequestCall : public MTPBoxed { +public: + MTPphone_RequestCall() { + } + MTPphone_RequestCall(const MTPphone_requestCall &v) : MTPBoxed(v) { + } + MTPphone_RequestCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphone_RequestCall(const MTPInputUser &_user_id, MTPint _random_id, const MTPbytes &_g_a, const MTPPhoneCallProtocol &_protocol) : MTPBoxed(MTPphone_requestCall(_user_id, _random_id, _g_a, _protocol)) { + } +}; + +class MTPphone_acceptCall { // RPC method 'phone.acceptCall' +public: + MTPInputPhoneCall vpeer; + MTPbytes vg_b; + MTPlong vkey_fingerprint; + MTPPhoneCallProtocol vprotocol; + + MTPphone_acceptCall() { + } + MTPphone_acceptCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_acceptCall) { + read(from, end, cons); + } + MTPphone_acceptCall(const MTPInputPhoneCall &_peer, const MTPbytes &_g_b, const MTPlong &_key_fingerprint, const MTPPhoneCallProtocol &_protocol) : vpeer(_peer), vg_b(_g_b), vkey_fingerprint(_key_fingerprint), vprotocol(_protocol) { + } + + uint32 innerLength() const { + return vpeer.innerLength() + vg_b.innerLength() + vkey_fingerprint.innerLength() + vprotocol.innerLength(); + } + mtpTypeId type() const { + return mtpc_phone_acceptCall; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_acceptCall) { + vpeer.read(from, end); + vg_b.read(from, end); + vkey_fingerprint.read(from, end); + vprotocol.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + vg_b.write(to); + vkey_fingerprint.write(to); + vprotocol.write(to); + } + + typedef MTPphone_PhoneCall ResponseType; +}; +class MTPphone_AcceptCall : public MTPBoxed { +public: + MTPphone_AcceptCall() { + } + MTPphone_AcceptCall(const MTPphone_acceptCall &v) : MTPBoxed(v) { + } + MTPphone_AcceptCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphone_AcceptCall(const MTPInputPhoneCall &_peer, const MTPbytes &_g_b, const MTPlong &_key_fingerprint, const MTPPhoneCallProtocol &_protocol) : MTPBoxed(MTPphone_acceptCall(_peer, _g_b, _key_fingerprint, _protocol)) { + } +}; + +class MTPphone_discardCall { // RPC method 'phone.discardCall' +public: + MTPInputPhoneCall vpeer; + MTPint vduration; + MTPPhoneCallDiscardReason vreason; + MTPlong vconnection_id; + + MTPphone_discardCall() { + } + MTPphone_discardCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_discardCall) { + read(from, end, cons); + } + MTPphone_discardCall(const MTPInputPhoneCall &_peer, MTPint _duration, const MTPPhoneCallDiscardReason &_reason, const MTPlong &_connection_id) : vpeer(_peer), vduration(_duration), vreason(_reason), vconnection_id(_connection_id) { + } + + uint32 innerLength() const { + return vpeer.innerLength() + vduration.innerLength() + vreason.innerLength() + vconnection_id.innerLength(); + } + mtpTypeId type() const { + return mtpc_phone_discardCall; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_discardCall) { + vpeer.read(from, end); + vduration.read(from, end); + vreason.read(from, end); + vconnection_id.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + vduration.write(to); + vreason.write(to); + vconnection_id.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPphone_DiscardCall : public MTPBoxed { +public: + MTPphone_DiscardCall() { + } + MTPphone_DiscardCall(const MTPphone_discardCall &v) : MTPBoxed(v) { + } + MTPphone_DiscardCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphone_DiscardCall(const MTPInputPhoneCall &_peer, MTPint _duration, const MTPPhoneCallDiscardReason &_reason, const MTPlong &_connection_id) : MTPBoxed(MTPphone_discardCall(_peer, _duration, _reason, _connection_id)) { + } +}; + +class MTPphone_receivedCall { // RPC method 'phone.receivedCall' +public: + MTPInputPhoneCall vpeer; + + MTPphone_receivedCall() { + } + MTPphone_receivedCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_receivedCall) { + read(from, end, cons); + } + MTPphone_receivedCall(const MTPInputPhoneCall &_peer) : vpeer(_peer) { + } + + uint32 innerLength() const { + return vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_phone_receivedCall; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_phone_receivedCall) { + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPphone_ReceivedCall : public MTPBoxed { +public: + MTPphone_ReceivedCall() { + } + MTPphone_ReceivedCall(const MTPphone_receivedCall &v) : MTPBoxed(v) { + } + MTPphone_ReceivedCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPphone_ReceivedCall(const MTPInputPhoneCall &_peer) : MTPBoxed(MTPphone_receivedCall(_peer)) { + } +}; + // Creator proxy class definition namespace MTP { namespace internal { @@ -24117,8 +25860,8 @@ public: inline static MTPmessages_chats new_messages_chats(const MTPVector &_chats) { return MTPmessages_chats(new MTPDmessages_chats(_chats)); } - inline static MTPmessages_chats new_messages_chatsSlice(MTPint _count, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_chats(new MTPDmessages_chatsSlice(_count, _chats, _users)); + inline static MTPmessages_chats new_messages_chatsSlice(MTPint _count, const MTPVector &_chats) { + return MTPmessages_chats(new MTPDmessages_chatsSlice(_count, _chats)); } inline static MTPmessages_chatFull new_messages_chatFull(const MTPChatFull &_full_chat, const MTPVector &_chats, const MTPVector &_users) { return MTPmessages_chatFull(new MTPDmessages_chatFull(_full_chat, _chats, _users)); @@ -24192,9 +25935,6 @@ public: inline static MTPupdate new_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link) { return MTPupdate(new MTPDupdateContactLink(_user_id, _my_link, _foreign_link)); } - inline static MTPupdate new_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) { - return MTPupdate(new MTPDupdateNewAuthorization(_auth_key_id, _date, _device, _location)); - } inline static MTPupdate new_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts) { return MTPupdate(new MTPDupdateNewEncryptedMessage(_message, _qts)); } @@ -24222,8 +25962,8 @@ public: inline static MTPupdate new_updateNotifySettings(const MTPNotifyPeer &_peer, const MTPPeerNotifySettings &_notify_settings) { return MTPupdate(new MTPDupdateNotifySettings(_peer, _notify_settings)); } - inline static MTPupdate new_updateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup) { - return MTPupdate(new MTPDupdateServiceNotification(_type, _message, _media, _popup)); + inline static MTPupdate new_updateServiceNotification(const MTPflags &_flags, MTPint _inbox_date, const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTPupdate(new MTPDupdateServiceNotification(_flags, _inbox_date, _type, _message, _media, _entities)); } inline static MTPupdate new_updatePrivacy(const MTPPrivacyKey &_key, const MTPVector &_rules) { return MTPupdate(new MTPDupdatePrivacy(_key, _rules)); @@ -24321,6 +26061,15 @@ public: inline static MTPupdate new_updateChannelWebPage(MTPint _channel_id, const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateChannelWebPage(_channel_id, _webpage, _pts, _pts_count)); } + inline static MTPupdate new_updatePhoneCall(const MTPPhoneCall &_phone_call) { + return MTPupdate(new MTPDupdatePhoneCall(_phone_call)); + } + inline static MTPupdate new_updateDialogPinned(const MTPflags &_flags, const MTPPeer &_peer) { + return MTPupdate(new MTPDupdateDialogPinned(_flags, _peer)); + } + inline static MTPupdate new_updatePinnedDialogs(const MTPflags &_flags, const MTPVector &_order) { + return MTPupdate(new MTPDupdatePinnedDialogs(_flags, _order)); + } inline static MTPupdates_state new_updates_state(MTPint _pts, MTPint _qts, MTPint _date, MTPint _seq, MTPint _unread_count) { return MTPupdates_state(new MTPDupdates_state(_pts, _qts, _date, _seq, _unread_count)); } @@ -24372,8 +26121,8 @@ public: inline static MTPdcOption new_dcOption(const MTPflags &_flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) { return MTPdcOption(new MTPDdcOption(_flags, _id, _ip_address, _port)); } - inline static MTPconfig new_config(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, const MTPVector &_disabled_features) { - return MTPconfig(new MTPDconfig(_flags, _date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _rating_e_decay, _stickers_recent_limit, _tmp_sessions, _disabled_features)); + inline static MTPconfig new_config(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, MTPint _pinned_dialogs_count_max, MTPint _call_receive_timeout_ms, MTPint _call_ring_timeout_ms, MTPint _call_connect_timeout_ms, MTPint _call_packet_timeout_ms, const MTPVector &_disabled_features) { + return MTPconfig(new MTPDconfig(_flags, _date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _rating_e_decay, _stickers_recent_limit, _tmp_sessions, _pinned_dialogs_count_max, _call_receive_timeout_ms, _call_ring_timeout_ms, _call_connect_timeout_ms, _call_packet_timeout_ms, _disabled_features)); } inline static MTPnearestDc new_nearestDc(const MTPstring &_country, MTPint _this_dc, MTPint _nearest_dc) { return MTPnearestDc(new MTPDnearestDc(_country, _this_dc, _nearest_dc)); @@ -24498,6 +26247,9 @@ public: inline static MTPsendMessageAction new_sendMessageChooseContactAction() { return MTPsendMessageAction(mtpc_sendMessageChooseContactAction); } + inline static MTPsendMessageAction new_sendMessageGamePlayAction() { + return MTPsendMessageAction(mtpc_sendMessageGamePlayAction); + } inline static MTPcontacts_found new_contacts_found(const MTPVector &_results, const MTPVector &_chats, const MTPVector &_users) { return MTPcontacts_found(new MTPDcontacts_found(_results, _chats, _users)); } @@ -24507,12 +26259,18 @@ public: inline static MTPinputPrivacyKey new_inputPrivacyKeyChatInvite() { return MTPinputPrivacyKey(mtpc_inputPrivacyKeyChatInvite); } + inline static MTPinputPrivacyKey new_inputPrivacyKeyPhoneCall() { + return MTPinputPrivacyKey(mtpc_inputPrivacyKeyPhoneCall); + } inline static MTPprivacyKey new_privacyKeyStatusTimestamp() { return MTPprivacyKey(mtpc_privacyKeyStatusTimestamp); } inline static MTPprivacyKey new_privacyKeyChatInvite() { return MTPprivacyKey(mtpc_privacyKeyChatInvite); } + inline static MTPprivacyKey new_privacyKeyPhoneCall() { + return MTPprivacyKey(mtpc_privacyKeyPhoneCall); + } inline static MTPinputPrivacyRule new_inputPrivacyValueAllowContacts() { return MTPinputPrivacyRule(mtpc_inputPrivacyValueAllowContacts); } @@ -24615,8 +26373,11 @@ public: inline static MTPwebPage new_webPagePending(const MTPlong &_id, MTPint _date) { return MTPwebPage(new MTPDwebPagePending(_id, _date)); } - inline static MTPwebPage new_webPage(const MTPflags &_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 static MTPwebPage new_webPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, MTPint _hash, 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, const MTPPage &_cached_page) { + return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _hash, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document, _cached_page)); + } + inline static MTPwebPage new_webPageNotModified() { + return MTPwebPage(mtpc_webPageNotModified); } inline static MTPauthorization new_authorization(const MTPlong &_hash, MTPint _flags, const MTPstring &_device_model, const MTPstring &_platform, const MTPstring &_system_version, MTPint _api_id, const MTPstring &_app_name, const MTPstring &_app_version, MTPint _date_created, MTPint _date_active, const MTPstring &_ip, const MTPstring &_country, const MTPstring &_region) { return MTPauthorization(new MTPDauthorization(_hash, _flags, _device_model, _platform, _system_version, _api_id, _app_name, _app_version, _date_created, _date_active, _ip, _country, _region)); @@ -24714,8 +26475,8 @@ public: inline static MTPhelp_appChangelog new_help_appChangelogEmpty() { return MTPhelp_appChangelog(mtpc_help_appChangelogEmpty); } - inline static MTPhelp_appChangelog new_help_appChangelog(const MTPstring &_text) { - return MTPhelp_appChangelog(new MTPDhelp_appChangelog(_text)); + inline static MTPhelp_appChangelog new_help_appChangelog(const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTPhelp_appChangelog(new MTPDhelp_appChangelog(_message, _media, _entities)); } inline static MTPmessageEntity new_messageEntityUnknown(MTPint _offset, MTPint _length) { return MTPmessageEntity(new MTPDmessageEntityUnknown(_offset, _length)); @@ -25026,6 +26787,144 @@ public: inline static MTPmessages_highScores new_messages_highScores(const MTPVector &_scores, const MTPVector &_users) { return MTPmessages_highScores(new MTPDmessages_highScores(_scores, _users)); } + inline static MTPrichText new_textEmpty() { + return MTPrichText(mtpc_textEmpty); + } + inline static MTPrichText new_textPlain(const MTPstring &_text) { + return MTPrichText(new MTPDtextPlain(_text)); + } + inline static MTPrichText new_textBold(const MTPRichText &_text) { + return MTPrichText(new MTPDtextBold(_text)); + } + inline static MTPrichText new_textItalic(const MTPRichText &_text) { + return MTPrichText(new MTPDtextItalic(_text)); + } + inline static MTPrichText new_textUnderline(const MTPRichText &_text) { + return MTPrichText(new MTPDtextUnderline(_text)); + } + inline static MTPrichText new_textStrike(const MTPRichText &_text) { + return MTPrichText(new MTPDtextStrike(_text)); + } + inline static MTPrichText new_textFixed(const MTPRichText &_text) { + return MTPrichText(new MTPDtextFixed(_text)); + } + inline static MTPrichText new_textUrl(const MTPRichText &_text, const MTPstring &_url, const MTPlong &_webpage_id) { + return MTPrichText(new MTPDtextUrl(_text, _url, _webpage_id)); + } + inline static MTPrichText new_textEmail(const MTPRichText &_text, const MTPstring &_email) { + return MTPrichText(new MTPDtextEmail(_text, _email)); + } + inline static MTPrichText new_textConcat(const MTPVector &_texts) { + return MTPrichText(new MTPDtextConcat(_texts)); + } + inline static MTPpageBlock new_pageBlockUnsupported() { + return MTPpageBlock(mtpc_pageBlockUnsupported); + } + inline static MTPpageBlock new_pageBlockTitle(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockTitle(_text)); + } + inline static MTPpageBlock new_pageBlockSubtitle(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockSubtitle(_text)); + } + inline static MTPpageBlock new_pageBlockAuthorDate(const MTPRichText &_author, MTPint _published_date) { + return MTPpageBlock(new MTPDpageBlockAuthorDate(_author, _published_date)); + } + inline static MTPpageBlock new_pageBlockHeader(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockHeader(_text)); + } + inline static MTPpageBlock new_pageBlockSubheader(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockSubheader(_text)); + } + inline static MTPpageBlock new_pageBlockParagraph(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockParagraph(_text)); + } + inline static MTPpageBlock new_pageBlockPreformatted(const MTPRichText &_text, const MTPstring &_language) { + return MTPpageBlock(new MTPDpageBlockPreformatted(_text, _language)); + } + inline static MTPpageBlock new_pageBlockFooter(const MTPRichText &_text) { + return MTPpageBlock(new MTPDpageBlockFooter(_text)); + } + inline static MTPpageBlock new_pageBlockDivider() { + return MTPpageBlock(mtpc_pageBlockDivider); + } + inline static MTPpageBlock new_pageBlockAnchor(const MTPstring &_name) { + return MTPpageBlock(new MTPDpageBlockAnchor(_name)); + } + inline static MTPpageBlock new_pageBlockList(MTPBool _ordered, const MTPVector &_items) { + return MTPpageBlock(new MTPDpageBlockList(_ordered, _items)); + } + inline static MTPpageBlock new_pageBlockBlockquote(const MTPRichText &_text, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockBlockquote(_text, _caption)); + } + inline static MTPpageBlock new_pageBlockPullquote(const MTPRichText &_text, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockPullquote(_text, _caption)); + } + inline static MTPpageBlock new_pageBlockPhoto(const MTPlong &_photo_id, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockPhoto(_photo_id, _caption)); + } + inline static MTPpageBlock new_pageBlockVideo(const MTPflags &_flags, const MTPlong &_video_id, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockVideo(_flags, _video_id, _caption)); + } + inline static MTPpageBlock new_pageBlockCover(const MTPPageBlock &_cover) { + return MTPpageBlock(new MTPDpageBlockCover(_cover)); + } + inline static MTPpageBlock new_pageBlockEmbed(const MTPflags &_flags, const MTPstring &_url, const MTPstring &_html, const MTPlong &_poster_photo_id, MTPint _w, MTPint _h, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockEmbed(_flags, _url, _html, _poster_photo_id, _w, _h, _caption)); + } + inline static MTPpageBlock new_pageBlockEmbedPost(const MTPstring &_url, const MTPlong &_webpage_id, const MTPlong &_author_photo_id, const MTPstring &_author, MTPint _date, const MTPVector &_blocks, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockEmbedPost(_url, _webpage_id, _author_photo_id, _author, _date, _blocks, _caption)); + } + inline static MTPpageBlock new_pageBlockCollage(const MTPVector &_items, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockCollage(_items, _caption)); + } + inline static MTPpageBlock new_pageBlockSlideshow(const MTPVector &_items, const MTPRichText &_caption) { + return MTPpageBlock(new MTPDpageBlockSlideshow(_items, _caption)); + } + inline static MTPpage new_pagePart(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) { + return MTPpage(new MTPDpagePart(_blocks, _photos, _videos)); + } + inline static MTPpage new_pageFull(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) { + return MTPpage(new MTPDpageFull(_blocks, _photos, _videos)); + } + inline static MTPinputPhoneCall new_inputPhoneCall(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputPhoneCall(new MTPDinputPhoneCall(_id, _access_hash)); + } + inline static MTPphoneCall new_phoneCallEmpty(const MTPlong &_id) { + return MTPphoneCall(new MTPDphoneCallEmpty(_id)); + } + inline static MTPphoneCall new_phoneCallWaiting(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPPhoneCallProtocol &_protocol, MTPint _receive_date) { + return MTPphoneCall(new MTPDphoneCallWaiting(_flags, _id, _access_hash, _date, _admin_id, _participant_id, _protocol, _receive_date)); + } + inline static MTPphoneCall new_phoneCallRequested(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a, const MTPPhoneCallProtocol &_protocol) { + return MTPphoneCall(new MTPDphoneCallRequested(_id, _access_hash, _date, _admin_id, _participant_id, _g_a, _protocol)); + } + inline static MTPphoneCall new_phoneCall(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint, const MTPPhoneCallProtocol &_protocol, const MTPPhoneConnection &_connection, const MTPVector &_alternative_connections, MTPint _start_date) { + return MTPphoneCall(new MTPDphoneCall(_id, _access_hash, _date, _admin_id, _participant_id, _g_a_or_b, _key_fingerprint, _protocol, _connection, _alternative_connections, _start_date)); + } + inline static MTPphoneCall new_phoneCallDiscarded(const MTPflags &_flags, const MTPlong &_id, const MTPPhoneCallDiscardReason &_reason, MTPint _duration) { + return MTPphoneCall(new MTPDphoneCallDiscarded(_flags, _id, _reason, _duration)); + } + inline static MTPphoneConnection new_phoneConnection(const MTPlong &_id, const MTPstring &_ip, const MTPstring &_ipv6, MTPint _port, const MTPbytes &_peer_tag) { + return MTPphoneConnection(new MTPDphoneConnection(_id, _ip, _ipv6, _port, _peer_tag)); + } + inline static MTPphoneCallProtocol new_phoneCallProtocol(const MTPflags &_flags, MTPint _min_layer, MTPint _max_layer) { + return MTPphoneCallProtocol(new MTPDphoneCallProtocol(_flags, _min_layer, _max_layer)); + } + inline static MTPphone_phoneCall new_phone_phoneCall(const MTPPhoneCall &_phone_call, const MTPVector &_users) { + return MTPphone_phoneCall(new MTPDphone_phoneCall(_phone_call, _users)); + } + inline static MTPphoneCallDiscardReason new_phoneCallDiscardReasonMissed() { + return MTPphoneCallDiscardReason(mtpc_phoneCallDiscardReasonMissed); + } + inline static MTPphoneCallDiscardReason new_phoneCallDiscardReasonDisconnect() { + return MTPphoneCallDiscardReason(mtpc_phoneCallDiscardReasonDisconnect); + } + inline static MTPphoneCallDiscardReason new_phoneCallDiscardReasonHangup() { + return MTPphoneCallDiscardReason(mtpc_phoneCallDiscardReasonHangup); + } + inline static MTPphoneCallDiscardReason new_phoneCallDiscardReasonBusy() { + return MTPphoneCallDiscardReason(mtpc_phoneCallDiscardReasonBusy); + } }; } // namespace internal @@ -29634,7 +31533,7 @@ inline uint32 MTPmessages_chats::innerLength() const { } case mtpc_messages_chatsSlice: { const MTPDmessages_chatsSlice &v(c_messages_chatsSlice()); - return v.vcount.innerLength() + v.vchats.innerLength() + v.vusers.innerLength(); + return v.vcount.innerLength() + v.vchats.innerLength(); } } return 0; @@ -29656,7 +31555,6 @@ inline void MTPmessages_chats::read(const mtpPrime *&from, const mtpPrime *end, MTPDmessages_chatsSlice &v(_messages_chatsSlice()); v.vcount.read(from, end); v.vchats.read(from, end); - v.vusers.read(from, end); } break; default: throw mtpErrorUnexpected(cons, "MTPmessages_chats"); } @@ -29671,7 +31569,6 @@ inline void MTPmessages_chats::write(mtpBuffer &to) const { const MTPDmessages_chatsSlice &v(c_messages_chatsSlice()); v.vcount.write(to); v.vchats.write(to); - v.vusers.write(to); } break; } } @@ -29689,8 +31586,8 @@ inline MTPmessages_chats::MTPmessages_chats(MTPDmessages_chatsSlice *_data) : mt inline MTPmessages_chats MTP_messages_chats(const MTPVector &_chats) { return MTP::internal::TypeCreator::new_messages_chats(_chats); } -inline MTPmessages_chats MTP_messages_chatsSlice(MTPint _count, const MTPVector &_chats, const MTPVector &_users) { - return MTP::internal::TypeCreator::new_messages_chatsSlice(_count, _chats, _users); +inline MTPmessages_chats MTP_messages_chatsSlice(MTPint _count, const MTPVector &_chats) { + return MTP::internal::TypeCreator::new_messages_chatsSlice(_count, _chats); } inline MTPmessages_chatFull::MTPmessages_chatFull() : mtpDataOwner(new MTPDmessages_chatFull()) { @@ -29876,10 +31773,6 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateContactLink &v(c_updateContactLink()); return v.vuser_id.innerLength() + v.vmy_link.innerLength() + v.vforeign_link.innerLength(); } - case mtpc_updateNewAuthorization: { - const MTPDupdateNewAuthorization &v(c_updateNewAuthorization()); - return v.vauth_key_id.innerLength() + v.vdate.innerLength() + v.vdevice.innerLength() + v.vlocation.innerLength(); - } case mtpc_updateNewEncryptedMessage: { const MTPDupdateNewEncryptedMessage &v(c_updateNewEncryptedMessage()); return v.vmessage.innerLength() + v.vqts.innerLength(); @@ -29918,7 +31811,7 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateServiceNotification: { const MTPDupdateServiceNotification &v(c_updateServiceNotification()); - return v.vtype.innerLength() + v.vmessage.innerLength() + v.vmedia.innerLength() + v.vpopup.innerLength(); + return v.vflags.innerLength() + (v.has_inbox_date() ? v.vinbox_date.innerLength() : 0) + v.vtype.innerLength() + v.vmessage.innerLength() + v.vmedia.innerLength() + v.ventities.innerLength(); } case mtpc_updatePrivacy: { const MTPDupdatePrivacy &v(c_updatePrivacy()); @@ -30024,6 +31917,18 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateChannelWebPage &v(c_updateChannelWebPage()); return v.vchannel_id.innerLength() + v.vwebpage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); } + case mtpc_updatePhoneCall: { + const MTPDupdatePhoneCall &v(c_updatePhoneCall()); + return v.vphone_call.innerLength(); + } + case mtpc_updateDialogPinned: { + const MTPDupdateDialogPinned &v(c_updateDialogPinned()); + return v.vflags.innerLength() + v.vpeer.innerLength(); + } + case mtpc_updatePinnedDialogs: { + const MTPDupdatePinnedDialogs &v(c_updatePinnedDialogs()); + return v.vflags.innerLength() + (v.has_order() ? v.vorder.innerLength() : 0); + } } return 0; } @@ -30107,14 +32012,6 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vmy_link.read(from, end); v.vforeign_link.read(from, end); } break; - case mtpc_updateNewAuthorization: _type = cons; { - if (!data) setData(new MTPDupdateNewAuthorization()); - MTPDupdateNewAuthorization &v(_updateNewAuthorization()); - v.vauth_key_id.read(from, end); - v.vdate.read(from, end); - v.vdevice.read(from, end); - v.vlocation.read(from, end); - } break; case mtpc_updateNewEncryptedMessage: _type = cons; { if (!data) setData(new MTPDupdateNewEncryptedMessage()); MTPDupdateNewEncryptedMessage &v(_updateNewEncryptedMessage()); @@ -30175,10 +32072,12 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI case mtpc_updateServiceNotification: _type = cons; { if (!data) setData(new MTPDupdateServiceNotification()); MTPDupdateServiceNotification &v(_updateServiceNotification()); + v.vflags.read(from, end); + if (v.has_inbox_date()) { v.vinbox_date.read(from, end); } else { v.vinbox_date = MTPint(); } v.vtype.read(from, end); v.vmessage.read(from, end); v.vmedia.read(from, end); - v.vpopup.read(from, end); + v.ventities.read(from, end); } break; case mtpc_updatePrivacy: _type = cons; { if (!data) setData(new MTPDupdatePrivacy()); @@ -30377,6 +32276,23 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vpts.read(from, end); v.vpts_count.read(from, end); } break; + case mtpc_updatePhoneCall: _type = cons; { + if (!data) setData(new MTPDupdatePhoneCall()); + MTPDupdatePhoneCall &v(_updatePhoneCall()); + v.vphone_call.read(from, end); + } break; + case mtpc_updateDialogPinned: _type = cons; { + if (!data) setData(new MTPDupdateDialogPinned()); + MTPDupdateDialogPinned &v(_updateDialogPinned()); + v.vflags.read(from, end); + v.vpeer.read(from, end); + } break; + case mtpc_updatePinnedDialogs: _type = cons; { + if (!data) setData(new MTPDupdatePinnedDialogs()); + MTPDupdatePinnedDialogs &v(_updatePinnedDialogs()); + v.vflags.read(from, end); + if (v.has_order()) { v.vorder.read(from, end); } else { v.vorder = MTPVector(); } + } break; default: throw mtpErrorUnexpected(cons, "MTPupdate"); } } @@ -30444,13 +32360,6 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vmy_link.write(to); v.vforeign_link.write(to); } break; - case mtpc_updateNewAuthorization: { - const MTPDupdateNewAuthorization &v(c_updateNewAuthorization()); - v.vauth_key_id.write(to); - v.vdate.write(to); - v.vdevice.write(to); - v.vlocation.write(to); - } break; case mtpc_updateNewEncryptedMessage: { const MTPDupdateNewEncryptedMessage &v(c_updateNewEncryptedMessage()); v.vmessage.write(to); @@ -30501,10 +32410,12 @@ inline void MTPupdate::write(mtpBuffer &to) const { } break; case mtpc_updateServiceNotification: { const MTPDupdateServiceNotification &v(c_updateServiceNotification()); + v.vflags.write(to); + if (v.has_inbox_date()) v.vinbox_date.write(to); v.vtype.write(to); v.vmessage.write(to); v.vmedia.write(to); - v.vpopup.write(to); + v.ventities.write(to); } break; case mtpc_updatePrivacy: { const MTPDupdatePrivacy &v(c_updatePrivacy()); @@ -30671,6 +32582,20 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vpts.write(to); v.vpts_count.write(to); } break; + case mtpc_updatePhoneCall: { + const MTPDupdatePhoneCall &v(c_updatePhoneCall()); + v.vphone_call.write(to); + } break; + case mtpc_updateDialogPinned: { + const MTPDupdateDialogPinned &v(c_updateDialogPinned()); + v.vflags.write(to); + v.vpeer.write(to); + } break; + case mtpc_updatePinnedDialogs: { + const MTPDupdatePinnedDialogs &v(c_updatePinnedDialogs()); + v.vflags.write(to); + if (v.has_order()) v.vorder.write(to); + } break; } } inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -30686,7 +32611,6 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateUserPhoto: setData(new MTPDupdateUserPhoto()); break; case mtpc_updateContactRegistered: setData(new MTPDupdateContactRegistered()); break; case mtpc_updateContactLink: setData(new MTPDupdateContactLink()); break; - case mtpc_updateNewAuthorization: setData(new MTPDupdateNewAuthorization()); break; case mtpc_updateNewEncryptedMessage: setData(new MTPDupdateNewEncryptedMessage()); break; case mtpc_updateEncryptedChatTyping: setData(new MTPDupdateEncryptedChatTyping()); break; case mtpc_updateEncryption: setData(new MTPDupdateEncryption()); break; @@ -30729,6 +32653,9 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateConfig: break; case mtpc_updatePtsChanged: break; case mtpc_updateChannelWebPage: setData(new MTPDupdateChannelWebPage()); break; + case mtpc_updatePhoneCall: setData(new MTPDupdatePhoneCall()); break; + case mtpc_updateDialogPinned: setData(new MTPDupdateDialogPinned()); break; + case mtpc_updatePinnedDialogs: setData(new MTPDupdatePinnedDialogs()); break; default: throw mtpErrorBadTypeId(type, "MTPupdate"); } } @@ -30754,8 +32681,6 @@ inline MTPupdate::MTPupdate(MTPDupdateContactRegistered *_data) : mtpDataOwner(_ } inline MTPupdate::MTPupdate(MTPDupdateContactLink *_data) : mtpDataOwner(_data), _type(mtpc_updateContactLink) { } -inline MTPupdate::MTPupdate(MTPDupdateNewAuthorization *_data) : mtpDataOwner(_data), _type(mtpc_updateNewAuthorization) { -} inline MTPupdate::MTPupdate(MTPDupdateNewEncryptedMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateNewEncryptedMessage) { } inline MTPupdate::MTPupdate(MTPDupdateEncryptedChatTyping *_data) : mtpDataOwner(_data), _type(mtpc_updateEncryptedChatTyping) { @@ -30828,6 +32753,12 @@ inline MTPupdate::MTPupdate(MTPDupdateDraftMessage *_data) : mtpDataOwner(_data) } inline MTPupdate::MTPupdate(MTPDupdateChannelWebPage *_data) : mtpDataOwner(_data), _type(mtpc_updateChannelWebPage) { } +inline MTPupdate::MTPupdate(MTPDupdatePhoneCall *_data) : mtpDataOwner(_data), _type(mtpc_updatePhoneCall) { +} +inline MTPupdate::MTPupdate(MTPDupdateDialogPinned *_data) : mtpDataOwner(_data), _type(mtpc_updateDialogPinned) { +} +inline MTPupdate::MTPupdate(MTPDupdatePinnedDialogs *_data) : mtpDataOwner(_data), _type(mtpc_updatePinnedDialogs) { +} inline MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateNewMessage(_message, _pts, _pts_count); } @@ -30861,9 +32792,6 @@ inline MTPupdate MTP_updateContactRegistered(MTPint _user_id, MTPint _date) { inline MTPupdate MTP_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link) { return MTP::internal::TypeCreator::new_updateContactLink(_user_id, _my_link, _foreign_link); } -inline MTPupdate MTP_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) { - return MTP::internal::TypeCreator::new_updateNewAuthorization(_auth_key_id, _date, _device, _location); -} inline MTPupdate MTP_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts) { return MTP::internal::TypeCreator::new_updateNewEncryptedMessage(_message, _qts); } @@ -30891,8 +32819,9 @@ inline MTPupdate MTP_updateUserBlocked(MTPint _user_id, MTPBool _blocked) { inline MTPupdate MTP_updateNotifySettings(const MTPNotifyPeer &_peer, const MTPPeerNotifySettings &_notify_settings) { return MTP::internal::TypeCreator::new_updateNotifySettings(_peer, _notify_settings); } -inline MTPupdate MTP_updateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup) { - return MTP::internal::TypeCreator::new_updateServiceNotification(_type, _message, _media, _popup); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateServiceNotification::Flags) +inline MTPupdate MTP_updateServiceNotification(const MTPflags &_flags, MTPint _inbox_date, const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_updateServiceNotification(_flags, _inbox_date, _type, _message, _media, _entities); } inline MTPupdate MTP_updatePrivacy(const MTPPrivacyKey &_key, const MTPVector &_rules) { return MTP::internal::TypeCreator::new_updatePrivacy(_key, _rules); @@ -30996,6 +32925,17 @@ inline MTPupdate MTP_updatePtsChanged() { inline MTPupdate MTP_updateChannelWebPage(MTPint _channel_id, const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) { return MTP::internal::TypeCreator::new_updateChannelWebPage(_channel_id, _webpage, _pts, _pts_count); } +inline MTPupdate MTP_updatePhoneCall(const MTPPhoneCall &_phone_call) { + return MTP::internal::TypeCreator::new_updatePhoneCall(_phone_call); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateDialogPinned::Flags) +inline MTPupdate MTP_updateDialogPinned(const MTPflags &_flags, const MTPPeer &_peer) { + return MTP::internal::TypeCreator::new_updateDialogPinned(_flags, _peer); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdatePinnedDialogs::Flags) +inline MTPupdate MTP_updatePinnedDialogs(const MTPflags &_flags, const MTPVector &_order) { + return MTP::internal::TypeCreator::new_updatePinnedDialogs(_flags, _order); +} inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { } @@ -31544,7 +33484,7 @@ inline MTPconfig::MTPconfig() : mtpDataOwner(new MTPDconfig()) { inline uint32 MTPconfig::innerLength() const { const MTPDconfig &v(c_config()); - return v.vflags.innerLength() + v.vdate.innerLength() + v.vexpires.innerLength() + v.vtest_mode.innerLength() + v.vthis_dc.innerLength() + v.vdc_options.innerLength() + v.vchat_size_max.innerLength() + v.vmegagroup_size_max.innerLength() + v.vforwarded_count_max.innerLength() + v.vonline_update_period_ms.innerLength() + v.voffline_blur_timeout_ms.innerLength() + v.voffline_idle_timeout_ms.innerLength() + v.vonline_cloud_timeout_ms.innerLength() + v.vnotify_cloud_delay_ms.innerLength() + v.vnotify_default_delay_ms.innerLength() + v.vchat_big_size.innerLength() + v.vpush_chat_period_ms.innerLength() + v.vpush_chat_limit.innerLength() + v.vsaved_gifs_limit.innerLength() + v.vedit_time_limit.innerLength() + v.vrating_e_decay.innerLength() + v.vstickers_recent_limit.innerLength() + (v.has_tmp_sessions() ? v.vtmp_sessions.innerLength() : 0) + v.vdisabled_features.innerLength(); + return v.vflags.innerLength() + v.vdate.innerLength() + v.vexpires.innerLength() + v.vtest_mode.innerLength() + v.vthis_dc.innerLength() + v.vdc_options.innerLength() + v.vchat_size_max.innerLength() + v.vmegagroup_size_max.innerLength() + v.vforwarded_count_max.innerLength() + v.vonline_update_period_ms.innerLength() + v.voffline_blur_timeout_ms.innerLength() + v.voffline_idle_timeout_ms.innerLength() + v.vonline_cloud_timeout_ms.innerLength() + v.vnotify_cloud_delay_ms.innerLength() + v.vnotify_default_delay_ms.innerLength() + v.vchat_big_size.innerLength() + v.vpush_chat_period_ms.innerLength() + v.vpush_chat_limit.innerLength() + v.vsaved_gifs_limit.innerLength() + v.vedit_time_limit.innerLength() + v.vrating_e_decay.innerLength() + v.vstickers_recent_limit.innerLength() + (v.has_tmp_sessions() ? v.vtmp_sessions.innerLength() : 0) + v.vpinned_dialogs_count_max.innerLength() + v.vcall_receive_timeout_ms.innerLength() + v.vcall_ring_timeout_ms.innerLength() + v.vcall_connect_timeout_ms.innerLength() + v.vcall_packet_timeout_ms.innerLength() + v.vdisabled_features.innerLength(); } inline mtpTypeId MTPconfig::type() const { return mtpc_config; @@ -31577,6 +33517,11 @@ inline void MTPconfig::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vrating_e_decay.read(from, end); v.vstickers_recent_limit.read(from, end); if (v.has_tmp_sessions()) { v.vtmp_sessions.read(from, end); } else { v.vtmp_sessions = MTPint(); } + v.vpinned_dialogs_count_max.read(from, end); + v.vcall_receive_timeout_ms.read(from, end); + v.vcall_ring_timeout_ms.read(from, end); + v.vcall_connect_timeout_ms.read(from, end); + v.vcall_packet_timeout_ms.read(from, end); v.vdisabled_features.read(from, end); } inline void MTPconfig::write(mtpBuffer &to) const { @@ -31604,13 +33549,18 @@ inline void MTPconfig::write(mtpBuffer &to) const { v.vrating_e_decay.write(to); v.vstickers_recent_limit.write(to); if (v.has_tmp_sessions()) v.vtmp_sessions.write(to); + v.vpinned_dialogs_count_max.write(to); + v.vcall_receive_timeout_ms.write(to); + v.vcall_ring_timeout_ms.write(to); + v.vcall_connect_timeout_ms.write(to); + v.vcall_packet_timeout_ms.write(to); v.vdisabled_features.write(to); } inline MTPconfig::MTPconfig(MTPDconfig *_data) : mtpDataOwner(_data) { } Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDconfig::Flags) -inline MTPconfig MTP_config(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, const MTPVector &_disabled_features) { - return MTP::internal::TypeCreator::new_config(_flags, _date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _rating_e_decay, _stickers_recent_limit, _tmp_sessions, _disabled_features); +inline MTPconfig MTP_config(const MTPflags &_flags, MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, MTPint _rating_e_decay, MTPint _stickers_recent_limit, MTPint _tmp_sessions, MTPint _pinned_dialogs_count_max, MTPint _call_receive_timeout_ms, MTPint _call_ring_timeout_ms, MTPint _call_connect_timeout_ms, MTPint _call_packet_timeout_ms, const MTPVector &_disabled_features) { + return MTP::internal::TypeCreator::new_config(_flags, _date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _rating_e_decay, _stickers_recent_limit, _tmp_sessions, _pinned_dialogs_count_max, _call_receive_timeout_ms, _call_ring_timeout_ms, _call_connect_timeout_ms, _call_packet_timeout_ms, _disabled_features); } inline MTPnearestDc::MTPnearestDc() : mtpDataOwner(new MTPDnearestDc()) { @@ -32544,6 +34494,7 @@ inline void MTPsendMessageAction::read(const mtpPrime *&from, const mtpPrime *en } break; case mtpc_sendMessageGeoLocationAction: _type = cons; break; case mtpc_sendMessageChooseContactAction: _type = cons; break; + case mtpc_sendMessageGamePlayAction: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPsendMessageAction"); } } @@ -32579,6 +34530,7 @@ inline MTPsendMessageAction::MTPsendMessageAction(mtpTypeId type) : mtpDataOwner case mtpc_sendMessageUploadDocumentAction: setData(new MTPDsendMessageUploadDocumentAction()); break; case mtpc_sendMessageGeoLocationAction: break; case mtpc_sendMessageChooseContactAction: break; + case mtpc_sendMessageGamePlayAction: break; default: throw mtpErrorBadTypeId(type, "MTPsendMessageAction"); } } @@ -32620,6 +34572,9 @@ inline MTPsendMessageAction MTP_sendMessageGeoLocationAction() { inline MTPsendMessageAction MTP_sendMessageChooseContactAction() { return MTP::internal::TypeCreator::new_sendMessageChooseContactAction(); } +inline MTPsendMessageAction MTP_sendMessageGamePlayAction() { + return MTP::internal::TypeCreator::new_sendMessageGamePlayAction(); +} inline MTPcontacts_found::MTPcontacts_found() : mtpDataOwner(new MTPDcontacts_found()) { } @@ -32663,6 +34618,7 @@ inline void MTPinputPrivacyKey::read(const mtpPrime *&from, const mtpPrime *end, switch (cons) { case mtpc_inputPrivacyKeyStatusTimestamp: _type = cons; break; case mtpc_inputPrivacyKeyChatInvite: _type = cons; break; + case mtpc_inputPrivacyKeyPhoneCall: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPinputPrivacyKey"); } } @@ -32672,6 +34628,7 @@ inline MTPinputPrivacyKey::MTPinputPrivacyKey(mtpTypeId type) : _type(type) { switch (type) { case mtpc_inputPrivacyKeyStatusTimestamp: break; case mtpc_inputPrivacyKeyChatInvite: break; + case mtpc_inputPrivacyKeyPhoneCall: break; default: throw mtpErrorBadTypeId(type, "MTPinputPrivacyKey"); } } @@ -32681,6 +34638,9 @@ inline MTPinputPrivacyKey MTP_inputPrivacyKeyStatusTimestamp() { inline MTPinputPrivacyKey MTP_inputPrivacyKeyChatInvite() { return MTP::internal::TypeCreator::new_inputPrivacyKeyChatInvite(); } +inline MTPinputPrivacyKey MTP_inputPrivacyKeyPhoneCall() { + return MTP::internal::TypeCreator::new_inputPrivacyKeyPhoneCall(); +} inline uint32 MTPprivacyKey::innerLength() const { return 0; @@ -32693,6 +34653,7 @@ inline void MTPprivacyKey::read(const mtpPrime *&from, const mtpPrime *end, mtpT switch (cons) { case mtpc_privacyKeyStatusTimestamp: _type = cons; break; case mtpc_privacyKeyChatInvite: _type = cons; break; + case mtpc_privacyKeyPhoneCall: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPprivacyKey"); } } @@ -32702,6 +34663,7 @@ inline MTPprivacyKey::MTPprivacyKey(mtpTypeId type) : _type(type) { switch (type) { case mtpc_privacyKeyStatusTimestamp: break; case mtpc_privacyKeyChatInvite: break; + case mtpc_privacyKeyPhoneCall: break; default: throw mtpErrorBadTypeId(type, "MTPprivacyKey"); } } @@ -32711,6 +34673,9 @@ inline MTPprivacyKey MTP_privacyKeyStatusTimestamp() { inline MTPprivacyKey MTP_privacyKeyChatInvite() { return MTP::internal::TypeCreator::new_privacyKeyChatInvite(); } +inline MTPprivacyKey MTP_privacyKeyPhoneCall() { + return MTP::internal::TypeCreator::new_privacyKeyPhoneCall(); +} inline uint32 MTPinputPrivacyRule::innerLength() const { switch (_type) { @@ -33327,7 +35292,7 @@ inline uint32 MTPwebPage::innerLength() const { } case mtpc_webPage: { 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); + return v.vflags.innerLength() + v.vid.innerLength() + v.vurl.innerLength() + v.vdisplay_url.innerLength() + v.vhash.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) + (v.has_cached_page() ? v.vcached_page.innerLength() : 0); } } return 0; @@ -33357,6 +35322,7 @@ inline void MTPwebPage::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vid.read(from, end); v.vurl.read(from, end); v.vdisplay_url.read(from, end); + v.vhash.read(from, end); if (v.has_type()) { v.vtype.read(from, end); } else { v.vtype = MTPstring(); } if (v.has_site_name()) { v.vsite_name.read(from, end); } else { v.vsite_name = MTPstring(); } if (v.has_title()) { v.vtitle.read(from, end); } else { v.vtitle = MTPstring(); } @@ -33369,7 +35335,9 @@ inline void MTPwebPage::read(const mtpPrime *&from, const mtpPrime *end, mtpType if (v.has_duration()) { v.vduration.read(from, end); } else { v.vduration = MTPint(); } 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(); } + if (v.has_cached_page()) { v.vcached_page.read(from, end); } else { v.vcached_page = MTPPage(); } } break; + case mtpc_webPageNotModified: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPwebPage"); } } @@ -33390,6 +35358,7 @@ inline void MTPwebPage::write(mtpBuffer &to) const { v.vid.write(to); v.vurl.write(to); v.vdisplay_url.write(to); + v.vhash.write(to); if (v.has_type()) v.vtype.write(to); if (v.has_site_name()) v.vsite_name.write(to); if (v.has_title()) v.vtitle.write(to); @@ -33402,6 +35371,7 @@ inline void MTPwebPage::write(mtpBuffer &to) const { if (v.has_duration()) v.vduration.write(to); if (v.has_author()) v.vauthor.write(to); if (v.has_document()) v.vdocument.write(to); + if (v.has_cached_page()) v.vcached_page.write(to); } break; } } @@ -33410,6 +35380,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_webPageNotModified: break; default: throw mtpErrorBadTypeId(type, "MTPwebPage"); } } @@ -33426,8 +35397,11 @@ inline MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date) { return MTP::internal::TypeCreator::new_webPagePending(_id, _date); } Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDwebPage::Flags) -inline MTPwebPage MTP_webPage(const MTPflags &_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 MTP::internal::TypeCreator::new_webPage(_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_webPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, MTPint _hash, 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, const MTPPage &_cached_page) { + return MTP::internal::TypeCreator::new_webPage(_flags, _id, _url, _display_url, _hash, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document, _cached_page); +} +inline MTPwebPage MTP_webPageNotModified() { + return MTP::internal::TypeCreator::new_webPageNotModified(); } inline MTPauthorization::MTPauthorization() : mtpDataOwner(new MTPDauthorization()) { @@ -34326,7 +36300,7 @@ inline uint32 MTPhelp_appChangelog::innerLength() const { switch (_type) { case mtpc_help_appChangelog: { const MTPDhelp_appChangelog &v(c_help_appChangelog()); - return v.vtext.innerLength(); + return v.vmessage.innerLength() + v.vmedia.innerLength() + v.ventities.innerLength(); } } return 0; @@ -34342,7 +36316,9 @@ inline void MTPhelp_appChangelog::read(const mtpPrime *&from, const mtpPrime *en case mtpc_help_appChangelog: _type = cons; { if (!data) setData(new MTPDhelp_appChangelog()); MTPDhelp_appChangelog &v(_help_appChangelog()); - v.vtext.read(from, end); + v.vmessage.read(from, end); + v.vmedia.read(from, end); + v.ventities.read(from, end); } break; default: throw mtpErrorUnexpected(cons, "MTPhelp_appChangelog"); } @@ -34351,7 +36327,9 @@ inline void MTPhelp_appChangelog::write(mtpBuffer &to) const { switch (_type) { case mtpc_help_appChangelog: { const MTPDhelp_appChangelog &v(c_help_appChangelog()); - v.vtext.write(to); + v.vmessage.write(to); + v.vmedia.write(to); + v.ventities.write(to); } break; } } @@ -34367,8 +36345,8 @@ inline MTPhelp_appChangelog::MTPhelp_appChangelog(MTPDhelp_appChangelog *_data) inline MTPhelp_appChangelog MTP_help_appChangelogEmpty() { return MTP::internal::TypeCreator::new_help_appChangelogEmpty(); } -inline MTPhelp_appChangelog MTP_help_appChangelog(const MTPstring &_text) { - return MTP::internal::TypeCreator::new_help_appChangelog(_text); +inline MTPhelp_appChangelog MTP_help_appChangelog(const MTPstring &_message, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_help_appChangelog(_message, _media, _entities); } inline uint32 MTPmessageEntity::innerLength() const { @@ -37150,6 +39128,1065 @@ inline MTPmessages_highScores::MTPmessages_highScores(MTPDmessages_highScores *_ inline MTPmessages_highScores MTP_messages_highScores(const MTPVector &_scores, const MTPVector &_users) { return MTP::internal::TypeCreator::new_messages_highScores(_scores, _users); } + +inline uint32 MTPrichText::innerLength() const { + switch (_type) { + case mtpc_textPlain: { + const MTPDtextPlain &v(c_textPlain()); + return v.vtext.innerLength(); + } + case mtpc_textBold: { + const MTPDtextBold &v(c_textBold()); + return v.vtext.innerLength(); + } + case mtpc_textItalic: { + const MTPDtextItalic &v(c_textItalic()); + return v.vtext.innerLength(); + } + case mtpc_textUnderline: { + const MTPDtextUnderline &v(c_textUnderline()); + return v.vtext.innerLength(); + } + case mtpc_textStrike: { + const MTPDtextStrike &v(c_textStrike()); + return v.vtext.innerLength(); + } + case mtpc_textFixed: { + const MTPDtextFixed &v(c_textFixed()); + return v.vtext.innerLength(); + } + case mtpc_textUrl: { + const MTPDtextUrl &v(c_textUrl()); + return v.vtext.innerLength() + v.vurl.innerLength() + v.vwebpage_id.innerLength(); + } + case mtpc_textEmail: { + const MTPDtextEmail &v(c_textEmail()); + return v.vtext.innerLength() + v.vemail.innerLength(); + } + case mtpc_textConcat: { + const MTPDtextConcat &v(c_textConcat()); + return v.vtexts.innerLength(); + } + } + return 0; +} +inline mtpTypeId MTPrichText::type() const { + t_assert(_type != 0); + return _type; +} +inline void MTPrichText::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != _type) setData(0); + switch (cons) { + case mtpc_textEmpty: _type = cons; break; + case mtpc_textPlain: _type = cons; { + if (!data) setData(new MTPDtextPlain()); + MTPDtextPlain &v(_textPlain()); + v.vtext.read(from, end); + } break; + case mtpc_textBold: _type = cons; { + if (!data) setData(new MTPDtextBold()); + MTPDtextBold &v(_textBold()); + v.vtext.read(from, end); + } break; + case mtpc_textItalic: _type = cons; { + if (!data) setData(new MTPDtextItalic()); + MTPDtextItalic &v(_textItalic()); + v.vtext.read(from, end); + } break; + case mtpc_textUnderline: _type = cons; { + if (!data) setData(new MTPDtextUnderline()); + MTPDtextUnderline &v(_textUnderline()); + v.vtext.read(from, end); + } break; + case mtpc_textStrike: _type = cons; { + if (!data) setData(new MTPDtextStrike()); + MTPDtextStrike &v(_textStrike()); + v.vtext.read(from, end); + } break; + case mtpc_textFixed: _type = cons; { + if (!data) setData(new MTPDtextFixed()); + MTPDtextFixed &v(_textFixed()); + v.vtext.read(from, end); + } break; + case mtpc_textUrl: _type = cons; { + if (!data) setData(new MTPDtextUrl()); + MTPDtextUrl &v(_textUrl()); + v.vtext.read(from, end); + v.vurl.read(from, end); + v.vwebpage_id.read(from, end); + } break; + case mtpc_textEmail: _type = cons; { + if (!data) setData(new MTPDtextEmail()); + MTPDtextEmail &v(_textEmail()); + v.vtext.read(from, end); + v.vemail.read(from, end); + } break; + case mtpc_textConcat: _type = cons; { + if (!data) setData(new MTPDtextConcat()); + MTPDtextConcat &v(_textConcat()); + v.vtexts.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPrichText"); + } +} +inline void MTPrichText::write(mtpBuffer &to) const { + switch (_type) { + case mtpc_textPlain: { + const MTPDtextPlain &v(c_textPlain()); + v.vtext.write(to); + } break; + case mtpc_textBold: { + const MTPDtextBold &v(c_textBold()); + v.vtext.write(to); + } break; + case mtpc_textItalic: { + const MTPDtextItalic &v(c_textItalic()); + v.vtext.write(to); + } break; + case mtpc_textUnderline: { + const MTPDtextUnderline &v(c_textUnderline()); + v.vtext.write(to); + } break; + case mtpc_textStrike: { + const MTPDtextStrike &v(c_textStrike()); + v.vtext.write(to); + } break; + case mtpc_textFixed: { + const MTPDtextFixed &v(c_textFixed()); + v.vtext.write(to); + } break; + case mtpc_textUrl: { + const MTPDtextUrl &v(c_textUrl()); + v.vtext.write(to); + v.vurl.write(to); + v.vwebpage_id.write(to); + } break; + case mtpc_textEmail: { + const MTPDtextEmail &v(c_textEmail()); + v.vtext.write(to); + v.vemail.write(to); + } break; + case mtpc_textConcat: { + const MTPDtextConcat &v(c_textConcat()); + v.vtexts.write(to); + } break; + } +} +inline MTPrichText::MTPrichText(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_textEmpty: break; + case mtpc_textPlain: setData(new MTPDtextPlain()); break; + case mtpc_textBold: setData(new MTPDtextBold()); break; + case mtpc_textItalic: setData(new MTPDtextItalic()); break; + case mtpc_textUnderline: setData(new MTPDtextUnderline()); break; + case mtpc_textStrike: setData(new MTPDtextStrike()); break; + case mtpc_textFixed: setData(new MTPDtextFixed()); break; + case mtpc_textUrl: setData(new MTPDtextUrl()); break; + case mtpc_textEmail: setData(new MTPDtextEmail()); break; + case mtpc_textConcat: setData(new MTPDtextConcat()); break; + default: throw mtpErrorBadTypeId(type, "MTPrichText"); + } +} +inline MTPrichText::MTPrichText(MTPDtextPlain *_data) : mtpDataOwner(_data), _type(mtpc_textPlain) { +} +inline MTPrichText::MTPrichText(MTPDtextBold *_data) : mtpDataOwner(_data), _type(mtpc_textBold) { +} +inline MTPrichText::MTPrichText(MTPDtextItalic *_data) : mtpDataOwner(_data), _type(mtpc_textItalic) { +} +inline MTPrichText::MTPrichText(MTPDtextUnderline *_data) : mtpDataOwner(_data), _type(mtpc_textUnderline) { +} +inline MTPrichText::MTPrichText(MTPDtextStrike *_data) : mtpDataOwner(_data), _type(mtpc_textStrike) { +} +inline MTPrichText::MTPrichText(MTPDtextFixed *_data) : mtpDataOwner(_data), _type(mtpc_textFixed) { +} +inline MTPrichText::MTPrichText(MTPDtextUrl *_data) : mtpDataOwner(_data), _type(mtpc_textUrl) { +} +inline MTPrichText::MTPrichText(MTPDtextEmail *_data) : mtpDataOwner(_data), _type(mtpc_textEmail) { +} +inline MTPrichText::MTPrichText(MTPDtextConcat *_data) : mtpDataOwner(_data), _type(mtpc_textConcat) { +} +inline MTPrichText MTP_textEmpty() { + return MTP::internal::TypeCreator::new_textEmpty(); +} +inline MTPrichText MTP_textPlain(const MTPstring &_text) { + return MTP::internal::TypeCreator::new_textPlain(_text); +} +inline MTPrichText MTP_textBold(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_textBold(_text); +} +inline MTPrichText MTP_textItalic(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_textItalic(_text); +} +inline MTPrichText MTP_textUnderline(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_textUnderline(_text); +} +inline MTPrichText MTP_textStrike(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_textStrike(_text); +} +inline MTPrichText MTP_textFixed(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_textFixed(_text); +} +inline MTPrichText MTP_textUrl(const MTPRichText &_text, const MTPstring &_url, const MTPlong &_webpage_id) { + return MTP::internal::TypeCreator::new_textUrl(_text, _url, _webpage_id); +} +inline MTPrichText MTP_textEmail(const MTPRichText &_text, const MTPstring &_email) { + return MTP::internal::TypeCreator::new_textEmail(_text, _email); +} +inline MTPrichText MTP_textConcat(const MTPVector &_texts) { + return MTP::internal::TypeCreator::new_textConcat(_texts); +} + +inline uint32 MTPpageBlock::innerLength() const { + switch (_type) { + case mtpc_pageBlockTitle: { + const MTPDpageBlockTitle &v(c_pageBlockTitle()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockSubtitle: { + const MTPDpageBlockSubtitle &v(c_pageBlockSubtitle()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockAuthorDate: { + const MTPDpageBlockAuthorDate &v(c_pageBlockAuthorDate()); + return v.vauthor.innerLength() + v.vpublished_date.innerLength(); + } + case mtpc_pageBlockHeader: { + const MTPDpageBlockHeader &v(c_pageBlockHeader()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockSubheader: { + const MTPDpageBlockSubheader &v(c_pageBlockSubheader()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockParagraph: { + const MTPDpageBlockParagraph &v(c_pageBlockParagraph()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockPreformatted: { + const MTPDpageBlockPreformatted &v(c_pageBlockPreformatted()); + return v.vtext.innerLength() + v.vlanguage.innerLength(); + } + case mtpc_pageBlockFooter: { + const MTPDpageBlockFooter &v(c_pageBlockFooter()); + return v.vtext.innerLength(); + } + case mtpc_pageBlockAnchor: { + const MTPDpageBlockAnchor &v(c_pageBlockAnchor()); + return v.vname.innerLength(); + } + case mtpc_pageBlockList: { + const MTPDpageBlockList &v(c_pageBlockList()); + return v.vordered.innerLength() + v.vitems.innerLength(); + } + case mtpc_pageBlockBlockquote: { + const MTPDpageBlockBlockquote &v(c_pageBlockBlockquote()); + return v.vtext.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockPullquote: { + const MTPDpageBlockPullquote &v(c_pageBlockPullquote()); + return v.vtext.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockPhoto: { + const MTPDpageBlockPhoto &v(c_pageBlockPhoto()); + return v.vphoto_id.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockVideo: { + const MTPDpageBlockVideo &v(c_pageBlockVideo()); + return v.vflags.innerLength() + v.vvideo_id.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockCover: { + const MTPDpageBlockCover &v(c_pageBlockCover()); + return v.vcover.innerLength(); + } + case mtpc_pageBlockEmbed: { + const MTPDpageBlockEmbed &v(c_pageBlockEmbed()); + return v.vflags.innerLength() + (v.has_url() ? v.vurl.innerLength() : 0) + (v.has_html() ? v.vhtml.innerLength() : 0) + (v.has_poster_photo_id() ? v.vposter_photo_id.innerLength() : 0) + v.vw.innerLength() + v.vh.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockEmbedPost: { + const MTPDpageBlockEmbedPost &v(c_pageBlockEmbedPost()); + return v.vurl.innerLength() + v.vwebpage_id.innerLength() + v.vauthor_photo_id.innerLength() + v.vauthor.innerLength() + v.vdate.innerLength() + v.vblocks.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockCollage: { + const MTPDpageBlockCollage &v(c_pageBlockCollage()); + return v.vitems.innerLength() + v.vcaption.innerLength(); + } + case mtpc_pageBlockSlideshow: { + const MTPDpageBlockSlideshow &v(c_pageBlockSlideshow()); + return v.vitems.innerLength() + v.vcaption.innerLength(); + } + } + return 0; +} +inline mtpTypeId MTPpageBlock::type() const { + t_assert(_type != 0); + return _type; +} +inline void MTPpageBlock::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != _type) setData(0); + switch (cons) { + case mtpc_pageBlockUnsupported: _type = cons; break; + case mtpc_pageBlockTitle: _type = cons; { + if (!data) setData(new MTPDpageBlockTitle()); + MTPDpageBlockTitle &v(_pageBlockTitle()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockSubtitle: _type = cons; { + if (!data) setData(new MTPDpageBlockSubtitle()); + MTPDpageBlockSubtitle &v(_pageBlockSubtitle()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockAuthorDate: _type = cons; { + if (!data) setData(new MTPDpageBlockAuthorDate()); + MTPDpageBlockAuthorDate &v(_pageBlockAuthorDate()); + v.vauthor.read(from, end); + v.vpublished_date.read(from, end); + } break; + case mtpc_pageBlockHeader: _type = cons; { + if (!data) setData(new MTPDpageBlockHeader()); + MTPDpageBlockHeader &v(_pageBlockHeader()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockSubheader: _type = cons; { + if (!data) setData(new MTPDpageBlockSubheader()); + MTPDpageBlockSubheader &v(_pageBlockSubheader()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockParagraph: _type = cons; { + if (!data) setData(new MTPDpageBlockParagraph()); + MTPDpageBlockParagraph &v(_pageBlockParagraph()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockPreformatted: _type = cons; { + if (!data) setData(new MTPDpageBlockPreformatted()); + MTPDpageBlockPreformatted &v(_pageBlockPreformatted()); + v.vtext.read(from, end); + v.vlanguage.read(from, end); + } break; + case mtpc_pageBlockFooter: _type = cons; { + if (!data) setData(new MTPDpageBlockFooter()); + MTPDpageBlockFooter &v(_pageBlockFooter()); + v.vtext.read(from, end); + } break; + case mtpc_pageBlockDivider: _type = cons; break; + case mtpc_pageBlockAnchor: _type = cons; { + if (!data) setData(new MTPDpageBlockAnchor()); + MTPDpageBlockAnchor &v(_pageBlockAnchor()); + v.vname.read(from, end); + } break; + case mtpc_pageBlockList: _type = cons; { + if (!data) setData(new MTPDpageBlockList()); + MTPDpageBlockList &v(_pageBlockList()); + v.vordered.read(from, end); + v.vitems.read(from, end); + } break; + case mtpc_pageBlockBlockquote: _type = cons; { + if (!data) setData(new MTPDpageBlockBlockquote()); + MTPDpageBlockBlockquote &v(_pageBlockBlockquote()); + v.vtext.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockPullquote: _type = cons; { + if (!data) setData(new MTPDpageBlockPullquote()); + MTPDpageBlockPullquote &v(_pageBlockPullquote()); + v.vtext.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockPhoto: _type = cons; { + if (!data) setData(new MTPDpageBlockPhoto()); + MTPDpageBlockPhoto &v(_pageBlockPhoto()); + v.vphoto_id.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockVideo: _type = cons; { + if (!data) setData(new MTPDpageBlockVideo()); + MTPDpageBlockVideo &v(_pageBlockVideo()); + v.vflags.read(from, end); + v.vvideo_id.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockCover: _type = cons; { + if (!data) setData(new MTPDpageBlockCover()); + MTPDpageBlockCover &v(_pageBlockCover()); + v.vcover.read(from, end); + } break; + case mtpc_pageBlockEmbed: _type = cons; { + if (!data) setData(new MTPDpageBlockEmbed()); + MTPDpageBlockEmbed &v(_pageBlockEmbed()); + v.vflags.read(from, end); + if (v.has_url()) { v.vurl.read(from, end); } else { v.vurl = MTPstring(); } + if (v.has_html()) { v.vhtml.read(from, end); } else { v.vhtml = MTPstring(); } + if (v.has_poster_photo_id()) { v.vposter_photo_id.read(from, end); } else { v.vposter_photo_id = MTPlong(); } + v.vw.read(from, end); + v.vh.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockEmbedPost: _type = cons; { + if (!data) setData(new MTPDpageBlockEmbedPost()); + MTPDpageBlockEmbedPost &v(_pageBlockEmbedPost()); + v.vurl.read(from, end); + v.vwebpage_id.read(from, end); + v.vauthor_photo_id.read(from, end); + v.vauthor.read(from, end); + v.vdate.read(from, end); + v.vblocks.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockCollage: _type = cons; { + if (!data) setData(new MTPDpageBlockCollage()); + MTPDpageBlockCollage &v(_pageBlockCollage()); + v.vitems.read(from, end); + v.vcaption.read(from, end); + } break; + case mtpc_pageBlockSlideshow: _type = cons; { + if (!data) setData(new MTPDpageBlockSlideshow()); + MTPDpageBlockSlideshow &v(_pageBlockSlideshow()); + v.vitems.read(from, end); + v.vcaption.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPpageBlock"); + } +} +inline void MTPpageBlock::write(mtpBuffer &to) const { + switch (_type) { + case mtpc_pageBlockTitle: { + const MTPDpageBlockTitle &v(c_pageBlockTitle()); + v.vtext.write(to); + } break; + case mtpc_pageBlockSubtitle: { + const MTPDpageBlockSubtitle &v(c_pageBlockSubtitle()); + v.vtext.write(to); + } break; + case mtpc_pageBlockAuthorDate: { + const MTPDpageBlockAuthorDate &v(c_pageBlockAuthorDate()); + v.vauthor.write(to); + v.vpublished_date.write(to); + } break; + case mtpc_pageBlockHeader: { + const MTPDpageBlockHeader &v(c_pageBlockHeader()); + v.vtext.write(to); + } break; + case mtpc_pageBlockSubheader: { + const MTPDpageBlockSubheader &v(c_pageBlockSubheader()); + v.vtext.write(to); + } break; + case mtpc_pageBlockParagraph: { + const MTPDpageBlockParagraph &v(c_pageBlockParagraph()); + v.vtext.write(to); + } break; + case mtpc_pageBlockPreformatted: { + const MTPDpageBlockPreformatted &v(c_pageBlockPreformatted()); + v.vtext.write(to); + v.vlanguage.write(to); + } break; + case mtpc_pageBlockFooter: { + const MTPDpageBlockFooter &v(c_pageBlockFooter()); + v.vtext.write(to); + } break; + case mtpc_pageBlockAnchor: { + const MTPDpageBlockAnchor &v(c_pageBlockAnchor()); + v.vname.write(to); + } break; + case mtpc_pageBlockList: { + const MTPDpageBlockList &v(c_pageBlockList()); + v.vordered.write(to); + v.vitems.write(to); + } break; + case mtpc_pageBlockBlockquote: { + const MTPDpageBlockBlockquote &v(c_pageBlockBlockquote()); + v.vtext.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockPullquote: { + const MTPDpageBlockPullquote &v(c_pageBlockPullquote()); + v.vtext.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockPhoto: { + const MTPDpageBlockPhoto &v(c_pageBlockPhoto()); + v.vphoto_id.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockVideo: { + const MTPDpageBlockVideo &v(c_pageBlockVideo()); + v.vflags.write(to); + v.vvideo_id.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockCover: { + const MTPDpageBlockCover &v(c_pageBlockCover()); + v.vcover.write(to); + } break; + case mtpc_pageBlockEmbed: { + const MTPDpageBlockEmbed &v(c_pageBlockEmbed()); + v.vflags.write(to); + if (v.has_url()) v.vurl.write(to); + if (v.has_html()) v.vhtml.write(to); + if (v.has_poster_photo_id()) v.vposter_photo_id.write(to); + v.vw.write(to); + v.vh.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockEmbedPost: { + const MTPDpageBlockEmbedPost &v(c_pageBlockEmbedPost()); + v.vurl.write(to); + v.vwebpage_id.write(to); + v.vauthor_photo_id.write(to); + v.vauthor.write(to); + v.vdate.write(to); + v.vblocks.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockCollage: { + const MTPDpageBlockCollage &v(c_pageBlockCollage()); + v.vitems.write(to); + v.vcaption.write(to); + } break; + case mtpc_pageBlockSlideshow: { + const MTPDpageBlockSlideshow &v(c_pageBlockSlideshow()); + v.vitems.write(to); + v.vcaption.write(to); + } break; + } +} +inline MTPpageBlock::MTPpageBlock(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_pageBlockUnsupported: break; + case mtpc_pageBlockTitle: setData(new MTPDpageBlockTitle()); break; + case mtpc_pageBlockSubtitle: setData(new MTPDpageBlockSubtitle()); break; + case mtpc_pageBlockAuthorDate: setData(new MTPDpageBlockAuthorDate()); break; + case mtpc_pageBlockHeader: setData(new MTPDpageBlockHeader()); break; + case mtpc_pageBlockSubheader: setData(new MTPDpageBlockSubheader()); break; + case mtpc_pageBlockParagraph: setData(new MTPDpageBlockParagraph()); break; + case mtpc_pageBlockPreformatted: setData(new MTPDpageBlockPreformatted()); break; + case mtpc_pageBlockFooter: setData(new MTPDpageBlockFooter()); break; + case mtpc_pageBlockDivider: break; + case mtpc_pageBlockAnchor: setData(new MTPDpageBlockAnchor()); break; + case mtpc_pageBlockList: setData(new MTPDpageBlockList()); break; + case mtpc_pageBlockBlockquote: setData(new MTPDpageBlockBlockquote()); break; + case mtpc_pageBlockPullquote: setData(new MTPDpageBlockPullquote()); break; + case mtpc_pageBlockPhoto: setData(new MTPDpageBlockPhoto()); break; + case mtpc_pageBlockVideo: setData(new MTPDpageBlockVideo()); break; + case mtpc_pageBlockCover: setData(new MTPDpageBlockCover()); break; + case mtpc_pageBlockEmbed: setData(new MTPDpageBlockEmbed()); break; + case mtpc_pageBlockEmbedPost: setData(new MTPDpageBlockEmbedPost()); break; + case mtpc_pageBlockCollage: setData(new MTPDpageBlockCollage()); break; + case mtpc_pageBlockSlideshow: setData(new MTPDpageBlockSlideshow()); break; + default: throw mtpErrorBadTypeId(type, "MTPpageBlock"); + } +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockTitle *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockTitle) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockSubtitle *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockSubtitle) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockAuthorDate *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockAuthorDate) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockHeader *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockHeader) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockSubheader *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockSubheader) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockParagraph *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockParagraph) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockPreformatted *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockPreformatted) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockFooter *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockFooter) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockAnchor *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockAnchor) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockList *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockList) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockBlockquote *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockBlockquote) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockPullquote *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockPullquote) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockPhoto *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockPhoto) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockVideo *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockVideo) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockCover *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockCover) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockEmbed *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockEmbed) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockEmbedPost *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockEmbedPost) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockCollage *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockCollage) { +} +inline MTPpageBlock::MTPpageBlock(MTPDpageBlockSlideshow *_data) : mtpDataOwner(_data), _type(mtpc_pageBlockSlideshow) { +} +inline MTPpageBlock MTP_pageBlockUnsupported() { + return MTP::internal::TypeCreator::new_pageBlockUnsupported(); +} +inline MTPpageBlock MTP_pageBlockTitle(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockTitle(_text); +} +inline MTPpageBlock MTP_pageBlockSubtitle(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockSubtitle(_text); +} +inline MTPpageBlock MTP_pageBlockAuthorDate(const MTPRichText &_author, MTPint _published_date) { + return MTP::internal::TypeCreator::new_pageBlockAuthorDate(_author, _published_date); +} +inline MTPpageBlock MTP_pageBlockHeader(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockHeader(_text); +} +inline MTPpageBlock MTP_pageBlockSubheader(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockSubheader(_text); +} +inline MTPpageBlock MTP_pageBlockParagraph(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockParagraph(_text); +} +inline MTPpageBlock MTP_pageBlockPreformatted(const MTPRichText &_text, const MTPstring &_language) { + return MTP::internal::TypeCreator::new_pageBlockPreformatted(_text, _language); +} +inline MTPpageBlock MTP_pageBlockFooter(const MTPRichText &_text) { + return MTP::internal::TypeCreator::new_pageBlockFooter(_text); +} +inline MTPpageBlock MTP_pageBlockDivider() { + return MTP::internal::TypeCreator::new_pageBlockDivider(); +} +inline MTPpageBlock MTP_pageBlockAnchor(const MTPstring &_name) { + return MTP::internal::TypeCreator::new_pageBlockAnchor(_name); +} +inline MTPpageBlock MTP_pageBlockList(MTPBool _ordered, const MTPVector &_items) { + return MTP::internal::TypeCreator::new_pageBlockList(_ordered, _items); +} +inline MTPpageBlock MTP_pageBlockBlockquote(const MTPRichText &_text, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockBlockquote(_text, _caption); +} +inline MTPpageBlock MTP_pageBlockPullquote(const MTPRichText &_text, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockPullquote(_text, _caption); +} +inline MTPpageBlock MTP_pageBlockPhoto(const MTPlong &_photo_id, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockPhoto(_photo_id, _caption); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDpageBlockVideo::Flags) +inline MTPpageBlock MTP_pageBlockVideo(const MTPflags &_flags, const MTPlong &_video_id, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockVideo(_flags, _video_id, _caption); +} +inline MTPpageBlock MTP_pageBlockCover(const MTPPageBlock &_cover) { + return MTP::internal::TypeCreator::new_pageBlockCover(_cover); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDpageBlockEmbed::Flags) +inline MTPpageBlock MTP_pageBlockEmbed(const MTPflags &_flags, const MTPstring &_url, const MTPstring &_html, const MTPlong &_poster_photo_id, MTPint _w, MTPint _h, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockEmbed(_flags, _url, _html, _poster_photo_id, _w, _h, _caption); +} +inline MTPpageBlock MTP_pageBlockEmbedPost(const MTPstring &_url, const MTPlong &_webpage_id, const MTPlong &_author_photo_id, const MTPstring &_author, MTPint _date, const MTPVector &_blocks, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockEmbedPost(_url, _webpage_id, _author_photo_id, _author, _date, _blocks, _caption); +} +inline MTPpageBlock MTP_pageBlockCollage(const MTPVector &_items, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockCollage(_items, _caption); +} +inline MTPpageBlock MTP_pageBlockSlideshow(const MTPVector &_items, const MTPRichText &_caption) { + return MTP::internal::TypeCreator::new_pageBlockSlideshow(_items, _caption); +} + +inline uint32 MTPpage::innerLength() const { + switch (_type) { + case mtpc_pagePart: { + const MTPDpagePart &v(c_pagePart()); + return v.vblocks.innerLength() + v.vphotos.innerLength() + v.vvideos.innerLength(); + } + case mtpc_pageFull: { + const MTPDpageFull &v(c_pageFull()); + return v.vblocks.innerLength() + v.vphotos.innerLength() + v.vvideos.innerLength(); + } + } + return 0; +} +inline mtpTypeId MTPpage::type() const { + t_assert(_type != 0); + return _type; +} +inline void MTPpage::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != _type) setData(0); + switch (cons) { + case mtpc_pagePart: _type = cons; { + if (!data) setData(new MTPDpagePart()); + MTPDpagePart &v(_pagePart()); + v.vblocks.read(from, end); + v.vphotos.read(from, end); + v.vvideos.read(from, end); + } break; + case mtpc_pageFull: _type = cons; { + if (!data) setData(new MTPDpageFull()); + MTPDpageFull &v(_pageFull()); + v.vblocks.read(from, end); + v.vphotos.read(from, end); + v.vvideos.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPpage"); + } +} +inline void MTPpage::write(mtpBuffer &to) const { + switch (_type) { + case mtpc_pagePart: { + const MTPDpagePart &v(c_pagePart()); + v.vblocks.write(to); + v.vphotos.write(to); + v.vvideos.write(to); + } break; + case mtpc_pageFull: { + const MTPDpageFull &v(c_pageFull()); + v.vblocks.write(to); + v.vphotos.write(to); + v.vvideos.write(to); + } break; + } +} +inline MTPpage::MTPpage(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_pagePart: setData(new MTPDpagePart()); break; + case mtpc_pageFull: setData(new MTPDpageFull()); break; + default: throw mtpErrorBadTypeId(type, "MTPpage"); + } +} +inline MTPpage::MTPpage(MTPDpagePart *_data) : mtpDataOwner(_data), _type(mtpc_pagePart) { +} +inline MTPpage::MTPpage(MTPDpageFull *_data) : mtpDataOwner(_data), _type(mtpc_pageFull) { +} +inline MTPpage MTP_pagePart(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) { + return MTP::internal::TypeCreator::new_pagePart(_blocks, _photos, _videos); +} +inline MTPpage MTP_pageFull(const MTPVector &_blocks, const MTPVector &_photos, const MTPVector &_videos) { + return MTP::internal::TypeCreator::new_pageFull(_blocks, _photos, _videos); +} + +inline MTPinputPhoneCall::MTPinputPhoneCall() : mtpDataOwner(new MTPDinputPhoneCall()) { +} + +inline uint32 MTPinputPhoneCall::innerLength() const { + const MTPDinputPhoneCall &v(c_inputPhoneCall()); + return v.vid.innerLength() + v.vaccess_hash.innerLength(); +} +inline mtpTypeId MTPinputPhoneCall::type() const { + return mtpc_inputPhoneCall; +} +inline void MTPinputPhoneCall::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_inputPhoneCall) throw mtpErrorUnexpected(cons, "MTPinputPhoneCall"); + + if (!data) setData(new MTPDinputPhoneCall()); + MTPDinputPhoneCall &v(_inputPhoneCall()); + v.vid.read(from, end); + v.vaccess_hash.read(from, end); +} +inline void MTPinputPhoneCall::write(mtpBuffer &to) const { + const MTPDinputPhoneCall &v(c_inputPhoneCall()); + v.vid.write(to); + v.vaccess_hash.write(to); +} +inline MTPinputPhoneCall::MTPinputPhoneCall(MTPDinputPhoneCall *_data) : mtpDataOwner(_data) { +} +inline MTPinputPhoneCall MTP_inputPhoneCall(const MTPlong &_id, const MTPlong &_access_hash) { + return MTP::internal::TypeCreator::new_inputPhoneCall(_id, _access_hash); +} + +inline uint32 MTPphoneCall::innerLength() const { + switch (_type) { + case mtpc_phoneCallEmpty: { + const MTPDphoneCallEmpty &v(c_phoneCallEmpty()); + return v.vid.innerLength(); + } + case mtpc_phoneCallWaiting: { + const MTPDphoneCallWaiting &v(c_phoneCallWaiting()); + return v.vflags.innerLength() + v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vdate.innerLength() + v.vadmin_id.innerLength() + v.vparticipant_id.innerLength() + v.vprotocol.innerLength() + (v.has_receive_date() ? v.vreceive_date.innerLength() : 0); + } + case mtpc_phoneCallRequested: { + const MTPDphoneCallRequested &v(c_phoneCallRequested()); + return v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vdate.innerLength() + v.vadmin_id.innerLength() + v.vparticipant_id.innerLength() + v.vg_a.innerLength() + v.vprotocol.innerLength(); + } + case mtpc_phoneCall: { + const MTPDphoneCall &v(c_phoneCall()); + return v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vdate.innerLength() + v.vadmin_id.innerLength() + v.vparticipant_id.innerLength() + v.vg_a_or_b.innerLength() + v.vkey_fingerprint.innerLength() + v.vprotocol.innerLength() + v.vconnection.innerLength() + v.valternative_connections.innerLength() + v.vstart_date.innerLength(); + } + case mtpc_phoneCallDiscarded: { + const MTPDphoneCallDiscarded &v(c_phoneCallDiscarded()); + return v.vflags.innerLength() + v.vid.innerLength() + (v.has_reason() ? v.vreason.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0); + } + } + return 0; +} +inline mtpTypeId MTPphoneCall::type() const { + t_assert(_type != 0); + return _type; +} +inline void MTPphoneCall::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != _type) setData(0); + switch (cons) { + case mtpc_phoneCallEmpty: _type = cons; { + if (!data) setData(new MTPDphoneCallEmpty()); + MTPDphoneCallEmpty &v(_phoneCallEmpty()); + v.vid.read(from, end); + } break; + case mtpc_phoneCallWaiting: _type = cons; { + if (!data) setData(new MTPDphoneCallWaiting()); + MTPDphoneCallWaiting &v(_phoneCallWaiting()); + v.vflags.read(from, end); + v.vid.read(from, end); + v.vaccess_hash.read(from, end); + v.vdate.read(from, end); + v.vadmin_id.read(from, end); + v.vparticipant_id.read(from, end); + v.vprotocol.read(from, end); + if (v.has_receive_date()) { v.vreceive_date.read(from, end); } else { v.vreceive_date = MTPint(); } + } break; + case mtpc_phoneCallRequested: _type = cons; { + if (!data) setData(new MTPDphoneCallRequested()); + MTPDphoneCallRequested &v(_phoneCallRequested()); + v.vid.read(from, end); + v.vaccess_hash.read(from, end); + v.vdate.read(from, end); + v.vadmin_id.read(from, end); + v.vparticipant_id.read(from, end); + v.vg_a.read(from, end); + v.vprotocol.read(from, end); + } break; + case mtpc_phoneCall: _type = cons; { + if (!data) setData(new MTPDphoneCall()); + MTPDphoneCall &v(_phoneCall()); + v.vid.read(from, end); + v.vaccess_hash.read(from, end); + v.vdate.read(from, end); + v.vadmin_id.read(from, end); + v.vparticipant_id.read(from, end); + v.vg_a_or_b.read(from, end); + v.vkey_fingerprint.read(from, end); + v.vprotocol.read(from, end); + v.vconnection.read(from, end); + v.valternative_connections.read(from, end); + v.vstart_date.read(from, end); + } break; + case mtpc_phoneCallDiscarded: _type = cons; { + if (!data) setData(new MTPDphoneCallDiscarded()); + MTPDphoneCallDiscarded &v(_phoneCallDiscarded()); + v.vflags.read(from, end); + v.vid.read(from, end); + if (v.has_reason()) { v.vreason.read(from, end); } else { v.vreason = MTPPhoneCallDiscardReason(); } + if (v.has_duration()) { v.vduration.read(from, end); } else { v.vduration = MTPint(); } + } break; + default: throw mtpErrorUnexpected(cons, "MTPphoneCall"); + } +} +inline void MTPphoneCall::write(mtpBuffer &to) const { + switch (_type) { + case mtpc_phoneCallEmpty: { + const MTPDphoneCallEmpty &v(c_phoneCallEmpty()); + v.vid.write(to); + } break; + case mtpc_phoneCallWaiting: { + const MTPDphoneCallWaiting &v(c_phoneCallWaiting()); + v.vflags.write(to); + v.vid.write(to); + v.vaccess_hash.write(to); + v.vdate.write(to); + v.vadmin_id.write(to); + v.vparticipant_id.write(to); + v.vprotocol.write(to); + if (v.has_receive_date()) v.vreceive_date.write(to); + } break; + case mtpc_phoneCallRequested: { + const MTPDphoneCallRequested &v(c_phoneCallRequested()); + v.vid.write(to); + v.vaccess_hash.write(to); + v.vdate.write(to); + v.vadmin_id.write(to); + v.vparticipant_id.write(to); + v.vg_a.write(to); + v.vprotocol.write(to); + } break; + case mtpc_phoneCall: { + const MTPDphoneCall &v(c_phoneCall()); + v.vid.write(to); + v.vaccess_hash.write(to); + v.vdate.write(to); + v.vadmin_id.write(to); + v.vparticipant_id.write(to); + v.vg_a_or_b.write(to); + v.vkey_fingerprint.write(to); + v.vprotocol.write(to); + v.vconnection.write(to); + v.valternative_connections.write(to); + v.vstart_date.write(to); + } break; + case mtpc_phoneCallDiscarded: { + const MTPDphoneCallDiscarded &v(c_phoneCallDiscarded()); + v.vflags.write(to); + v.vid.write(to); + if (v.has_reason()) v.vreason.write(to); + if (v.has_duration()) v.vduration.write(to); + } break; + } +} +inline MTPphoneCall::MTPphoneCall(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_phoneCallEmpty: setData(new MTPDphoneCallEmpty()); break; + case mtpc_phoneCallWaiting: setData(new MTPDphoneCallWaiting()); break; + case mtpc_phoneCallRequested: setData(new MTPDphoneCallRequested()); break; + case mtpc_phoneCall: setData(new MTPDphoneCall()); break; + case mtpc_phoneCallDiscarded: setData(new MTPDphoneCallDiscarded()); break; + default: throw mtpErrorBadTypeId(type, "MTPphoneCall"); + } +} +inline MTPphoneCall::MTPphoneCall(MTPDphoneCallEmpty *_data) : mtpDataOwner(_data), _type(mtpc_phoneCallEmpty) { +} +inline MTPphoneCall::MTPphoneCall(MTPDphoneCallWaiting *_data) : mtpDataOwner(_data), _type(mtpc_phoneCallWaiting) { +} +inline MTPphoneCall::MTPphoneCall(MTPDphoneCallRequested *_data) : mtpDataOwner(_data), _type(mtpc_phoneCallRequested) { +} +inline MTPphoneCall::MTPphoneCall(MTPDphoneCall *_data) : mtpDataOwner(_data), _type(mtpc_phoneCall) { +} +inline MTPphoneCall::MTPphoneCall(MTPDphoneCallDiscarded *_data) : mtpDataOwner(_data), _type(mtpc_phoneCallDiscarded) { +} +inline MTPphoneCall MTP_phoneCallEmpty(const MTPlong &_id) { + return MTP::internal::TypeCreator::new_phoneCallEmpty(_id); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDphoneCallWaiting::Flags) +inline MTPphoneCall MTP_phoneCallWaiting(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPPhoneCallProtocol &_protocol, MTPint _receive_date) { + return MTP::internal::TypeCreator::new_phoneCallWaiting(_flags, _id, _access_hash, _date, _admin_id, _participant_id, _protocol, _receive_date); +} +inline MTPphoneCall MTP_phoneCallRequested(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a, const MTPPhoneCallProtocol &_protocol) { + return MTP::internal::TypeCreator::new_phoneCallRequested(_id, _access_hash, _date, _admin_id, _participant_id, _g_a, _protocol); +} +inline MTPphoneCall MTP_phoneCall(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint, const MTPPhoneCallProtocol &_protocol, const MTPPhoneConnection &_connection, const MTPVector &_alternative_connections, MTPint _start_date) { + return MTP::internal::TypeCreator::new_phoneCall(_id, _access_hash, _date, _admin_id, _participant_id, _g_a_or_b, _key_fingerprint, _protocol, _connection, _alternative_connections, _start_date); +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDphoneCallDiscarded::Flags) +inline MTPphoneCall MTP_phoneCallDiscarded(const MTPflags &_flags, const MTPlong &_id, const MTPPhoneCallDiscardReason &_reason, MTPint _duration) { + return MTP::internal::TypeCreator::new_phoneCallDiscarded(_flags, _id, _reason, _duration); +} + +inline MTPphoneConnection::MTPphoneConnection() : mtpDataOwner(new MTPDphoneConnection()) { +} + +inline uint32 MTPphoneConnection::innerLength() const { + const MTPDphoneConnection &v(c_phoneConnection()); + return v.vid.innerLength() + v.vip.innerLength() + v.vipv6.innerLength() + v.vport.innerLength() + v.vpeer_tag.innerLength(); +} +inline mtpTypeId MTPphoneConnection::type() const { + return mtpc_phoneConnection; +} +inline void MTPphoneConnection::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_phoneConnection) throw mtpErrorUnexpected(cons, "MTPphoneConnection"); + + if (!data) setData(new MTPDphoneConnection()); + MTPDphoneConnection &v(_phoneConnection()); + v.vid.read(from, end); + v.vip.read(from, end); + v.vipv6.read(from, end); + v.vport.read(from, end); + v.vpeer_tag.read(from, end); +} +inline void MTPphoneConnection::write(mtpBuffer &to) const { + const MTPDphoneConnection &v(c_phoneConnection()); + v.vid.write(to); + v.vip.write(to); + v.vipv6.write(to); + v.vport.write(to); + v.vpeer_tag.write(to); +} +inline MTPphoneConnection::MTPphoneConnection(MTPDphoneConnection *_data) : mtpDataOwner(_data) { +} +inline MTPphoneConnection MTP_phoneConnection(const MTPlong &_id, const MTPstring &_ip, const MTPstring &_ipv6, MTPint _port, const MTPbytes &_peer_tag) { + return MTP::internal::TypeCreator::new_phoneConnection(_id, _ip, _ipv6, _port, _peer_tag); +} + +inline MTPphoneCallProtocol::MTPphoneCallProtocol() : mtpDataOwner(new MTPDphoneCallProtocol()) { +} + +inline uint32 MTPphoneCallProtocol::innerLength() const { + const MTPDphoneCallProtocol &v(c_phoneCallProtocol()); + return v.vflags.innerLength() + v.vmin_layer.innerLength() + v.vmax_layer.innerLength(); +} +inline mtpTypeId MTPphoneCallProtocol::type() const { + return mtpc_phoneCallProtocol; +} +inline void MTPphoneCallProtocol::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_phoneCallProtocol) throw mtpErrorUnexpected(cons, "MTPphoneCallProtocol"); + + if (!data) setData(new MTPDphoneCallProtocol()); + MTPDphoneCallProtocol &v(_phoneCallProtocol()); + v.vflags.read(from, end); + v.vmin_layer.read(from, end); + v.vmax_layer.read(from, end); +} +inline void MTPphoneCallProtocol::write(mtpBuffer &to) const { + const MTPDphoneCallProtocol &v(c_phoneCallProtocol()); + v.vflags.write(to); + v.vmin_layer.write(to); + v.vmax_layer.write(to); +} +inline MTPphoneCallProtocol::MTPphoneCallProtocol(MTPDphoneCallProtocol *_data) : mtpDataOwner(_data) { +} +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDphoneCallProtocol::Flags) +inline MTPphoneCallProtocol MTP_phoneCallProtocol(const MTPflags &_flags, MTPint _min_layer, MTPint _max_layer) { + return MTP::internal::TypeCreator::new_phoneCallProtocol(_flags, _min_layer, _max_layer); +} + +inline MTPphone_phoneCall::MTPphone_phoneCall() : mtpDataOwner(new MTPDphone_phoneCall()) { +} + +inline uint32 MTPphone_phoneCall::innerLength() const { + const MTPDphone_phoneCall &v(c_phone_phoneCall()); + return v.vphone_call.innerLength() + v.vusers.innerLength(); +} +inline mtpTypeId MTPphone_phoneCall::type() const { + return mtpc_phone_phoneCall; +} +inline void MTPphone_phoneCall::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_phone_phoneCall) throw mtpErrorUnexpected(cons, "MTPphone_phoneCall"); + + if (!data) setData(new MTPDphone_phoneCall()); + MTPDphone_phoneCall &v(_phone_phoneCall()); + v.vphone_call.read(from, end); + v.vusers.read(from, end); +} +inline void MTPphone_phoneCall::write(mtpBuffer &to) const { + const MTPDphone_phoneCall &v(c_phone_phoneCall()); + v.vphone_call.write(to); + v.vusers.write(to); +} +inline MTPphone_phoneCall::MTPphone_phoneCall(MTPDphone_phoneCall *_data) : mtpDataOwner(_data) { +} +inline MTPphone_phoneCall MTP_phone_phoneCall(const MTPPhoneCall &_phone_call, const MTPVector &_users) { + return MTP::internal::TypeCreator::new_phone_phoneCall(_phone_call, _users); +} + +inline uint32 MTPphoneCallDiscardReason::innerLength() const { + return 0; +} +inline mtpTypeId MTPphoneCallDiscardReason::type() const { + t_assert(_type != 0); + return _type; +} +inline void MTPphoneCallDiscardReason::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + switch (cons) { + case mtpc_phoneCallDiscardReasonMissed: _type = cons; break; + case mtpc_phoneCallDiscardReasonDisconnect: _type = cons; break; + case mtpc_phoneCallDiscardReasonHangup: _type = cons; break; + case mtpc_phoneCallDiscardReasonBusy: _type = cons; break; + default: throw mtpErrorUnexpected(cons, "MTPphoneCallDiscardReason"); + } +} +inline void MTPphoneCallDiscardReason::write(mtpBuffer &to) const { +} +inline MTPphoneCallDiscardReason::MTPphoneCallDiscardReason(mtpTypeId type) : _type(type) { + switch (type) { + case mtpc_phoneCallDiscardReasonMissed: break; + case mtpc_phoneCallDiscardReasonDisconnect: break; + case mtpc_phoneCallDiscardReasonHangup: break; + case mtpc_phoneCallDiscardReasonBusy: break; + default: throw mtpErrorBadTypeId(type, "MTPphoneCallDiscardReason"); + } +} +inline MTPphoneCallDiscardReason MTP_phoneCallDiscardReasonMissed() { + return MTP::internal::TypeCreator::new_phoneCallDiscardReasonMissed(); +} +inline MTPphoneCallDiscardReason MTP_phoneCallDiscardReasonDisconnect() { + return MTP::internal::TypeCreator::new_phoneCallDiscardReasonDisconnect(); +} +inline MTPphoneCallDiscardReason MTP_phoneCallDiscardReasonHangup() { + return MTP::internal::TypeCreator::new_phoneCallDiscardReasonHangup(); +} +inline MTPphoneCallDiscardReason MTP_phoneCallDiscardReasonBusy() { + return MTP::internal::TypeCreator::new_phoneCallDiscardReasonBusy(); +} inline MTPDmessage::Flags mtpCastFlags(MTPDmessageService::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } inline MTPDmessage::Flags mtpCastFlags(MTPflags flags) { return mtpCastFlags(flags.v); } inline MTPDmessage::Flags mtpCastFlags(MTPDupdateShortMessage::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } diff --git a/Telegram/SourceFiles/observer_peer.h b/Telegram/SourceFiles/observer_peer.h index ebf57e71be..5cf4f5b6b9 100644 --- a/Telegram/SourceFiles/observer_peer.h +++ b/Telegram/SourceFiles/observer_peer.h @@ -42,11 +42,12 @@ struct PeerUpdate { NotificationsEnabled = 0x00000010U, SharedMediaChanged = 0x00000020U, MigrationChanged = 0x00000040U, + PinnedChanged = 0x00000080U, // For chats and channels - InviteLinkChanged = 0x00000020U, - MembersChanged = 0x00000040U, - AdminsChanged = 0x00000080U, + InviteLinkChanged = 0x00000100U, + MembersChanged = 0x00000200U, + AdminsChanged = 0x00000400U, // For users UserCanShareContact = 0x00010000U, diff --git a/Telegram/SourceFiles/settings/settings_cover.cpp b/Telegram/SourceFiles/settings/settings_cover.cpp index 3c7b7dcfaa..ddfc1fb97d 100644 --- a/Telegram/SourceFiles/settings/settings_cover.cpp +++ b/Telegram/SourceFiles/settings/settings_cover.cpp @@ -265,9 +265,6 @@ void CoverWidget::notifyPeerUpdated(const Notify::PeerUpdate &update) { if (update.flags & Notify::PeerUpdate::Flag::NameChanged) { refreshNameText(); } - //if (update.flags & UpdateFlag::UserOnlineChanged) { // TODO - // refreshStatusText(); - //} } void CoverWidget::refreshNameText() {