diff --git a/Telegram/Resources/lang.txt b/Telegram/Resources/lang.txt index 2824bf74f2a4e9..3a4d9273fdb1da 100644 --- a/Telegram/Resources/lang.txt +++ b/Telegram/Resources/lang.txt @@ -122,6 +122,8 @@ lng_signup_firstname: "First Name"; lng_signup_lastname: "Last Name"; lng_dlg_filter: "Search"; +lng_dlg_conversations: "Conversations"; +lng_dlg_messages: "Messages"; lng_dlg_new_group_name: "Group name"; lng_dlg_create_group: "Create"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index a7aa82ee40716c..69abf56f49bee5 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -153,11 +153,12 @@ btnDefBig: flatButton(btnDefFlat) { overFont: font(23px); height: 56px; } +btnNextBG: #2fa9e2; btnDefNext: flatButton(btnDefFlat) { color: white; overColor: white; downColor: white; - bgColor: #2fa9e2; + bgColor: btnNextBG; overBgColor: #279ad0; downBgColor: #279ad0; } @@ -593,6 +594,23 @@ dlgPaddingVer: 8px; dlgHeight: 62px; dlgPhotoPadding: 12px; +dlgState: switcher { + border: 2px; + borderColor: btnNextBG; + + bgColor: #fff; + bgHovered: btnWhiteHover; + bgActive: btnNextBG; + + height: 34px; + + font: font(fsize); + textColor: btnYesColor; + activeColor: #fff; + + duration: 200; +} + dlgSep: 8px; dlgShadowColor: rgba(0, 0, 0, 24);//#ebebeb @@ -709,6 +727,24 @@ topBarActionSkip: 13px; topBarSelectedPos: point(18px, 18px); historyBG: #dfe4e8; + +historyToEnd: iconedButton(btnDefIconed) { + bgColor: transparent; + overBgColor: transparent; + + icon: sprite(252px, 41px, 44px, 44px); + iconPos: point(0px, 0px); + downIcon: sprite(252px, 41px, 44px, 44px); + downIconPos: point(0px, 0px); + + width: 44px; + height: 44px; +} +historyToEndSkip: 10px; + +activeFadeInDuration: 500; +activeFadeOutDuration: 3000; + msgMaxWidth: 550px; msgFont: font(fsize); msgNameFont: font(fsize semibold); @@ -765,9 +801,9 @@ msgDateSpace: 19px; msgDateCheckSpace: 4px; msgDateDelta: point(2px, 5px); -msgImgSendingRect: sprite(280px, 40px, 20px, 20px); +msgImgSendingRect: sprite(320px, 65px, 20px, 20px); msgImgCheckRect: sprite(280px, 20px, 20px, 20px); -msgImgDblCheckRect: sprite(260px, 40px, 20px, 20px); +msgImgDblCheckRect: sprite(300px, 65px, 20px, 20px); msgDateImgDelta: 4px; msgDateImgColor: #fff; msgDateImgBg: #00000054; @@ -877,8 +913,8 @@ btnAttachDocument: iconedButton(btnDefIconed) { height: 46px; } btnAttachPhoto: iconedButton(btnAttachDocument) { - icon: sprite(278px, 68px, 24px, 24px); - downIcon: sprite(278px, 68px, 24px, 24px); + icon: sprite(113px, 0px, 24px, 24px); + downIcon: sprite(113px, 0px, 24px, 24px); } btnAttachEmoji: iconedButton(btnAttachDocument) { overBgColor: white; @@ -957,6 +993,10 @@ btnAddContact: iconedButton(btnNewGroup) { icon: sprite(188px, 93px, 18px, 18px); downIcon: sprite(188px, 93px, 18px, 18px); } +btnCancelSearch: iconedButton(btnNewGroup) { + icon: sprite(188px, 43px, 18px, 18px); + downIcon: sprite(188px, 43px, 18px, 18px); +} notifyBG: white; notifyBorder: #f1f1f1; @@ -1245,8 +1285,8 @@ dropdownAttachDocument: iconedButton(btnAttachDocument) { downTextPos: point(50px, 14px); } dropdownAttachPhoto: iconedButton(dropdownAttachDocument) { - icon: sprite(278px, 68px, 24px, 24px); - downIcon: sprite(278px, 68px, 24px, 24px); + icon: sprite(113px, 0px, 24px, 24px); + downIcon: sprite(113px, 0px, 24px, 24px); } dragFont: font(28px semibold); diff --git a/Telegram/Resources/style_classes.txt b/Telegram/Resources/style_classes.txt index 568e08ace7696a..afa7a33844bb35 100644 --- a/Telegram/Resources/style_classes.txt +++ b/Telegram/Resources/style_classes.txt @@ -229,3 +229,20 @@ flatLabel { width: number; align: align; } + +switcher { + border: number; + borderColor: color; + + bgColor: color; + bgHovered: color; + bgActive: color; + + height: number; + + font: font; + textColor: color; + activeColor: color; + + duration: number; +} diff --git a/Telegram/Setup.iss b/Telegram/Setup.iss index bc6015c830f5a6..bd1121cd49b29f 100644 --- a/Telegram/Setup.iss +++ b/Telegram/Setup.iss @@ -3,9 +3,9 @@ #define MyAppShortName "Telegram" #define MyAppName "Telegram Win (Unofficial)" -#define MyAppVersion "0.5.4" -#define MyAppVersionZero "0.5.4" -#define MyAppFullVersion "0.5.4.0" +#define MyAppVersion "0.5.6" +#define MyAppVersionZero "0.5.6" +#define MyAppFullVersion "0.5.6.0" #define MyAppPublisher "Telegram (Unofficial)" #define MyAppURL "https://tdesktop.com" #define MyAppExeName "Telegram.exe" diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 7f0f2c03c29153..a600950d786a11 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -508,7 +508,7 @@ namespace App { } } for (QMap::const_iterator i = msgsIds.cbegin(), e = msgsIds.cend(); i != e; ++i) { - histories().addToBack(v[*i], newMsgs); + histories().addToBack(v[*i], newMsgs ? 1 : 0); } } @@ -557,9 +557,6 @@ namespace App { if (j != msgsData.cend()) { History *h = (*j)->history(); (*j)->destroy(); - if (h->isEmpty()) { - if (App::main()) App::main()->checkPeerHistory(h->peer); - } } } } @@ -1100,23 +1097,26 @@ namespace App { return 0; } - bool historyRegItem(HistoryItem *item) { + HistoryItem *historyRegItem(HistoryItem *item) { MsgsData::const_iterator i = msgsData.constFind(item->id); if (i == msgsData.cend()) { msgsData.insert(item->id, item); if (item->id > ::maxMsgId) ::maxMsgId = item->id; - return true; + return 0; } - return (i.value() == item); - } - - void historyUnregItem(HistoryItem *item) { - MsgsData::iterator i = msgsData.find(item->id); - if (i != msgsData.cend()) { - if (i.value() == item) { - msgsData.erase(i); + if (i.value() != item && !i.value()->block() && item->block()) { // replace search item + item->history()->itemReplaced(i.value(), item); + if (App::main()) { + emit App::main()->historyItemReplaced(i.value(), item); } + delete i.value(); + msgsData.insert(item->id, item); + return 0; } + return (i.value() == item) ? 0 : i.value(); + } + + void historyItemDetached(HistoryItem *item) { if (::hoveredItem == item) { hoveredItem(0); } @@ -1135,13 +1135,32 @@ namespace App { if (::mousedItem == item) { mousedItem(0); } + } + + void historyUnregItem(HistoryItem *item) { + MsgsData::iterator i = msgsData.find(item->id); + if (i != msgsData.cend()) { + if (i.value() == item) { + msgsData.erase(i); + } + } + historyItemDetached(item); if (App::main()) { emit App::main()->historyItemDeleted(item); } } void historyClearMsgs() { + QVector toDelete; + for (MsgsData::const_iterator i = msgsData.cbegin(), e = msgsData.cend(); i != e; ++i) { + if ((*i)->detached()) { + toDelete.push_back(*i); + } + } msgsData.clear(); + for (int i = 0, l = toDelete.size(); i < l; ++i) { + delete toDelete[i]; + } ::maxMsgId = 0; ::hoveredItem = ::pressedItem = ::hoveredLinkItem = ::pressedLinkItem = ::contextItem = 0; } @@ -1224,6 +1243,12 @@ namespace App { textlnkOver(TextLinkPtr()); textlnkDown(TextLinkPtr()); + if (completely && App::main()) { + App::main()->disconnect(SIGNAL(historyItemDeleted(HistoryItem *))); + } + + histories().clear(); + if (completely) { LOG(("Deleting sound..")); delete newMsgSound; @@ -1242,12 +1267,6 @@ namespace App { clearStorageImages(); } - if (App::main()) { - App::main()->disconnect(SIGNAL(historyItemDeleted(HistoryItem*))); - } - - histories().clear(); - serviceImageCacheSize = imageCacheSize(); } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 8a20785ace0c6d..8bb4636ffbaf65 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -116,7 +116,8 @@ namespace App { History *history(const PeerId &peer, int32 unreadCnt = 0); History *historyLoaded(const PeerId &peer); HistoryItem *histItemById(MsgId itemId); - bool historyRegItem(HistoryItem *item); + HistoryItem *historyRegItem(HistoryItem *item); + void historyItemDetached(HistoryItem *item); void historyUnregItem(HistoryItem *item); void historyClearMsgs(); void historyClearItems(); diff --git a/Telegram/SourceFiles/art/sprite.png b/Telegram/SourceFiles/art/sprite.png index b1713b0737a9fc..2f5830726de430 100644 Binary files a/Telegram/SourceFiles/art/sprite.png and b/Telegram/SourceFiles/art/sprite.png differ diff --git a/Telegram/SourceFiles/art/sprite_200x.png b/Telegram/SourceFiles/art/sprite_200x.png index 5da23c725e9cab..1d5a6885a31556 100644 Binary files a/Telegram/SourceFiles/art/sprite_200x.png and b/Telegram/SourceFiles/art/sprite_200x.png differ diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 1009be8eb8a497..94cb2b50926277 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -210,7 +210,7 @@ void ContactsInner::chooseParticipant() { } if (r) { App::wnd()->hideSettings(true); - App::main()->showPeer(r->history->peer->id, false, true); + App::main()->showPeer(r->history->peer->id, 0, false, true); App::wnd()->hideLayer(); } diff --git a/Telegram/SourceFiles/boxes/newgroupbox.cpp b/Telegram/SourceFiles/boxes/newgroupbox.cpp index 3030a59e4410d9..4f994aeb022d2d 100644 --- a/Telegram/SourceFiles/boxes/newgroupbox.cpp +++ b/Telegram/SourceFiles/boxes/newgroupbox.cpp @@ -438,6 +438,15 @@ QVector NewGroupInner::selectedInputs() { return result; } +PeerData *NewGroupInner::selectedUser() { + for (ContactsData::const_iterator i = _contactsData.cbegin(), e = _contactsData.cend(); i != e; ++i) { + if (i.value()->check) { + return i.key(); + } + } + return 0; +} + NewGroupBox::NewGroupBox() : _scroll(this, st::newGroupScroll), _inner(), _filter(this, st::contactsFilter, lang(lng_participant_filter)), _next(this, lang(lng_create_group_next), st::btnSelectDone), @@ -579,13 +588,15 @@ void NewGroupBox::onClose() { void NewGroupBox::onNext() { MTPVector users(MTP_vector(_inner.selectedInputs())); - if (users.c_vector().v.isEmpty()) { + const QVector &v(users.c_vector().v); + if (v.isEmpty()) { _filter.setFocus(); _filter.notaBene(); - return; + } else if (v.size() == 1) { + App::main()->showPeer(_inner.selectedUser()->id); + } else { + App::wnd()->replaceLayer(new CreateGroupBox(users)); } - - App::wnd()->replaceLayer(new CreateGroupBox(users)); } void NewGroupBox::onScroll() { diff --git a/Telegram/SourceFiles/boxes/newgroupbox.h b/Telegram/SourceFiles/boxes/newgroupbox.h index 5ae9e96b61d3f3..f08804f1385929 100644 --- a/Telegram/SourceFiles/boxes/newgroupbox.h +++ b/Telegram/SourceFiles/boxes/newgroupbox.h @@ -39,6 +39,7 @@ class NewGroupInner : public QWidget { void selectSkipPage(int32 h, int32 dir); QVector selectedInputs(); + PeerData *selectedUser(); void loadProfilePhotos(int32 yFrom); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index bc4f5f8fd79951..92168928abecc2 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com */ #pragma once -static const int32 AppVersion = 5005; -static const wchar_t *AppVersionStr = L"0.5.5"; +static const int32 AppVersion = 5006; +static const wchar_t *AppVersionStr = L"0.5.6"; #ifdef Q_OS_WIN static const wchar_t *AppName = L"Telegram Win (Unofficial)"; #else @@ -56,7 +56,12 @@ enum { LocalEncryptSaltSize = 32, // 256 bit LocalEncryptKeySize = 256, // 2048 bit + AnimationTimerDelta = 7, + SaveRecentEmojisTimeout = 3000, // 3 secs + + AutoSearchTimeout = 1500, // 1.5 secs + SearchPerPage = 50, }; #ifdef Q_OS_WIN diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index f76fa942636968..655fc2d472ec56 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -26,11 +26,16 @@ Copyright (c) 2014 John Preston, https://tdesktop.com #include "boxes/newgroupbox.h" DialogsListWidget::DialogsListWidget(QWidget *parent, MainWidget *main) : QWidget(parent), -dialogs(false), contactsNoDialogs(true), contacts(true), sel(0), contactSel(false), selByMouse(false), filteredSel(-1) { +dialogs(false), contactsNoDialogs(true), contacts(true), sel(0), contactSel(false), selByMouse(false), filteredSel(-1), searchedSel(-1), _state(DefaultState) { connect(main, SIGNAL(dialogToTop(const History::DialogLinks &)), this, SLOT(onDialogToTop(const History::DialogLinks &))); connect(main, SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(onPeerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &))); connect(main, SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(onPeerPhotoChanged(PeerData *))); connect(main, SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *))); + connect(main, SIGNAL(historyItemReplaced(HistoryItem *, HistoryItem *)), this, SLOT(onItemReplaced(HistoryItem *, HistoryItem *))); + connect(main, SIGNAL(historyItemDeleted(HistoryItem *)), this, SLOT(onItemRemoved(HistoryItem *))); + + _updateSearchTimer.setSingleShot(true); + connect(&_updateSearchTimer, SIGNAL(timeout()), this, SIGNAL(searchMessages())); } void DialogsListWidget::paintEvent(QPaintEvent *e) { @@ -42,7 +47,7 @@ void DialogsListWidget::paintEvent(QPaintEvent *e) { p.setClipRect(r); } - if (filter.isEmpty()) { + if (_state == DefaultState) { int32 otherStart = dialogs.list.count * st::dlgHeight; PeerData *active = App::main()->activePeer(), *selected = sel ? sel->history->peer : 0; if (otherStart) { @@ -53,21 +58,40 @@ void DialogsListWidget::paintEvent(QPaintEvent *e) { } else if (!otherStart) { // .. paint no dialogs found } - } else { - if (filtered.isEmpty()) { + } else if (_state == FilteredState) { + if (filterResults.isEmpty()) { // .. paint no dialogs } else { int32 from = r.top() / int32(st::dlgHeight); if (from < 0) from = 0; - if (from < filtered.size()) { + if (from < filterResults.size()) { int32 to = (r.bottom() / int32(st::dlgHeight)) + 1, w = width(); - if (to > filtered.size()) to = filtered.size(); + if (to > filterResults.size()) to = filterResults.size(); p.translate(0, from * st::dlgHeight); for (; from < to; ++from) { - bool active = (filtered[from]->history->peer == App::main()->activePeer()); + bool active = (filterResults[from]->history->peer == App::main()->activePeer()); bool selected = (from == filteredSel); - filtered[from]->paint(p, w, active, selected); + filterResults[from]->paint(p, w, active, selected); + p.translate(0, st::dlgHeight); + } + } + } + } else if (_state == SearchedState) { + if (searchResults.isEmpty()) { + // .. paint no dialogs + } else { + int32 from = r.top() / int32(st::dlgHeight); + if (from < 0) from = 0; + if (from < searchResults.size()) { + int32 to = (r.bottom() / int32(st::dlgHeight)) + 1, w = width(); + if (to > searchResults.size()) to = searchResults.size(); + + p.translate(0, from * st::dlgHeight); + for (; from < to; ++from) { + bool active = (searchResults[from]->_item->id == App::main()->activeMsgId()); + bool selected = (from == searchedSel); + searchResults[from]->paint(p, w, active, selected); p.translate(0, st::dlgHeight); } } @@ -76,7 +100,11 @@ void DialogsListWidget::paintEvent(QPaintEvent *e) { } void DialogsListWidget::activate() { - if ((filter.isEmpty() && !sel) || (!filter.isEmpty() && (filteredSel < 0 || filteredSel >= filtered.size()))) { + if ( + (_state == DefaultState && !sel) || + (_state == FilteredState && (filteredSel < 0 || filteredSel >= filterResults.size())) || + (_state == SearchedState && (searchedSel < 0 || searchedSel >= searchResults.size())) + ) { selectSkip(1); } } @@ -93,7 +121,7 @@ void DialogsListWidget::onUpdateSelected(bool force) { if ((!force && !rect().contains(mouse)) || !selByMouse) return; int w = width(), mouseY = mouse.y(); - if (filter.isEmpty()) { + if (_state == DefaultState) { DialogRow *newSel = dialogs.list.rowAtY(mouseY, st::dlgHeight); int32 otherStart = dialogs.list.count * st::dlgHeight; if (newSel) { @@ -102,32 +130,35 @@ void DialogsListWidget::onUpdateSelected(bool force) { newSel = contactsNoDialogs.list.rowAtY(mouseY - otherStart, st::dlgHeight); contactSel = true; } - if (contactSel) { - mouse.setY(mouse.y() - otherStart); - } - if (newSel) { - mouse.setY(mouse.y() - newSel->pos * st::dlgHeight); - } if (newSel != sel) { sel = newSel; setCursor(sel ? style::cur_pointer : style::cur_default); parentWidget()->update(); } - } else { - if (!filtered.isEmpty()) { + } else if (_state == FilteredState) { + if (!filterResults.isEmpty()) { int32 newFilteredSel = mouseY / int32(st::dlgHeight); - if (newFilteredSel < 0 || newFilteredSel >= filtered.size()) { + if (newFilteredSel < 0 || newFilteredSel >= filterResults.size()) { newFilteredSel = -1; } - if (newFilteredSel >= 0) { - mouse.setY(mouse.y() - newFilteredSel * st::dlgHeight); - } if (newFilteredSel != filteredSel) { filteredSel = newFilteredSel; setCursor((filteredSel >= 0) ? style::cur_pointer : style::cur_default); parentWidget()->update(); } } + } else if (_state == SearchedState) { + if (!searchResults.isEmpty()) { + int32 newSearchedSel = mouseY / int32(st::dlgHeight); + if (newSearchedSel < 0 || newSearchedSel >= searchResults.size()) { + newSearchedSel = -1; + } + if (newSearchedSel != searchedSel) { + searchedSel = newSearchedSel; + setCursor((searchedSel >= 0) ? style::cur_pointer : style::cur_default); + parentWidget()->update(); + } + } } } @@ -141,14 +172,14 @@ void DialogsListWidget::mousePressEvent(QMouseEvent *e) { } void DialogsListWidget::onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow) { - if (!filter.isEmpty()) { - for (FilteredDialogs::iterator i = filtered.begin(), e = filtered.end(); i != e;) { + if (_state == FilteredState) { + for (FilteredDialogs::iterator i = filterResults.begin(); i != filterResults.end();) { if (*i == oldRow) { // this row is shown in filtered and maybe is in contacts! if (newRow) { *i = newRow; ++i; } else { - i = filtered.erase(i); + i = filterResults.erase(i); } } else { ++i; @@ -210,11 +241,11 @@ void DialogsListWidget::removeContact(UserData *user) { } void DialogsListWidget::dlgUpdated(DialogRow *row) { - if (filter.isEmpty()) { + if (_state == DefaultState) { update(0, row->pos * st::dlgHeight, width(), st::dlgHeight); - } else { + } else if (_state == FilteredState) { int32 cnt = 0; - for (FilteredDialogs::const_iterator i = filtered.cbegin(), e = filtered.cend(); i != e; ++i) { + for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) { if ((*i)->history == row->history) { update(0, cnt * st::dlgHeight, width(), st::dlgHeight); break; @@ -225,7 +256,7 @@ void DialogsListWidget::dlgUpdated(DialogRow *row) { } void DialogsListWidget::dlgUpdated(History *history) { - if (filter.isEmpty()) { + if (_state == DefaultState) { DialogRow *row = 0; DialogsList::RowByPeer::iterator i = dialogs.list.rowByPeer.find(history->peer->id); if (i != dialogs.list.rowByPeer.cend()) { @@ -236,15 +267,24 @@ void DialogsListWidget::dlgUpdated(History *history) { update(0, (dialogs.list.count + i.value()->pos) * st::dlgHeight, width(), st::dlgHeight); } } - } else { + } else if (_state == FilteredState) { int32 cnt = 0; - for (FilteredDialogs::const_iterator i = filtered.cbegin(), e = filtered.cend(); i != e; ++i) { + for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) { if ((*i)->history == history) { update(0, cnt * st::dlgHeight, width(), st::dlgHeight); break; } ++cnt; } + } else if (_state == SearchedState) { + int32 cnt = 0; + for (SearchResults::const_iterator i = searchResults.cbegin(), e = searchResults.cend(); i != e; ++i) { + if ((*i)->_item->history() == history) { + update(0, cnt * st::dlgHeight, width(), st::dlgHeight); + break; + } + ++cnt; + } } } @@ -290,9 +330,14 @@ void DialogsListWidget::onPeerPhotoChanged(PeerData *peer) { parentWidget()->update(); } -void DialogsListWidget::onFilterUpdate(QString newFilter) { +void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) { + if (_state == SearchedState && !newFilter.trimmed().isEmpty()) { + _updateSearchTimer.start(AutoSearchTimeout); + return; + } + newFilter = textAccentFold(newFilter.trimmed().toLower()); - if (newFilter != filter) { + if (newFilter != filter || force) { QStringList f; if (!newFilter.isEmpty()) { QStringList filterList = newFilter.split(cWordSplit(), QString::SkipEmptyParts); @@ -306,12 +351,16 @@ void DialogsListWidget::onFilterUpdate(QString newFilter) { } newFilter = f.join(' '); } - if (newFilter != filter) { + if (newFilter != filter || force) { filter = newFilter; - if (!filter.isEmpty()) { + if (filter.isEmpty()) { + _state = DefaultState; + filterResults.clear(); + } else { QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi; - filtered.clear(); + _state = FilteredState; + filterResults.clear(); if (!f.isEmpty()) { DialogsList *dialogsToFilter = 0, *contactsNoDialogsToFilter = 0; if (dialogs.list.count) { @@ -338,7 +387,7 @@ void DialogsListWidget::onFilterUpdate(QString newFilter) { } } } - filtered.reserve((dialogsToFilter ? dialogsToFilter->count : 0) + (contactsNoDialogsToFilter ? contactsNoDialogsToFilter->count : 0)); + filterResults.reserve((dialogsToFilter ? dialogsToFilter->count : 0) + (contactsNoDialogsToFilter ? contactsNoDialogsToFilter->count : 0)); if (dialogsToFilter && dialogsToFilter->count) { for (DialogRow *i = dialogsToFilter->begin, *e = dialogsToFilter->end; i != e; i = i->next) { const PeerData::Names &names(i->history->peer->names); @@ -355,7 +404,7 @@ void DialogsListWidget::onFilterUpdate(QString newFilter) { } } if (fi == fe) { - filtered.push_back(i); + filterResults.push_back(i); } } } @@ -375,7 +424,7 @@ void DialogsListWidget::onFilterUpdate(QString newFilter) { } } if (fi == fe) { - filtered.push_back(i); + filterResults.push_back(i); } } } @@ -387,6 +436,41 @@ void DialogsListWidget::onFilterUpdate(QString newFilter) { } } +DialogsListWidget::~DialogsListWidget() { + clearSearchResults(); +} + +void DialogsListWidget::clearSearchResults() { + if (!searchResults.isEmpty()) { + for (SearchResults::const_iterator i = searchResults.cbegin(), e = searchResults.cend(); i != e; ++i) { + delete *i; + } + searchResults.clear(); + } +} + +void DialogsListWidget::onItemReplaced(HistoryItem *oldItem, HistoryItem *newItem) { + for (int i = 0; i < searchResults.size(); ++i) { + if (searchResults[i]->_item == oldItem) { + searchResults[i]->_item = newItem; + } + } +} + +void DialogsListWidget::onItemRemoved(HistoryItem *item) { + int wasCount = searchResults.size(); + for (int i = 0; i < searchResults.size(); ++i) { + if (searchResults[i]->_item == item) { + searchResults.remove(i); + } else { + ++i; + } + } + if (wasCount != searchResults.size()) { + refresh(); + } +} + void DialogsListWidget::dialogsReceived(const QVector &added) { for (QVector::const_iterator i = added.cbegin(), e = added.cend(); i != e; ++i) { if (i->type() == mtpc_dialog) { @@ -401,6 +485,17 @@ void DialogsListWidget::dialogsReceived(const QVector &added) { refresh(); } +void DialogsListWidget::searchReceived(const QVector &messages, bool fromStart) { + if (fromStart) { + clearSearchResults(); + } + for (QVector::const_iterator i = messages.cbegin(), e = messages.cend(); i != e; ++i) { + HistoryItem *item = App::histories().addToBack(*i, -1); + searchResults.push_back(new FakeDialogRow(item)); + } + refresh(); +} + void DialogsListWidget::contactsReceived(const QVector &contacts) { for (QVector::const_iterator i = contacts.cbegin(), e = contacts.cend(); i != e; ++i) { addNewContact(i->c_contact().vuser_id.v); @@ -436,7 +531,15 @@ int32 DialogsListWidget::addNewContact(int32 uid, bool select) { } void DialogsListWidget::refresh(bool toTop) { - resize(width(), (filter.isEmpty() ? (dialogs.list.count + contactsNoDialogs.list.count) : filtered.count()) * st::dlgHeight); + int32 cnt = 0; + if (_state == DefaultState) { + cnt = dialogs.list.count + contactsNoDialogs.list.count; + } else if (_state == FilteredState) { + cnt = filterResults.count(); + } else if (_state == SearchedState) { + cnt = searchResults.count(); + } + resize(width(), cnt * st::dlgHeight); if (toTop) { emit mustScrollTo(0, 0); loadPeerPhotos(0); @@ -447,17 +550,37 @@ void DialogsListWidget::refresh(bool toTop) { void DialogsListWidget::setMouseSel(bool msel, bool toTop) { selByMouse = msel; if (!selByMouse && toTop) { - if (filter.isEmpty()) { + if (_state == DefaultState) { sel = (dialogs.list.count ? dialogs.list.begin : (contactsNoDialogs.list.count ? contactsNoDialogs.list.begin : 0)); contactSel = !dialogs.list.count && contactsNoDialogs.list.count; - } else { + } else if (_state == FilteredState) { filteredSel = 0; + } else if (_state == SearchedState) { + searchedSel = -1; // don't select first elem in search } } } +void DialogsListWidget::setState(State newState) { + _state = newState; + if (_state == DefaultState || _state == FilteredState) { + clearSearchResults(); + searchedSel = -1; + } else if (_state == DefaultState || _state == SearchedState) { + filterResults.clear(); + filteredSel = -1; + } + onFilterUpdate(filter, true); + refresh(true); +} + +DialogsListWidget::State DialogsListWidget::state() const { + return _state; +} + void DialogsListWidget::clearFilter() { - if (!filter.isEmpty()) { + if (_state == FilteredState) { + _state = DefaultState; filter = QString(); refresh(true); } @@ -473,7 +596,7 @@ void DialogsListWidget::addDialog(const MTPDdialog &dialog) { } void DialogsListWidget::selectSkip(int32 direction) { - if (filter.isEmpty()) { + if (_state == DefaultState) { if (!sel) { if (dialogs.list.count && direction > 0) { sel = dialogs.list.begin; @@ -499,20 +622,27 @@ void DialogsListWidget::selectSkip(int32 direction) { } int32 fromY = (sel->pos + (contactSel ? dialogs.list.count : 0)) * st::dlgHeight; emit mustScrollTo(fromY, fromY + st::dlgHeight); - } else { - if (filtered.isEmpty()) return; - int32 newSel = snap(filteredSel + direction, 0, filtered.size() - 1); + } else if (_state == FilteredState) { + if (filterResults.isEmpty()) return; + int32 newSel = snap(filteredSel + direction, 0, filterResults.size() - 1); if (newSel != filteredSel) { filteredSel = newSel; } emit mustScrollTo(filteredSel * st::dlgHeight, (filteredSel + 1) * st::dlgHeight); + } else if (_state == SearchedState) { + if (searchResults.isEmpty()) return; + int32 newSel = snap(searchedSel + direction, 0, searchResults.size() - 1); + if (newSel != searchedSel) { + searchedSel = newSel; + } + emit mustScrollTo(searchedSel * st::dlgHeight, (searchedSel + 1) * st::dlgHeight); } parentWidget()->update(); } void DialogsListWidget::scrollToPeer(const PeerId &peer) { int32 fromY = -1; - if (filter.isEmpty()) { + if (_state == DefaultState) { DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(peer); if (i != dialogs.list.rowByPeer.cend()) { fromY = i.value()->pos * st::dlgHeight; @@ -522,9 +652,9 @@ void DialogsListWidget::scrollToPeer(const PeerId &peer) { fromY = (i.value()->pos + dialogs.list.count) * st::dlgHeight; } } - } else { - for (int32 i = 0, c = filtered.size(); i < c; ++i) { - if (filtered[i]->history->peer->id == peer) { + } else if (_state == FilteredState) { + for (int32 i = 0, c = filterResults.size(); i < c; ++i) { + if (filterResults[i]->history->peer->id == peer) { fromY = i * st::dlgHeight; break; } @@ -537,7 +667,7 @@ void DialogsListWidget::scrollToPeer(const PeerId &peer) { void DialogsListWidget::selectSkipPage(int32 pixels, int32 direction) { int32 toSkip = pixels / int32(st::dlgHeight); - if (filter.isEmpty()) { + if (_state == DefaultState) { if (!sel) { if (direction > 0 && dialogs.list.count) { sel = dialogs.list.begin; @@ -581,7 +711,7 @@ void DialogsListWidget::selectSkipPage(int32 pixels, int32 direction) { void DialogsListWidget::loadPeerPhotos(int32 yFrom) { int32 yTo = yFrom + parentWidget()->height() * 5; MTP::clearLoaderPriorities(); - if (filter.isEmpty()) { + if (_state == DefaultState) { int32 otherStart = dialogs.list.count * st::dlgHeight; if (yFrom < otherStart) { dialogs.list.adjustCurrent(yFrom, st::dlgHeight); @@ -599,99 +729,124 @@ void DialogsListWidget::loadPeerPhotos(int32 yFrom) { row->history->peer->photo->load(); } } - } else { + } else if (_state == FilteredState) { int32 from = yFrom / st::dlgHeight; if (from < 0) from = 0; - if (from < filtered.size()) { + if (from < filterResults.size()) { int32 to = (yTo / int32(st::dlgHeight)) + 1, w = width(); - if (to > filtered.size()) to = filtered.size(); + if (to > filterResults.size()) to = filterResults.size(); for (; from < to; ++from) { - filtered[from]->history->peer->photo->load(); + filterResults[from]->history->peer->photo->load(); + } + } + } else if (_state == SearchedState) { + int32 from = yFrom / st::dlgHeight; + if (from < 0) from = 0; + if (from < searchResults.size()) { + int32 to = (yTo / int32(st::dlgHeight)) + 1, w = width(); + if (to > searchResults.size()) to = searchResults.size(); + + for (; from < to; ++from) { + searchResults[from]->_item->history()->peer->photo->load(); } } } } -void DialogsListWidget::choosePeer() { - History *history = filter.isEmpty() ? (sel ? sel->history : 0) : ((filteredSel >= 0 && filteredSel < filtered.size()) ? filtered[filteredSel]->history : 0); +bool DialogsListWidget::choosePeer() { + History *history = 0; + MsgId msgId = 0; + if (_state == DefaultState) { + if (sel) history = sel->history; + } else if (_state == FilteredState) { + if (filteredSel >= 0 && filteredSel < filterResults.size()) history = filterResults[filteredSel]->history; + } else if (_state == SearchedState) { + if (searchedSel >= 0 && searchedSel < searchResults.size()) { + history = searchResults[searchedSel]->_item->history(); + msgId = searchResults[searchedSel]->_item->id; + } + } if (history) { - emit peerChosen(history->peer->id); + emit peerChosen(history->peer->id, msgId); sel = 0; filteredSel = -1; parentWidget()->update(); + return true; } + return false; } void DialogsListWidget::destroyData() { sel = 0; contactSel = false; filteredSel = 0; - filtered.clear(); + filterResults.clear(); filter.clear(); + searchedSel = 0; + clearSearchResults(); contacts.clear(); contactsNoDialogs.clear(); dialogs.clear(); } PeerData *DialogsListWidget::peerBefore(const PeerData *peer) const { - if (!filter.isEmpty()) { - if (filtered.isEmpty() || filtered.at(0)->history->peer == peer) return 0; - - for (FilteredDialogs::const_iterator b = filtered.cbegin(), i = b + 1, e = filtered.cend(); i != e; ++i) { - if ((*i)->history->peer == peer) { - FilteredDialogs::const_iterator j = i - 1; - return (*j)->history->peer; + if (_state == DefaultState) { + DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(peer->id); + if (i == dialogs.list.rowByPeer.constEnd()) { + i = contactsNoDialogs.list.rowByPeer.constFind(peer->id); + if (i == contactsNoDialogs.list.rowByPeer.cend()) { + return 0; + } + if (i.value()->prev) { + return i.value()->prev->history->peer; + } else if (dialogs.list.count) { + return dialogs.list.end->prev->history->peer; } - } - return 0; - } - - DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(peer->id); - if (i == dialogs.list.rowByPeer.constEnd()) { - i = contactsNoDialogs.list.rowByPeer.constFind(peer->id); - if (i == contactsNoDialogs.list.rowByPeer.cend()) { return 0; } if (i.value()->prev) { return i.value()->prev->history->peer; - } else if (dialogs.list.count) { - return dialogs.list.end->prev->history->peer; } - return 0; - } - if (i.value()->prev) { - return i.value()->prev->history->peer; + } else if (_state == FilteredState) { + if (filterResults.isEmpty() || filterResults.at(0)->history->peer == peer) return 0; + + for (FilteredDialogs::const_iterator b = filterResults.cbegin(), i = b + 1, e = filterResults.cend(); i != e; ++i) { + if ((*i)->history->peer == peer) { + FilteredDialogs::const_iterator j = i - 1; + return (*j)->history->peer; + } + } } return 0; } PeerData *DialogsListWidget::peerAfter(const PeerData *peer) const { - if (!filter.isEmpty()) { - for (FilteredDialogs::const_iterator i = filtered.cbegin(), e = filtered.cend(); i != e; ++i) { - if ((*i)->history->peer == peer) { - ++i; - return (i == e) ? 0 : (*i)->history->peer; + if (_state == DefaultState) { + DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(peer->id); + if (i == dialogs.list.rowByPeer.constEnd()) { + i = contactsNoDialogs.list.rowByPeer.constFind(peer->id); + if (i == contactsNoDialogs.list.rowByPeer.cend()) { + return 0; + } + if (i.value()->next != contactsNoDialogs.list.end) { + return i.value()->next->history->peer; } - } - return 0; - } - DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(peer->id); - if (i == dialogs.list.rowByPeer.constEnd()) { - i = contactsNoDialogs.list.rowByPeer.constFind(peer->id); - if (i == contactsNoDialogs.list.rowByPeer.cend()) { return 0; } - if (i.value()->next != contactsNoDialogs.list.end) { + + if (i.value()->next != dialogs.list.end) { return i.value()->next->history->peer; + } else if (contactsNoDialogs.list.count) { + return contactsNoDialogs.list.begin->history->peer; + } + } else if (_state == FilteredState) { + for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) { + if ((*i)->history->peer == peer) { + ++i; + return (i == e) ? 0 : (*i)->history->peer; + } } - return 0; - } - - if (i.value()->next != dialogs.list.end) { - return i.value()->next->history->peer; - } else if (contactsNoDialogs.list.count) { - return contactsNoDialogs.list.begin->history->peer; } return 0; } @@ -704,6 +859,10 @@ DialogsIndexed &DialogsListWidget::dialogsList() { return dialogs; } +DialogsListWidget::SearchResults &DialogsListWidget::searchList() { + return searchResults; +} + DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent) , _configLoaded(false) , _drawShadow(true) @@ -712,17 +871,21 @@ DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent) , dlgPreloading(0) , contactsRequest(0) , _filter(this, st::dlgFilter, lang(lng_dlg_filter)) +, _stateSwitcher(this, st::dlgState) , _newGroup(this, st::btnNewGroup) , _addContact(this, st::btnAddContact) +, _cancelSearch(this, st::btnCancelSearch) , scroll(this, st::dlgScroll) , list(&scroll, parent) +, _searchFull(false) { scroll.setWidget(&list); scroll.setFocusPolicy(Qt::NoFocus); connect(&list, SIGNAL(mustScrollTo(int, int)), &scroll, SLOT(scrollToY(int, int))); connect(&list, SIGNAL(dialogToTopFrom(int)), this, SLOT(onDialogToTopFrom(int))); -// connect(&list, SIGNAL(peerChosen(const PeerId &)), this, SLOT(onCancel())); - connect(&list, SIGNAL(peerChosen(const PeerId &)), this, SIGNAL(peerChosen(const PeerId &))); +// connect(&list, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SLOT(onCancel())); + connect(&list, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SIGNAL(peerChosen(const PeerId &, MsgId))); + connect(&list, SIGNAL(searchMessages()), this, SLOT(onSearchMessages())); connect(&scroll, SIGNAL(geometryChanged()), &list, SLOT(onParentGeometryChanged())); connect(&scroll, SIGNAL(scrolled()), &list, SLOT(onUpdateSelected())); connect(&scroll, SIGNAL(scrolled()), this, SLOT(onListScroll())); @@ -731,17 +894,26 @@ DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent) connect(parent, SIGNAL(dialogsUpdated()), this, SLOT(onListScroll())); connect(&_addContact, SIGNAL(clicked()), this, SLOT(onAddContact())); connect(&_newGroup, SIGNAL(clicked()), this, SLOT(onNewGroup())); + connect(&_cancelSearch, SIGNAL(clicked()), this, SLOT(onCancelSearch())); + + _stateSwitcher.addButton(lang(lng_dlg_conversations)); + _stateSwitcher.addButton(lang(lng_dlg_messages)); + _stateSwitcher.hide(); + + connect(&_stateSwitcher, SIGNAL(changed()), this, SLOT(onStateChange())); scroll.show(); _filter.show(); _filter.move(st::dlgPaddingHor, st::dlgFilterPadding); + _stateSwitcher.move(st::dlgPaddingHor, st::dlgFilterPadding * 2 + _filter.height()); _filter.setFocusPolicy(Qt::StrongFocus); _filter.customUpDown(true); _addContact.hide(); _newGroup.show(); + _cancelSearch.hide(); _newGroup.move(width() - _newGroup.width() - st::dlgPaddingHor, 0); _addContact.move(width() - _addContact.width() - st::dlgPaddingHor, 0); - scroll.move(0, _filter.height() + 2 * st::dlgFilterPadding); + _cancelSearch.move(width() - _cancelSearch.width() - st::dlgPaddingHor, 0); } void DialogsWidget::activate() { @@ -804,12 +976,16 @@ bool DialogsWidget::animStep(float64) { } void DialogsWidget::onCancel() { - list.clearFilter(); - _filter.clear(); - _filter.updatePlaceholder(); + onCancelSearch(); emit cancelled(); } +void DialogsWidget::clearFiltered() { + if (list.state() != DialogsListWidget::SearchedState) { + onCancel(); + } +} + void DialogsWidget::unreadCountsReceived(const QVector &dialogs) { for (QVector::const_iterator i = dialogs.cbegin(), e = dialogs.cend(); i != e; ++i) { const MTPDdialog &d(i->c_dialog()); @@ -875,6 +1051,32 @@ bool DialogsWidget::dialogsFailed(const RPCError &e) { return true; } +void DialogsWidget::onSearchMessages(bool force) { + QString q = _filter.text().trimmed(); + if (q.isEmpty()) { + if (_searchRequest) { + MTP::cancel(_searchRequest); + _searchRequest = 0; + } + if (force) { + list.setState(DialogsListWidget::DefaultState); + } + return; + } + if (force || _searchQuery != q) { + if (_searchRequest) MTP::cancel(_searchRequest); + _searchQuery = q; + _searchFull = false; + _searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, true), rpcFail(&DialogsWidget::searchFailed)); + } +} + +void DialogsWidget::onSearchMore(MsgId minMsgId) { + if (!_searchRequest && !_searchFull) { + _searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minMsgId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, !minMsgId), rpcFail(&DialogsWidget::searchFailed)); + } +} + void DialogsWidget::loadConfig() { if (!_configLoaded) { mtpConfigLoader()->load(); @@ -905,6 +1107,41 @@ bool DialogsWidget::contactsFailed() { return true; } +void DialogsWidget::searchReceived(bool fromStart, const MTPmessages_Messages &result, mtpRequestId req) { + if (_searchRequest == req) { + switch (result.type()) { + case mtpc_messages_messages: { + App::feedUsers(result.c_messages_messages().vusers); + App::feedChats(result.c_messages_messages().vchats); + const QVector &msgs(result.c_messages_messages().vmessages.c_vector().v); + list.searchReceived(msgs, fromStart); + if (msgs.isEmpty()) { + _searchFull = true; + } + } break; + + case mtpc_messages_messagesSlice: { + App::feedUsers(result.c_messages_messagesSlice().vusers); + App::feedChats(result.c_messages_messagesSlice().vchats); + const QVector &msgs(result.c_messages_messagesSlice().vmessages.c_vector().v); + list.searchReceived(msgs, fromStart); + if (msgs.isEmpty()) { + _searchFull = true; + } + } break; + } + _searchRequest = 0; + } +} + +bool DialogsWidget::searchFailed(const RPCError &error, mtpRequestId req) { + if (_searchRequest == req) { + _searchRequest = 0; + _searchFull = true; + } + return true; +} + bool DialogsWidget::addNewContact(int32 uid, bool show) { _filter.setText(QString()); onFilterUpdate(); @@ -917,21 +1154,53 @@ bool DialogsWidget::addNewContact(int32 uid, bool show) { void DialogsWidget::onListScroll() { list.loadPeerPhotos(scroll.scrollTop()); - if (scroll.scrollTop() > list.dialogsList().list.count * st::dlgHeight - scroll.height()) { + if (list.state() == DialogsListWidget::SearchedState) { + DialogsListWidget::SearchResults &res(list.searchList()); + if (scroll.scrollTop() > res.size() * st::dlgHeight - 2 * scroll.height()) { + onSearchMore(res.isEmpty() ? 0 : res.back()->_item->id); + } + } else if (scroll.scrollTop() > list.dialogsList().list.count * st::dlgHeight - scroll.height()) { loadDialogs(); } } void DialogsWidget::onFilterUpdate() { - list.onFilterUpdate(_filter.text()); + QString filterText = _filter.text(); + list.onFilterUpdate(filterText); + DialogsListWidget::State s = list.state(); + bool switcherVisible = (s != DialogsListWidget::DefaultState); + if (switcherVisible && _stateSwitcher.isHidden() || !switcherVisible && !_stateSwitcher.isHidden()) { + if (switcherVisible) { + _stateSwitcher.show(); + } else { + _stateSwitcher.hide(); + _stateSwitcher.setSelected(0); + } + resizeEvent(0); + } + if (filterText.isEmpty() && !_cancelSearch.isHidden()) { + _cancelSearch.hide(); + _newGroup.show(); + } else if (!filterText.isEmpty() && _cancelSearch.isHidden()) { + _cancelSearch.show(); + _newGroup.hide(); + } } void DialogsWidget::resizeEvent(QResizeEvent *e) { int32 w = width() - st::dlgShadow; _filter.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding, w - 2 * st::dlgPaddingHor, _filter.height()); + _stateSwitcher.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding * 2 + _filter.height(), _filter.width(), _filter.height()); _newGroup.move(w - _newGroup.width() - st::dlgPaddingHor, _filter.y()); _addContact.move(w - _addContact.width() - st::dlgPaddingHor, _filter.y()); - scroll.resize(w, height() - _filter.y() - _filter.height() - st::dlgFilterPadding - st::dlgPaddingVer); + _cancelSearch.move(w - _cancelSearch.width() - st::dlgPaddingHor, _filter.y()); + if (_stateSwitcher.isHidden()) { + scroll.move(0, _filter.height() + 2 * st::dlgFilterPadding); + scroll.resize(w, height() - _filter.y() - _filter.height() - st::dlgFilterPadding - st::dlgPaddingVer); + } else { + scroll.move(0, _filter.height() + _stateSwitcher.height() + 3 * st::dlgFilterPadding); + scroll.resize(w, height() - _stateSwitcher.y() - _stateSwitcher.height() - st::dlgFilterPadding - st::dlgPaddingVer); + } list.resize(w, list.height()); onListScroll(); } @@ -940,7 +1209,9 @@ void DialogsWidget::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Escape) { e->ignore(); } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { - list.choosePeer(); + if (!list.choosePeer() && list.state() == DialogsListWidget::SearchedState) { + onSearchMessages(); + } } else if (e->key() == Qt::Key_Down) { list.setMouseSel(false); list.selectSkip(1); @@ -981,7 +1252,9 @@ PeerData *DialogsWidget::peerAfter(const PeerData *peer) const { } void DialogsWidget::scrollToPeer(const PeerId &peer) { - list.scrollToPeer(peer); + if (list.state() != DialogsListWidget::SearchedState) { + list.scrollToPeer(peer); + } } void DialogsWidget::removePeer(PeerData *peer) { @@ -1008,6 +1281,32 @@ void DialogsWidget::onNewGroup() { App::wnd()->showLayer(new NewGroupBox()); } +void DialogsWidget::onCancelSearch() { + list.clearFilter(); + _filter.clear(); + _filter.updatePlaceholder(); + onFilterUpdate(); +} + +void DialogsWidget::onStateChange() { + if (!_stateSwitcher.isHidden()) { + if (_stateSwitcher.selected() == 0) { + list.setState(DialogsListWidget::FilteredState); + _searchQuery = QString(); + if (_searchRequest) { + MTP::cancel(_searchRequest); + _searchRequest = 0; + } + } else { + list.setState(DialogsListWidget::SearchedState); + } + list.onFilterUpdate(_filter.text()); + if (list.state() == DialogsListWidget::SearchedState) { + onSearchMessages(true); + } + } +} + void DialogsWidget::onDialogToTopFrom(int movedFrom) { if (scroll.scrollTop() > 0) { if (movedFrom > scroll.scrollTop()) { diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index 653bec574a3d6c..27c471a7c38e7a 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -27,6 +27,7 @@ class DialogsListWidget : public QWidget { DialogsListWidget(QWidget *parent, MainWidget *main); void dialogsReceived(const QVector &dialogs); + void searchReceived(const QVector &messages, bool fromStart); void showMore(int32 pixels); void activate(); @@ -53,7 +54,7 @@ class DialogsListWidget : public QWidget { void clearFilter(); void refresh(bool toTop = false); - void choosePeer(); + bool choosePeer(); void destroyData(); @@ -61,11 +62,26 @@ class DialogsListWidget : public QWidget { PeerData *peerAfter(const PeerData *peer) const; void scrollToPeer(const PeerId &peer); + typedef QVector SearchResults; + DialogsIndexed &contactsList(); DialogsIndexed &dialogsList(); + SearchResults &searchList(); void setMouseSel(bool msel, bool toTop = false); + enum State { + DefaultState = 0, + FilteredState = 1, + SearchedState = 2, + }; + void setState(State newState); + State state() const; + + void onFilterUpdate(QString newFilter, bool force = false); + + ~DialogsListWidget(); + public slots: void onUpdateSelected(bool force = false); @@ -74,17 +90,21 @@ public slots: void onPeerNameChanged(PeerData *peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars); void onPeerPhotoChanged(PeerData *peer); void onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow); - void onFilterUpdate(QString newFilter); + + void onItemRemoved(HistoryItem *item); + void onItemReplaced(HistoryItem *oldItem, HistoryItem *newItem); signals: - void peerChosen(const PeerId &); + void peerChosen(const PeerId &, MsgId); void mustScrollTo(int scrollToTop, int scrollToBottom); void dialogToTopFrom(int movedFrom); + void searchMessages(); private: void addDialog(const MTPDdialog &dialog); + void clearSearchResults(); DialogsIndexed dialogs; DialogsIndexed contactsNoDialogs; @@ -95,9 +115,17 @@ public slots: QString filter; typedef QVector FilteredDialogs; - FilteredDialogs filtered; + FilteredDialogs filterResults; int32 filteredSel; + SearchResults searchResults; + int32 searchedSel; + + State _state; + + QTimer _updateSearchTimer; + QString _searchQuery; + QPoint lastMousePos; void paintDialog(QPainter &p, DialogRow *dialog); @@ -112,6 +140,7 @@ class DialogsWidget : public QWidget, public Animated, public RPCSender { void dialogsReceived(const MTPmessages_Dialogs &dialogs); void contactsReceived(const MTPcontacts_Contacts &contacts); + void searchReceived(bool fromStart, const MTPmessages_Messages &result, mtpRequestId req); bool addNewContact(int32 uid, bool show = true); void resizeEvent(QResizeEvent *e); @@ -143,10 +172,13 @@ class DialogsWidget : public QWidget, public Animated, public RPCSender { DialogsIndexed &contactsList(); void enableShadow(bool enable = true); + + void onSearchMore(MsgId minMsgId); + void clearFiltered(); signals: - void peerChosen(const PeerId &); + void peerChosen(const PeerId &, MsgId); void cancelled(); public slots: @@ -157,8 +189,12 @@ public slots: void onFilterUpdate(); void onAddContact(); void onNewGroup(); + void onCancelSearch(); + + void onStateChange(); void onDialogToTopFrom(int movedFrom); + void onSearchMessages(bool force = false); private: @@ -169,15 +205,21 @@ public slots: void unreadCountsReceived(const QVector &dialogs); bool dialogsFailed(const RPCError &e); - bool contactsFailed(); + bool searchFailed(const RPCError &error, mtpRequestId req); int32 dlgOffset, dlgCount; mtpRequestId dlgPreloading; mtpRequestId contactsRequest; FlatInput _filter; - IconedButton _newGroup, _addContact; + Switcher _stateSwitcher; + IconedButton _newGroup, _addContact, _cancelSearch; ScrollArea scroll; DialogsListWidget list; + + QString _searchQuery; + bool _searchFull; + mtpRequestId _searchRequest; + }; diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index a1988fceeed929..002d6d9a9c4790 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -115,6 +115,9 @@ void FileUploader::sendNext() { } } else { toSend = i->media.data.mid(i->docSentParts * i->docPartSize, i->docPartSize); + if (i->media.type == ToPrepareDocument && i->docSentParts <= UseBigFilesFrom) { + i->docHash.feed(toSend.constData(), toSend.size()); + } } if (toSend.size() > i->docPartSize || (toSend.size() < i->docPartSize && i->docSentParts + 1 != i->docPartsCount)) { currentFailed(); diff --git a/Telegram/SourceFiles/gui/animation.h b/Telegram/SourceFiles/gui/animation.h index a86ae463620f6e..e9892461da35b5 100644 --- a/Telegram/SourceFiles/gui/animation.h +++ b/Telegram/SourceFiles/gui/animation.h @@ -224,7 +224,7 @@ Q_OBJECT } } else { if (!objs.size()) { - timer.start(7); + timer.start(AnimationTimerDelta); } objs.insert(obj); } diff --git a/Telegram/SourceFiles/gui/switcher.cpp b/Telegram/SourceFiles/gui/switcher.cpp new file mode 100644 index 00000000000000..bcb9605eae31c6 --- /dev/null +++ b/Telegram/SourceFiles/gui/switcher.cpp @@ -0,0 +1,157 @@ +/* +This file is part of Telegram Desktop, +an unofficial desktop messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014 John Preston, https://tdesktop.com +*/ +#include "stdafx.h" +#include "switcher.h" + +Switcher::Switcher(QWidget *parent, const style::switcher &st) : TWidget(parent) +, _selected(0) +, _over(-1) +, _wasOver(-1) +, _pressed(-1) +, _st(st) +, a_bgOver(_st.bgColor->c) +, a_bgWasOver(_st.bgHovered->c) { + resize(width(), _st.height); +} + +void Switcher::leaveEvent(QEvent *e) { + setOver(-1); + if (_pressed >= 0) return; + + setMouseTracking(false); + return TWidget::leaveEvent(e); +} + +void Switcher::enterEvent(QEvent *e) { + setMouseTracking(true); + return TWidget::enterEvent(e); +} + +void Switcher::mousePressEvent(QMouseEvent *e) { + if (e->buttons() & Qt::LeftButton) { + mouseMoveEvent(e); + if (_over != _pressed) { + _pressed = _over; + e->accept(); + } + } +} + +void Switcher::mouseMoveEvent(QMouseEvent *e) { + if (rect().contains(e->pos())) { + if (width()) { + setOver((e->pos().x() * _buttons.size()) / width()); + } + } else { + setOver(-1); + } +} + +void Switcher::mouseReleaseEvent(QMouseEvent *e) { + if (_pressed >= 0) { + if (_pressed == _over && _pressed != _selected) { + setSelected(_pressed); + } else { + setSelected(_selected); + } + } else { + leaveEvent(e); + } +} + +void Switcher::addButton(const QString &btn) { + _buttons.push_back(btn); + update(); +} + +bool Switcher::animStep(float64 ms) { + float64 dt = ms / _st.duration; + bool res = true; + if (dt >= 1) { + res = false; + a_bgOver.finish(); + a_bgWasOver.finish(); + } else { + a_bgOver.update(dt, anim::linear); + a_bgWasOver.update(dt, anim::linear); + } + update(); + return res; +} + +void Switcher::paintEvent(QPaintEvent *e) { + QPainter p(this); + + p.fillRect(rect(), _st.bgColor->b); + if (!_buttons.isEmpty()) { + p.setFont(_st.font->f); + float64 btnWidth = float64(width()) / _buttons.size(); + for (int i = 0; i < _buttons.size(); ++i) { + QRect btnRect(qRound(i * btnWidth), 0, qRound((i + 1) * btnWidth) - qRound(i * btnWidth), height()); + if (i == _selected) { + p.fillRect(btnRect, _st.bgActive->b); + } else if (i == _over) { + p.fillRect(btnRect, a_bgOver.current()); + } else if (i == _wasOver) { + p.fillRect(btnRect, a_bgWasOver.current()); + } + p.setPen((i == _selected ? _st.activeColor : _st.textColor)->p); + p.drawText(btnRect, _buttons[i], style::al_center); + } + } + if (_st.border) { + p.setPen(_st.borderColor->p); + for (uint32 i = 0; i < _st.border; ++i) { + p.drawRect(i, i, width() - 2 * i - 1, height() - 2 * i - 1); + } + } +} + +int Switcher::selected() const { + return _selected; +} + +void Switcher::setSelected(int selected) { + if (selected != _selected) { + _selected = selected; + emit changed(); + } + _pressed = _over = _wasOver = -1; + anim::stop(this); + setCursor(style::cur_default); + update(); +} + +void Switcher::setOver(int over) { + if (over != _over) { + QColor c(a_bgOver.current()); + if (_wasOver == over) { + a_bgOver = anim::cvalue(a_bgWasOver.current(), _st.bgHovered->c); + } else { + a_bgOver = anim::cvalue(_st.bgColor->c, _st.bgHovered->c); + } + a_bgWasOver = anim::cvalue(c, _st.bgColor->c); + + _wasOver = _over; + _over = over; + + anim::start(this); + + setCursor((_over >= 0 && _over != _selected) ? style::cur_pointer : style::cur_default); + } +} diff --git a/Telegram/SourceFiles/gui/switcher.h b/Telegram/SourceFiles/gui/switcher.h new file mode 100644 index 00000000000000..7dd88c5ed16093 --- /dev/null +++ b/Telegram/SourceFiles/gui/switcher.h @@ -0,0 +1,62 @@ +/* +This file is part of Telegram Desktop, +an unofficial desktop messaging app, see https://telegram.org + +Telegram Desktop is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +It is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014 John Preston, https://tdesktop.com +*/ +#pragma once + +#include +#include "gui/twidget.h" + +class Switcher : public TWidget, public Animated { + Q_OBJECT + +public: + Switcher(QWidget *parent, const style::switcher &st); + + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + + void paintEvent(QPaintEvent *e); + + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); + + void addButton(const QString &btn); + + bool animStep(float64 ms); + + int selected() const; + void setSelected(int selected); + +signals: + + void changed(); + +private: + + void setOver(int over); + + int _selected; + int _over, _wasOver, _pressed; + + typedef QVector Buttons; + Buttons _buttons; + + style::switcher _st; + anim::cvalue a_bgOver, a_bgWasOver; + +}; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 22629358110368..22a76046788c43 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -499,7 +499,8 @@ void DialogRow::paint(QPainter &p, int32 w, bool act, bool sel) const { rectForName.setLeft(rectForName.left() + st::dlgChatImgSkip); } - if (history->isEmpty()) { + HistoryItem *last = history->last; + if (!last) { p.setFont(st::dlgHistFont->f); p.setPen((act ? st::dlgActiveColor : st::dlgSystemColor)->p); if (history->typing.isEmpty()) { @@ -509,7 +510,6 @@ void DialogRow::paint(QPainter &p, int32 w, bool act, bool sel) const { } } else { // draw date - HistoryItem *last = history->back()->back(); QDateTime now(QDateTime::currentDateTime()), lastTime(last->date); QDate nowDate(now.date()), lastDate(lastTime.date()); QString dt; @@ -571,17 +571,77 @@ void DialogRow::paint(QPainter &p, int32 w, bool act, bool sel) const { history->nameText.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); } +void FakeDialogRow::paint(QPainter &p, int32 w, bool act, bool sel) const { + QRect fullRect(0, 0, w, st::dlgHeight); + p.fillRect(fullRect, (act ? st::dlgActiveBG : (sel ? st::dlgHoverBG : st::dlgBG))->b); + + History *history = _item->history(); + + p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->photo->pix(st::dlgPhotoSize)); + + int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding; + int32 namewidth = w - nameleft - st::dlgPaddingHor; + QRect rectForName(nameleft, st::dlgPaddingVer + st::dlgNameTop, namewidth, st::msgNameFont->height); + + // draw chat icon + if (history->peer->chat) { + p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgLeft, rectForName.top() + st::dlgChatImgTop), App::sprite(), (act ? st::dlgActiveChatImg : st::dlgChatImg)); + rectForName.setLeft(rectForName.left() + st::dlgChatImgSkip); + } + + // draw date + QDateTime now(QDateTime::currentDateTime()), lastTime(_item->date); + QDate nowDate(now.date()), lastDate(lastTime.date()); + QString dt; + if (lastDate == nowDate) { + dt = lastTime.toString(qsl("hh:mm")); + } else if (lastDate.year() == nowDate.year() && lastDate.weekNumber() == nowDate.weekNumber()) { + dt = langDayOfWeek(lastDate); + } else { + dt = lastDate.toString(qsl("d.MM.yy")); + } + int32 dtWidth = st::dlgDateFont->m.width(dt); + rectForName.setWidth(rectForName.width() - dtWidth - st::dlgDateSkip); + p.setFont(st::dlgDateFont->f); + p.setPen((act ? st::dlgActiveDateColor : st::dlgDateColor)->p); + p.drawText(rectForName.left() + rectForName.width() + st::dlgDateSkip, rectForName.top() + st::msgNameFont->height - st::msgDateFont->descent, dt); + + // draw check + if (_item->out() && _item->needCheck()) { + const style::sprite *check; + if (_item->id > 0) { + if (_item->unread()) { + check = act ? &st::dlgActiveCheckImg : &st::dlgCheckImg; + } else { + check = act ? &st::dlgActiveDblCheckImg : &st::dlgDblCheckImg; + } + } else { + check = act ? &st::dlgActiveSendImg : &st::dlgSendImg; + } + rectForName.setWidth(rectForName.width() - check->pxWidth() - st::dlgCheckSkip); + p.drawPixmap(QPoint(rectForName.left() + rectForName.width() + st::dlgCheckLeft, rectForName.top() + st::dlgCheckTop), App::sprite(), *check); + } + + // draw unread + int32 lastWidth = namewidth, unread = history->unreadCount; + _item->drawInDialog(p, QRect(nameleft, st::dlgPaddingVer + st::dlgFont->height + st::dlgSep, lastWidth, st::dlgFont->height), act, _cacheFor, _cache); + + p.setPen((act ? st::dlgActiveColor : st::dlgNameColor)->p); + history->nameText.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); +} + History::History(const PeerId &peerId) : width(0), height(0) , msgCount(0) -, offset(0) , unreadCount(0) , inboxReadTill(0) , outboxReadTill(0) , showFrom(0) -, notifyFrom(0) , unreadBar(0) -, unreadLoaded(true) , peer(App::peer(peerId)) +, oldLoaded(false) +, newLoaded(true) +, last(0) +, activeMsgId(0) , lastWidth(0) , lastScrollTop(History::ScrollMax) , mute(isNotifyMuted(peer->notify)) @@ -746,7 +806,7 @@ Histories::Parent::iterator Histories::erase(Histories::Parent::iterator i) { return Parent::erase(i); } -PeerId Histories::addToBack(const MTPmessage &msg, bool newMsg) { +HistoryItem *Histories::addToBack(const MTPmessage &msg, int msgState) { PeerId from_id = 0, to_id = 0; switch (msg.type()) { case mtpc_message: @@ -770,11 +830,24 @@ PeerId Histories::addToBack(const MTPmessage &msg, bool newMsg) { if (h == end()) { h = insert(peer, new History(peer)); } - h.value()->addToBack(msg, newMsg); - return peer; + if (msgState < 0) { + return h.value()->addToHistory(msg); + } + if (!h.value()->loadedAtBottom()) { + HistoryItem *item = h.value()->addToHistory(msg); + if (item) { + h.value()->last = item; + if (msgState > 0) { + h.value()->newItemAdded(item); + } + } + return item; + } + return h.value()->addToBack(msg, msgState > 0); } + /* -PeerId Histories::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { +HistoryItem *Histories::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { PeerId peer = 0; switch (msg.type()) { case mtpc_geoChatMessage: @@ -790,11 +863,10 @@ PeerId Histories::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { if (h == end()) { h = insert(peer, new History(peer)); } - h.value()->addToBack(msg, newMsg); - return peer; + return h.value()->addToBack(msg, newMsg); }/**/ -HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, bool newMsg) { +HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, bool newMsg, bool returnExisting) { HistoryItem *result = 0; switch (msg.type()) { @@ -870,7 +942,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, boo } break; } - return regItem(result); + return regItem(result, returnExisting); } HistoryItem *History::createItemForwarded(HistoryBlock *block, MsgId id, HistoryMessage *msg) { @@ -902,7 +974,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPgeoChatMessage &m return regItem(result); } /**/ -void History::addToBackService(MsgId msgId, QDateTime date, const QString &text, bool out, bool unread, HistoryMedia *media, bool newMsg) { +HistoryItem *History::addToBackService(MsgId msgId, QDateTime date, const QString &text, bool out, bool unread, HistoryMedia *media, bool newMsg) { HistoryBlock *to = 0; bool newBlock = isEmpty(); if (newBlock) { @@ -911,10 +983,10 @@ void History::addToBackService(MsgId msgId, QDateTime date, const QString &text, to = back(); } - doAddToBack(to, newBlock, regItem(new HistoryServiceMsg(this, to, msgId, date, text, out, unread, media)), newMsg); + return doAddToBack(to, newBlock, regItem(new HistoryServiceMsg(this, to, msgId, date, text, out, unread, media)), newMsg); } -void History::addToBack(const MTPmessage &msg, bool newMsg) { +HistoryItem *History::addToBack(const MTPmessage &msg, bool newMsg) { HistoryBlock *to = 0; bool newBlock = isEmpty(); if (newBlock) { @@ -922,10 +994,14 @@ void History::addToBack(const MTPmessage &msg, bool newMsg) { } else { to = back(); } - doAddToBack(to, newBlock, createItem(to, msg, newMsg), newMsg); + return doAddToBack(to, newBlock, createItem(to, msg, newMsg), newMsg); } -void History::addToBackForwarded(MsgId id, HistoryMessage *item) { +HistoryItem *History::addToHistory(const MTPmessage &msg) { + return createItem(0, msg, false, true); +} + +HistoryItem *History::addToBackForwarded(MsgId id, HistoryMessage *item) { HistoryBlock *to = 0; bool newBlock = isEmpty(); if (newBlock) { @@ -933,11 +1009,11 @@ void History::addToBackForwarded(MsgId id, HistoryMessage *item) { } else { to = back(); } - doAddToBack(to, newBlock, createItemForwarded(to, id, item), true); + return doAddToBack(to, newBlock, createItemForwarded(to, id, item), true); } /* -void History::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { +HistoryItem *History::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { HistoryBlock *to = 0; bool newBlock = isEmpty(); if (newBlock) { @@ -946,7 +1022,7 @@ void History::addToBack(const MTPgeoChatMessage &msg, bool newMsg) { to = back(); } - doAddToBack(to, newBlock, createItem(to, msg, newMsg), newMsg); + return doAddToBack(to, newBlock, createItem(to, msg, newMsg), newMsg); } /**/ @@ -965,10 +1041,10 @@ void History::createInitialDateBlock(const QDateTime &date) { push_front(dateBlock); // date block } -void History::doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg) { +HistoryItem *History::doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg) { if (!adding) { if (newBlock) delete to; - return; + return adding; } if (newBlock) { @@ -987,6 +1063,7 @@ void History::doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, } } to->push_back(adding); + last = adding; adding->y = to->height; if (width) { int32 dh = adding->resize(width); @@ -994,37 +1071,42 @@ void History::doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, height += dh; } setMsgCount(msgCount + 1); - if (adding->id > 0) { - ++offset; - } if (newMsg) { - App::checkImageCacheSize(); - if (adding->from()) { - TypingUsers::iterator i = typing.find(adding->from()); - if (i != typing.end()) { - uint64 ms = getms(); - i.value() = ms; - updateTyping(ms, 0, true); - App::main()->topBar()->update(); - } - } - if (adding->out()) { - inboxRead(false); - if (unreadBar) unreadBar->destroy(); - } else if (adding->unread()) { - if (!notifyFrom) notifyFrom = adding; - App::main()->newUnreadMsg(this, adding->id); - } - if (dialogs.isEmpty()) { - App::main()->createDialogAtTop(this, unreadCount); - } else { - emit App::main()->dialogToTop(dialogs); + newItemAdded(adding); + } + return adding; +} + +void History::newItemAdded(HistoryItem *item) { + App::checkImageCacheSize(); + if (item->from()) { + TypingUsers::iterator i = typing.find(item->from()); + if (i != typing.end()) { + uint64 ms = getms(); + i.value() = ms; + updateTyping(ms, 0, true); + App::main()->topBar()->update(); } } + if (item->out()) { + inboxRead(false); + if (unreadBar) unreadBar->destroy(); + } else if (item->unread()) { + notifies.push_back(item); + App::main()->newUnreadMsg(this, item->id); + } + if (dialogs.isEmpty()) { + App::main()->createDialogAtTop(this, unreadCount); + } else { + emit App::main()->dialogToTop(dialogs); + } } void History::addToFront(const QVector &slice) { - if (slice.isEmpty()) return; + if (slice.isEmpty()) { + oldLoaded = true; + return; + } int32 addToH = 0, skip = 0; if (!isEmpty()) { @@ -1049,9 +1131,6 @@ void History::addToFront(const QVector &slice) { adding->y = block->height; block->height += adding->resize(width); setMsgCount(msgCount + 1); - if (adding->id > 0) { - ++offset; - } prev = adding; } if (i == e) break; @@ -1063,7 +1142,7 @@ void History::addToFront(const QVector &slice) { block->height += dayItem->resize(width); } if (block->size()) { - if (wasMsgCount < unreadCount && msgCount >= unreadCount) { + if (wasMsgCount < unreadCount && msgCount >= unreadCount && !activeMsgId) { for (int32 i = block->size(); i > 0; --i) { if ((*block)[i - 1]->itemType() == HistoryItem::MsgType) { ++wasMsgCount; @@ -1105,9 +1184,66 @@ void History::addToFront(const QVector &slice) { } } +void History::addToBack(const QVector &slice) { + if (slice.isEmpty()) { + newLoaded = true; + return; + } + + bool wasEmpty = isEmpty(); + + HistoryItem *prev = isEmpty() ? 0 : back()->back(); + + HistoryBlock *block = new HistoryBlock(this); + block->reserve(slice.size()); + int32 wasMsgCount = msgCount; + for (QVector::const_iterator i = slice.cend(), e = slice.cbegin(); i != e;) { + --i; + HistoryItem *adding = createItem(block, *i, false); + if (adding) { + if (prev && prev->date.date() != adding->date.date()) { + HistoryItem *dayItem = createDayServiceMsg(this, block, adding->date); + prev->block()->push_back(dayItem); + dayItem->y = prev->block()->height; + prev->block()->height += dayItem->resize(width); + if (prev->block() != block) { + height += dayItem->height(); + } + } + block->push_back(adding); + adding->y = block->height; + block->height += adding->resize(width); + setMsgCount(msgCount + 1); + prev = adding; + } + if (i == e) break; + } + if (block->size()) { + block->y = height; + push_back(block); + height += block->height; + } else { + newLoaded = true; + fixLastMessage(true); + delete block; + } + if (wasEmpty && !isEmpty()) { + HistoryBlock *dateBlock = new HistoryBlock(this); + HistoryItem *dayItem = createDayServiceMsg(this, dateBlock, front()->front()->date); + dateBlock->push_back(dayItem); + int32 dh = dayItem->resize(width); + dateBlock->height = dh; + for (iterator i = begin(), e = end(); i != e; ++i) { + (*i)->y += dh; + } + push_front(dateBlock); // date block + height += dh; + } +} + void History::inboxRead(bool byThisInstance) { if (unreadCount) { - if (!byThisInstance) App::main()->historyToDown(this); + if (!byThisInstance && loadedAtBottom()) App::main()->historyToDown(this); setUnreadCount(0); } if (!isEmpty()) { @@ -1118,7 +1254,7 @@ void History::inboxRead(bool byThisInstance) { if (App::main()) App::main()->dlgUpdated(dialogs[0]); } App::wnd()->psClearNotify(this); - clearNotifyFrom(); + clearNotifications(); } void History::outboxRead() { @@ -1130,7 +1266,7 @@ void History::outboxRead() { void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { if (unreadCount != newUnreadCount) { - if (!unreadCount && newUnreadCount == 1) { + if (!unreadCount && newUnreadCount == 1 && loadedAtBottom()) { showFrom = isEmpty() ? 0 : back()->back(); } else if (!newUnreadCount) { showFrom = 0; @@ -1138,7 +1274,6 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { App::histories().unreadFull += newUnreadCount - unreadCount; if (mute) App::histories().unreadMuted += newUnreadCount - unreadCount; unreadCount = newUnreadCount; - unreadLoaded = (unreadCount <= msgCount); if (psUpdate) App::wnd()->psUpdateCounter(); if (unreadBar) unreadBar->setCount(unreadCount); } @@ -1147,7 +1282,6 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { void History::setMsgCount(int32 newMsgCount) { if (msgCount != newMsgCount) { msgCount = newMsgCount; - unreadLoaded = (unreadCount <= msgCount); } } @@ -1160,6 +1294,10 @@ void History::setMsgCount(int32 newMsgCount) { } void History::getNextShowFrom(HistoryBlock *block, int32 i) { + if (!loadedAtBottom()) { + showFrom = 0; + return; + } if (i >= 0) { int32 l = block->size(); for (++i; i < l; ++i) { @@ -1186,7 +1324,7 @@ void History::getNextShowFrom(HistoryBlock *block, int32 i) { } void History::addUnreadBar() { - if (unreadBar || !showFrom || !unreadCount) return; + if (unreadBar || !showFrom || !unreadCount || !loadedAtBottom()) return; HistoryBlock *block = showFrom->block(); int32 i = block->indexOf(showFrom); @@ -1210,41 +1348,77 @@ void History::addUnreadBar() { height += dh; } -void History::getNextNotifyFrom(HistoryBlock *block, int32 i) { - if (!block) { - if (!notifyFrom) { - return; +void History::clearNotifications() { + notifies.clear(); +} + +bool History::readyForWork() const { + return activeMsgId ? !isEmpty() : (unreadCount <= msgCount); +} + +bool History::loadedAtBottom() const { + return newLoaded; +} + +bool History::loadedAtTop() const { + return oldLoaded; +} + +void History::fixLastMessage(bool wasAtBottom) { + if (wasAtBottom && isEmpty()) { + wasAtBottom = false; + } + if (wasAtBottom) { + last = back()->back(); + } else { + last = 0; + if (App::main()) { + App::main()->checkPeerHistory(peer); } - block = notifyFrom->block(); - i = block->indexOf(notifyFrom); } - if (i >= 0) { - int32 l = block->size(); - for (++i; i < l; ++i) { - if ((*block)[i]->unread() && !(*block)[i]->out()) { - notifyFrom = (*block)[i]; - return; +} + +void History::loadAround(MsgId msgId) { + if (activeMsgId != msgId) { + activeMsgId = msgId; + lastWidth = 0; + if (activeMsgId) { + HistoryItem *item = App::histItemById(activeMsgId); + if (!item || !item->block()) { + clear(true); } + newLoaded = last && !last->detached(); + } else { + if (!loadedAtBottom()) { + clear(true); + } + newLoaded = isEmpty() || last && !last->detached(); } } +} - int32 j = indexOf(block), s = size(); - if (j >= 0) { - for (++j; j < s; ++j) { - block = (*this)[j]; - for (int32 i = 0, l = block->size(); i < l; ++i) { - if ((*block)[i]->unread() && !(*block)[i]->out()) { - notifyFrom = (*block)[i]; - return; - } +MsgId History::minMsgId() const { + for (const_iterator i = cbegin(), e = cend(); i != e; ++i) { + for (HistoryBlock::const_iterator j = (*i)->cbegin(), en = (*i)->cend(); j != en; ++j) { + if ((*j)->id > 0) { + return (*j)->id; } } } - notifyFrom = 0; + return 0; } -void History::clearNotifyFrom() { - notifyFrom = 0; +MsgId History::maxMsgId() const { + for (const_iterator i = cend(), e = cbegin(); i != e;) { + --i; + for (HistoryBlock::const_iterator j = (*i)->cend(), en = (*i)->cbegin(); j != en;) { + --j; + if ((*j)->id > 0) { + return (*j)->id; + } + } + } + return 0; } int32 History::geomResize(int32 newWidth, int32 *ytransform) { @@ -1269,13 +1443,26 @@ int32 History::geomResize(int32 newWidth, int32 *ytransform) { return height; } -void History::clear() { +void History::clear(bool leaveItems) { + if (unreadBar) { + unreadBar->destroy(); + } + if (showFrom) { + showFrom = 0; + } for (Parent::const_iterator i = cbegin(), e = cend(); i != e; ++i) { + if (leaveItems) { + (*i)->clear(true); + } delete *i; } Parent::clear(); - setUnreadCount(0); setMsgCount(0); + if (!leaveItems) { + setUnreadCount(0); + } + height = 0; + oldLoaded = false; } History::Parent::iterator History::erase(History::Parent::iterator i) { @@ -1328,12 +1515,19 @@ int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform) { return height; } -void HistoryBlock::clear() { - for (Parent::const_iterator i = cbegin(), e = cend(); i != e; ++i) { - delete *i; +void HistoryBlock::clear(bool leaveItems) { + if (leaveItems) { + for (Parent::const_iterator i = cbegin(), e = cend(); i != e; ++i) { + (*i)->detachFast(); + } + } else { + for (Parent::const_iterator i = cbegin(), e = cend(); i != e; ++i) { + delete *i; + } } Parent::clear(); } + HistoryBlock::Parent::iterator HistoryBlock::erase(HistoryBlock::Parent::iterator i) { delete *i; return Parent::erase(i); @@ -1341,9 +1535,6 @@ HistoryBlock::Parent::iterator HistoryBlock::erase(HistoryBlock::Parent::iterato void HistoryBlock::removeItem(HistoryItem *item) { int32 i = indexOf(item), dh = 0; - if (history->notifyFrom == item) { - history->getNextNotifyFrom(this, i); - } if (history->showFrom == item) { history->getNextShowFrom(this, i); } @@ -1406,9 +1597,6 @@ void HistoryBlock::removeItem(HistoryItem *item) { if (!item->out() && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); } - if (item->id > 0) { - --history->offset; - } int32 itemType = item->itemType(); if (itemType == HistoryItem::MsgType) { history->setMsgCount(history->msgCount - 1); @@ -1430,10 +1618,6 @@ void HistoryBlock::removeItem(HistoryItem *item) { } else { history->removeBlock(this); } - delete item; - if (h->unreadBar && h->back()->back() == h->unreadBar) { - h->unreadBar->destroy(); - } } HistoryItem::HistoryItem(History *history, HistoryBlock *block, MsgId msgId, bool out, bool unread, QDateTime msgDate, int32 from) : y(0) @@ -1460,6 +1644,28 @@ void HistoryItem::markRead() { } } +void HistoryItem::detach() { + if (_history && _history->unreadBar == this) { + _history->unreadBar = 0; + } + if (_block) { + _block->removeItem(this); + detachFast(); + App::historyItemDetached(this); + } else { + if (_history->showFrom == this) { + _history->showFrom = 0; + } + } + if (_history && _history->unreadBar && _history->back()->back() == _history->unreadBar) { + _history->unreadBar->destroy(); + } +} + +void HistoryItem::detachFast() { + _block = 0; +} + HistoryItem::~HistoryItem() { App::historyUnregItem(this); if (id < 0) { @@ -1467,12 +1673,14 @@ HistoryItem::~HistoryItem() { } } -HistoryItem *regItem(HistoryItem *item) { - if (item && App::historyRegItem(item)) { - return item; +HistoryItem *regItem(HistoryItem *item, bool returnExisting) { + if (!item) return 0; + HistoryItem *existing = App::historyRegItem(item); + if (existing) { + delete item; + return returnExisting ? existing : 0; } - delete item; - return 0; + return item; } HistoryPhoto::HistoryPhoto(const MTPDphoto &photo, int32 width) : data(App::feedPhoto(photo)) @@ -2497,6 +2705,21 @@ HistoryMedia *HistoryMessage::getMedia() const { void HistoryMessage::draw(QPainter &p, uint32 selection) const { textstyleSet(&(out() ? st::outTextStyle : st::inTextStyle)); + if (id == _history->activeMsgId) { + uint64 ms = App::main() ? App::main()->animActiveTime() : 0; + if (ms) { + if (ms > st::activeFadeInDuration + st::activeFadeOutDuration) { + App::main()->stopAnimActive(); + } else { + float64 dt = (ms > st::activeFadeInDuration) ? (1 - (ms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (ms / float64(st::activeFadeInDuration)); + float64 o = p.opacity(); + p.setOpacity(o * dt); + p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b); + p.setOpacity(o); + } + } + } + bool selected = (selection == FullItemSel); if (_from->nameVersion > _fromVersion) { fromNameUpdated(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 167f02219ecca6..b641d783ee17b6 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -527,8 +527,8 @@ struct Histories : public QHash { unreadFull = unreadMuted = 0; } - PeerId addToBack(const MTPmessage &msg, bool newMsg = true); -// PeerId addToBack(const MTPgeoChatMessage &msg, bool newMsg = true); + HistoryItem *addToBack(const MTPmessage &msg, int msgState = 1); // 1 - new message, 0 - not new message, -1 - searched message +// HistoryItem *addToBack(const MTPgeoChatMessage &msg, bool newMsg = true); typedef QMap TypingHistories; // when typing in this history started TypingHistories typing; @@ -551,6 +551,17 @@ struct DialogRow { void *attached; // for any attached data, for example View in contacts list }; +struct FakeDialogRow { + FakeDialogRow(HistoryItem *item) : _item(item), _cacheFor(0), _cache(st::dlgRichMinWidth) { + } + + void paint(QPainter &p, int32 w, bool act, bool sel) const; + + HistoryItem *_item; + mutable const HistoryItem *_cacheFor; + mutable Text _cache; +}; + class HistoryMedia; class HistoryMessage; class HistoryUnreadBar; @@ -558,7 +569,7 @@ struct History : public QList { History(const PeerId &peerId); typedef QList Parent; - void clear(); + void clear(bool leaveItems = false); Parent::iterator erase(Parent::iterator i); void blockResized(HistoryBlock *block, int32 dh); void removeBlock(HistoryBlock *block); @@ -567,16 +578,21 @@ struct History : public QList { clear(); } - HistoryItem *createItem(HistoryBlock *block, const MTPmessage &msg, bool newMsg); + HistoryItem *createItem(HistoryBlock *block, const MTPmessage &msg, bool newMsg, bool returnExisting = false); HistoryItem *createItemForwarded(HistoryBlock *block, MsgId id, HistoryMessage *msg); // HistoryItem *createItem(HistoryBlock *block, const MTPgeoChatMessage &msg, bool newMsg); - void addToBackService(MsgId msgId, QDateTime date, const QString &text, bool out = false, bool unread = false, HistoryMedia *media = 0, bool newMsg = true); - void addToBack(const MTPmessage &msg, bool newMsg = true); - void addToBackForwarded(MsgId id, HistoryMessage *item); -// void addToBack(const MTPgeoChatMessage &msg, bool newMsg = true); + HistoryItem *addToBackService(MsgId msgId, QDateTime date, const QString &text, bool out = false, bool unread = false, HistoryMedia *media = 0, bool newMsg = true); + HistoryItem *addToBack(const MTPmessage &msg, bool newMsg = true); + HistoryItem *addToHistory(const MTPmessage &msg); + HistoryItem *addToBackForwarded(MsgId id, HistoryMessage *item); +// HistoryItem *addToBack(const MTPgeoChatMessage &msg, bool newMsg = true); void addToFront(const QVector &slice); + void addToBack(const QVector &slice); void createInitialDateBlock(const QDateTime &date); - void doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg); + HistoryItem *doAddToBack(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg); + + void newItemAdded(HistoryItem *item); + void inboxRead(bool byThisInstance = false); void outboxRead(); @@ -585,18 +601,66 @@ struct History : public QList { void setMute(bool newMute); void getNextShowFrom(HistoryBlock *block, int32 i); void addUnreadBar(); - void getNextNotifyFrom(HistoryBlock *block = 0, int32 i = 0); - void clearNotifyFrom(); + void clearNotifications(); + + bool readyForWork() const; // all unread loaded or loaded around activeMsgId + bool loadedAtBottom() const; // last message is in the list + bool loadedAtTop() const; // nothing was added after loading history back + + void fixLastMessage(bool wasAtBottom); + + void loadAround(MsgId msgId); + + MsgId minMsgId() const; + MsgId maxMsgId() const; int32 geomResize(int32 newWidth, int32 *ytransform = 0); // return new size - int32 width, height, msgCount, offset, unreadCount; + int32 width, height, msgCount, unreadCount; int32 inboxReadTill, outboxReadTill; HistoryItem *showFrom; - HistoryItem *notifyFrom; HistoryUnreadBar *unreadBar; - bool unreadLoaded; PeerData *peer; + bool oldLoaded, newLoaded; + HistoryItem *last; + MsgId activeMsgId; + + typedef QList NotifyQueue; + NotifyQueue notifies; + + void removeNotification(HistoryItem *item) { + if (!notifies.isEmpty()) { + for (NotifyQueue::iterator i = notifies.begin(), e = notifies.end(); i != e; ++i) { + if ((*i) == item) { + notifies.erase(i); + break; + } + } + } + } + HistoryItem *currentNotification() { + return notifies.isEmpty() ? 0 : notifies.front(); + } + void skipNotification() { + if (!notifies.isEmpty()) { + notifies.pop_front(); + } + } + + void itemReplaced(HistoryItem *old, HistoryItem *item) { + if (!notifies.isEmpty()) { + for (NotifyQueue::iterator i = notifies.begin(), e = notifies.end(); i != e; ++i) { + if ((*i) == old) { + *i = item; + break; + } + } + } + if (last == old) { + last = item; + } + // showFrom can't be detached + } QString draft; QTextCursor draftCur; @@ -911,7 +975,7 @@ struct HistoryBlock : public QVector { } typedef QVector Parent; - void clear(); + void clear(bool leaveItems = false); Parent::iterator erase(Parent::iterator i); ~HistoryBlock() { clear(); @@ -979,7 +1043,18 @@ class HistoryItem : public HistoryElem { } void destroy() { markRead(); - _block->removeItem(this); + bool wasAtBottom = history()->loadedAtBottom(); + _history->removeNotification(this); + detach(); + if (history()->last == this) { + history()->fixLastMessage(wasAtBottom); + } + delete this; + } + void detach(); + void detachFast(); + bool detached() const { + return !_block; } bool out() const { return _out; @@ -1047,7 +1122,7 @@ class HistoryItem : public HistoryElem { }; -HistoryItem *regItem(HistoryItem *item); +HistoryItem *regItem(HistoryItem *item, bool returnExisting = false); enum HistoryMediaType { MediaTypePhoto, diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 843df46545eebd..673b446eedf71c 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -72,8 +72,12 @@ void HistoryList::messagesReceived(const QVector &messages) { hist->addToFront(messages); } +void HistoryList::messagesReceivedDown(const QVector &messages) { + hist->addToBack(messages); +} + void HistoryList::updateMsg(HistoryItem *msg) { - if (!msg || !hist || hist != msg->history()) return; + if (!msg || msg->detached() || !hist || hist != msg->history()) return; update(0, height() - hist->height - st::historyPadding + msg->block()->y + msg->y, width(), msg->height()); } @@ -331,7 +335,7 @@ void HistoryList::touchScrollUpdated(const QPoint &screenPos) { } QPoint HistoryList::mapMouseToItem(QPoint p, HistoryItem *item) { - if (!item) return QPoint(0, 0); + if (!item || item->detached()) return QPoint(0, 0); p.setY(p.y() - (height() - hist->height - st::historyPadding) - item->block()->y - item->y); return p; } @@ -550,13 +554,22 @@ void HistoryList::mouseReleaseEvent(QMouseEvent *e) { } void HistoryList::mouseDoubleClickEvent(QMouseEvent *e) { - if (_dragAction == Selecting && _dragSelType == TextSelectLetters && _dragItem && !_selected.isEmpty() && _selected.cbegin().value() != FullItemSel) { + if ((_dragAction == Selecting && !_selected.isEmpty() && _selected.cbegin().value() != FullItemSel || _dragAction == NoDrag && (_selected.isEmpty() || _selected.cbegin().value() != FullItemSel)) && _dragSelType == TextSelectLetters && _dragItem) { bool afterDragSymbol, uponSelected; uint16 symbol; _dragItem->getSymbol(symbol, afterDragSymbol, uponSelected, _dragStartPos.x(), _dragStartPos.y()); if (uponSelected) { _dragSymbol = symbol; _dragSelType = TextSelectWords; + if (_dragAction == NoDrag) { + _dragAction = Selecting; + uint32 selStatus = (symbol << 16) | symbol; + if (!_selected.isEmpty()) { + updateMsg(_selected.cbegin().key()); + _selected.clear(); + } + _selected.insert(_dragItem, selStatus); + } mouseMoveEvent(e); _trippleClickPoint = e->globalPos(); @@ -1436,17 +1449,15 @@ HistoryHider::~HistoryHider() { } HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent) - , histOffset(0) - , histCount(-1) - , histReadRequestId(0) , histRequestsCount(0) , histPeer(0) - , _activePeer(0) + , _activeHist(0) , histPreloading(0) , _scroll(this, st::historyScroll, false) , _list(0) , hist(0) , _histInited(false) + , _toHistoryEnd(this, st::historyToEnd) , _send(this, lang(lng_send_button), st::btnSend) , _attachDocument(this, st::btnAttachDocument) , _attachPhoto(this, st::btnAttachPhoto) @@ -1472,6 +1483,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent) setAcceptDrops(true); connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll())); + connect(&_toHistoryEnd, SIGNAL(clicked()), this, SLOT(onHistoryToEnd())); connect(&_send, SIGNAL(clicked()), this, SLOT(onSend())); connect(&_attachDocument, SIGNAL(clicked()), this, SLOT(onDocumentSelect())); connect(&_attachPhoto, SIGNAL(clicked()), this, SLOT(onPhotoSelect())); @@ -1489,8 +1501,14 @@ HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent) _scrollTimer.setSingleShot(false); + _animActiveTimer.setSingleShot(false); + connect(&_animActiveTimer, SIGNAL(timeout()), this, SLOT(onAnimActiveStep())); + _scroll.hide(); _scroll.move(0, 0); + + _toHistoryEnd.hide(); + _field.hide(); _field.resize(width() - _send.width() - _attachDocument.width() - _attachEmoji.width(), _send.height() - 2 * st::sendPadding); _send.hide(); @@ -1509,6 +1527,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent) _emojiPan.hide(); _attachDragDocument.hide(); _attachDragPhoto.hide(); + connect(&_attachDragDocument, SIGNAL(dropped(QDropEvent*)), this, SLOT(onDocumentDrop(QDropEvent*))); connect(&_attachDragPhoto, SIGNAL(dropped(QDropEvent*)), this, SLOT(onPhotoDrop(QDropEvent*))); } @@ -1565,7 +1584,7 @@ void HistoryWidget::chatLoaded(const MTPmessages_ChatFull &res) { peerUpdated(App::chat(peerId)); } -void HistoryWidget::showPeer(const PeerId &peer, bool force, bool leaveActive) { +void HistoryWidget::showPeer(const PeerId &peer, MsgId msgId, bool force, bool leaveActive) { if (App::main()->selectingPeer() && !force) { hiderOffered = true; App::main()->offerPeer(peer); @@ -1577,19 +1596,31 @@ void HistoryWidget::showPeer(const PeerId &peer, bool force, bool leaveActive) { if (hist) { if (histPeer->id == peer) { if (hist->unreadBar) hist->unreadBar->destroy(); + if (msgId != hist->activeMsgId) { + hist->loadAround(msgId); + if (histPreloading) MTP::cancel(histPreloading); + if (histPreloadingDown) MTP::cancel(histPreloadingDown); + histPreloading = histPreloadingDown = 0; + } checkUnreadLoaded(); return activate(); } updateTyping(false); } - if (histPreload.size() && _list) { - _list->messagesReceived(histPreload); - histPreload.clear(); + if (_list) { + if (!histPreload.isEmpty()) { + _list->messagesReceived(histPreload); + histPreload.clear(); + } + if (!histPreloadDown.isEmpty()) { + _list->messagesReceivedDown(histPreloadDown); + histPreloadDown.clear(); + } } if (hist) { hist->draft = _field.getText(); hist->draftCur = _field.textCursor(); - if (hist->unreadLoaded && _scroll.scrollTop() + 1 <= _scroll.scrollTopMax()) { + if (hist->readyForWork() && _scroll.scrollTop() + 1 <= _scroll.scrollTopMax()) { hist->lastWidth = _list->width(); } else { hist->lastWidth = 0; @@ -1603,26 +1634,25 @@ void HistoryWidget::showPeer(const PeerId &peer, bool force, bool leaveActive) { _list = 0; updateTopBarSelection(); - if (leaveActive && histPeer) { - _activePeer = histPeer; + if (leaveActive && hist) { + _activeHist = hist; } else { if (!leaveActive) { - _activePeer = 0; + _activeHist = 0; } if (hist) { App::main()->dlgUpdated(hist); } } histPeer = peer ? App::peer(peer) : 0; - histOffset = 0; - histReadRequestId = 0; titlePeerText = QString(); titlePeerTextWidth = 0; histRequestsCount = 0; - histCount = -1; histPreload.clear(); + histPreloadDown.clear(); if (histPreloading) MTP::cancel(histPreloading); - histPreloading = 0; + if (histPreloadingDown) MTP::cancel(histPreloadingDown); + histPreloading = histPreloadingDown = 0; hist = 0; _histInited = false; noSelectingScroll(); @@ -1653,14 +1683,15 @@ void HistoryWidget::showPeer(const PeerId &peer, bool force, bool leaveActive) { } else { hist = i.value(); } - if (hist->unreadLoaded) { + if (hist->readyForWork()) { _scroll.show(); } if (hist) { App::main()->dlgUpdated(hist); } - histOffset = hist->offset; _list = new HistoryList(this, &_scroll, hist); + hist->loadAround(msgId); + _list->hide(); _scroll.setWidget(_list); _list->show(); @@ -1689,7 +1720,7 @@ void HistoryWidget::showPeer(const PeerId &peer, bool force, bool leaveActive) { void HistoryWidget::checkUnreadLoaded(bool checkOnlyShow) { if (!hist) return; - if (hist->unreadLoaded) { + if (hist->readyForWork()) { if (checkOnlyShow && !_scroll.isHidden()) return; if (!animating()) { if (_scroll.isHidden()) { @@ -1702,7 +1733,7 @@ void HistoryWidget::checkUnreadLoaded(bool checkOnlyShow) { } updateListSize(0, true); if (!animating()) updateControlsVisibility(); - if (hist->unreadLoaded) { + if (hist->readyForWork()) { if (!_scroll.isHidden() && !_list->isHidden()) { onListScroll(); } @@ -1715,6 +1746,7 @@ void HistoryWidget::updateControlsVisibility() { if (!hist) { _scroll.hide(); _send.hide(); + _toHistoryEnd.hide(); _field.hide(); _attachDocument.hide(); _attachPhoto.hide(); @@ -1724,7 +1756,12 @@ void HistoryWidget::updateControlsVisibility() { return; } - if (hist->unreadLoaded) { + if (hist->readyForWork()) { + if (hist->loadedAtBottom()) { + _toHistoryEnd.hide(); + } else { + _toHistoryEnd.show(); + } if (!histPeer->chat || !histPeer->asChat()->forbidden) { _send.show(); if (cDefaultAttach() == dbidaPhoto) { @@ -1735,6 +1772,7 @@ void HistoryWidget::updateControlsVisibility() { _attachEmoji.show(); if (_field.isHidden()) { _field.show(); + resizeEvent(0); update(); } } else { @@ -1746,15 +1784,17 @@ void HistoryWidget::updateControlsVisibility() { _emojiPan.hide(); if (!_field.isHidden()) { _field.hide(); + resizeEvent(0); update(); } } + if (hist->unreadCount && App::wnd()->historyIsActive()) { historyWasRead(); } } else { loadMessages(); - if (!hist->unreadLoaded) { + if (!hist->readyForWork()) { _scroll.hide(); _send.hide(); _attachDocument.hide(); @@ -1762,6 +1802,7 @@ void HistoryWidget::updateControlsVisibility() { _attachEmoji.hide(); _attachType.hide(); _emojiPan.hide(); + _toHistoryEnd.hide(); if (!_field.isHidden()) { _field.hide(); update(); @@ -1772,7 +1813,7 @@ void HistoryWidget::updateControlsVisibility() { void HistoryWidget::newUnreadMsg(History *history, MsgId msgId) { if (App::wnd()->historyIsActive()) { - if (hist == history && hist->unreadLoaded) { + if (hist == history && hist->readyForWork()) { historyWasRead(); if (_scroll.scrollTop() + 1 > _scroll.scrollTopMax()) { if (history->unreadBar) history->unreadBar->destroy(); @@ -1784,7 +1825,7 @@ void HistoryWidget::newUnreadMsg(History *history, MsgId msgId) { history->setUnreadCount(history->unreadCount + 1); } } else { - if (hist == history && hist->unreadLoaded) { + if (hist == history && hist->readyForWork()) { if (_scroll.scrollTop() + 1 > _scroll.scrollTopMax()) { if (history->unreadBar) history->unreadBar->destroy(); } @@ -1810,15 +1851,17 @@ bool HistoryWidget::messagesFailed(const RPCError &e, mtpRequestId requestId) { LOG(("RPC Error: %1 %2: %3").arg(e.code()).arg(e.type()).arg(e.description())); if (histPreloading == requestId) { histPreloading = 0; + } else if (histPreloadingDown == requestId) { + histPreloadingDown = 0; } return true; } void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId) { - if (histPreloading == requestId) { - histPreloading = 0; + if (!hist) { + histPreloading = histPreloadingDown = 0; + return; } - if (!hist) return; PeerId peer = 0; int32 count = 0; @@ -1859,36 +1902,64 @@ void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRe peer = (to_id == App::peerFromUser(MTP::authedId())) ? from_id : to_id; } + bool down = false; + if (histPreloading == requestId) { + histPreloading = 0; + } else if (histPreloadingDown == requestId) { + histPreloadingDown = 0; + down = true; + } else { + return; + } + if (peer && peer != histPeer->id) return; if (histList) { - if (!histOffset) { - addMessagesToFront(*histList); + if (!hist->minMsgId() || histList->isEmpty()) { + if (down) { + addMessagesToBack(*histList); + histPreloadDown.clear(); + } else { + addMessagesToFront(*histList); + histPreload.clear(); + } } else { - histPreload = *histList; + if (down) { + histPreloadDown = *histList; + } else { + histPreload = *histList; + } } - - if (histList->size()) { - histOffset += histList->size(); - histCount = count; + } else { + if (down) { + addMessagesToBack(QVector()); } else { - histCount = histOffset; + addMessagesToFront(QVector()); } - } else { - histCount = histOffset; - if (!hist->unreadLoaded) { - hist->setUnreadCount(hist->msgCount); + if (!hist->readyForWork()) { + if (hist->activeMsgId) { + hist->activeMsgId = 0; + } + if (!hist->readyForWork()) { + hist->setUnreadCount(hist->msgCount); + } } checkUnreadLoaded(true); return; } - if (histOffset >= histCount && histPreload.size()) { + if (down && hist->loadedAtBottom() && histPreloadDown.size()) { + addMessagesToBack(histPreloadDown); + histPreloadDown.clear(); + loadMessagesDown(); + } else if (!down && hist->loadedAtTop() && histPreload.size()) { addMessagesToFront(histPreload); histPreload.clear(); loadMessages(); - } else if (histPreload.size()) { + } else if (down && histPreloadDown.size() || !down && histPreload.size()) { onListScroll(); + } else if (down) { + loadMessagesDown(); } else { loadMessages(); } @@ -1901,11 +1972,20 @@ void HistoryWidget::windowShown() { resizeEvent(0); } +bool HistoryWidget::isActive() const { + return !hist || hist->loadedAtBottom(); +} + void HistoryWidget::loadMessages() { if (!hist) return; - if (histCount >= 0 && histOffset >= histCount) { - if (!hist->unreadLoaded) { - hist->setUnreadCount(hist->msgCount); + if (hist->loadedAtTop()) { + if (!hist->readyForWork()) { + if (hist->activeMsgId) { + hist->activeMsgId = 0; + } + if (!hist->readyForWork()) { + hist->setUnreadCount(hist->msgCount); + } } checkUnreadLoaded(true); return; @@ -1913,19 +1993,53 @@ void HistoryWidget::loadMessages() { int32 dh = 0; if (histPreload.size()) { - bool unreadLoaded = hist->unreadLoaded; + bool loaded = hist->readyForWork(); addMessagesToFront(histPreload); histPreload.clear(); checkUnreadLoaded(true); - if (!unreadLoaded && hist->unreadLoaded) { + if (!loaded && hist->readyForWork()) { return; } } - if (!histPreloading && (!hist->unreadLoaded || _scroll.scrollTop() < 3 * _scroll.height())) { - int32 loadCount = histOffset ? MessagesPerPage : MessagesFirstLoad; - histPreloading = MTP::send(MTPmessages_GetHistory(histInputPeer, MTP_int(histOffset), MTP_int(0), MTP_int(loadCount)), rpcDone(&HistoryWidget::messagesReceived), rpcFail(&HistoryWidget::messagesFailed)); + if (!histPreloading && (!hist->readyForWork() || _scroll.scrollTop() < 3 * _scroll.height())) { + MsgId min = hist->minMsgId(); + int32 offset = 0, loadCount = min ? MessagesPerPage : MessagesFirstLoad; + if (!min && hist->activeMsgId) { + min = hist->activeMsgId; + offset = -loadCount / 2; + } + histPreloading = MTP::send(MTPmessages_GetHistory(histInputPeer, MTP_int(offset), MTP_int(min), MTP_int(loadCount)), rpcDone(&HistoryWidget::messagesReceived), rpcFail(&HistoryWidget::messagesFailed)); ++histRequestsCount; - if (!hist->unreadLoaded) update(); + if (!hist->readyForWork()) update(); + } else { + checkUnreadLoaded(true); + } +} + +void HistoryWidget::loadMessagesDown() { + if (!hist) return; + if (hist->loadedAtBottom()) { + return; + } + + int32 dh = 0; + if (histPreloadDown.size()) { + bool loaded = hist->readyForWork(); + addMessagesToBack(histPreloadDown); + histPreloadDown.clear(); + checkUnreadLoaded(true); + if (!loaded && hist->readyForWork()) { + return; + } + } + if (!histPreloadingDown && hist->readyForWork() && (_scroll.scrollTop() + 3 * _scroll.height() > _scroll.scrollTopMax())) { + MsgId max = hist->maxMsgId(); + if (max) { + int32 loadCount = MessagesPerPage, offset = -loadCount; + histPreloadingDown = MTP::send(MTPmessages_GetHistory(histInputPeer, MTP_int(offset), MTP_int(max + 1), MTP_int(loadCount)), rpcDone(&HistoryWidget::messagesReceived), rpcFail(&HistoryWidget::messagesFailed)); + ++histRequestsCount; + if (!hist->readyForWork()) update(); + } } else { checkUnreadLoaded(true); } @@ -1934,12 +2048,16 @@ void HistoryWidget::loadMessages() { void HistoryWidget::onListScroll() { App::checkImageCacheSize(); - if (histPreloading || !hist || ((_list->isHidden() || _scroll.isHidden() || !App::wnd()->windowHandle()->isVisible()) && hist->unreadLoaded)) { + if (histPreloading || !hist || ((_list->isHidden() || _scroll.isHidden() || !App::wnd()->windowHandle()->isVisible()) && hist->readyForWork())) { checkUnreadLoaded(true); return; } - if (!hist->unreadLoaded || _scroll.scrollTop() < 3 * _scroll.height()) { + if (hist->readyForWork() && (_scroll.scrollTop() + 3 * _scroll.height() > _scroll.scrollTopMax())) { + loadMessagesDown(); + } + + if (!hist->readyForWork() || _scroll.scrollTop() < 3 * _scroll.height()) { loadMessages(); } else { checkUnreadLoaded(true); @@ -1961,6 +2079,13 @@ QString HistoryWidget::prepareMessage(QString result) { return (cReplaceEmojis() ? replaceEmojis(result) : result).trimmed(); } +void HistoryWidget::onHistoryToEnd() { + _toHistoryEnd.hide(); + if (hist && !hist->loadedAtBottom()) { + showPeer(histPeer->id, 0); + } +} + void HistoryWidget::onSend() { if (!hist) return; @@ -1971,6 +2096,8 @@ void HistoryWidget::onSend() { App::historyRegRandom(randomId, newId); + hist->loadAround(0); + MTPstring msgText(MTP_string(text)); hist->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(histPeer->id), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), msgText, MTP_messageMediaEmpty())); App::main()->historyToDown(hist); @@ -1997,7 +2124,7 @@ mtpRequestId HistoryWidget::onForward(const PeerId &peer, bool forwardSelected) if (toForward.isEmpty()) return 0; if (toForward.size() == 1) { - App::main()->showPeer(peer, false, true); + App::main()->showPeer(peer, 0, false, true); if (!hist) return 0; HistoryItem *item = toForward.cbegin().value(); @@ -2006,6 +2133,7 @@ mtpRequestId HistoryWidget::onForward(const PeerId &peer, bool forwardSelected) HistoryServiceMsg *srv = dynamic_cast(item); MsgId newId = 0; + hist->loadAround(0); if (item->id > 0 && msg) { newId = clientMsgId(); hist->addToBackForwarded(newId, msg); @@ -2045,12 +2173,14 @@ mtpRequestId HistoryWidget::onForward(const PeerId &peer, bool forwardSelected) void HistoryWidget::onShareContact(const PeerId &peer, UserData *contact) { if (!contact || contact->phone.isEmpty()) return; - App::main()->showPeer(peer, false, true); + App::main()->showPeer(peer, 0, false, true); if (!hist) return; uint64 randomId = MTP::nonce(); MsgId newId = clientMsgId(); + hist->loadAround(0); + hist->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(histPeer->id), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaContact(MTP_string(contact->phone), MTP_string(contact->firstName), MTP_string(contact->lastName), MTP_int(int32(contact->id & 0xFFFFFFFF))))); MTP::send(MTPmessages_SendMedia(histPeer->input, MTP_inputMediaContact(MTP_string(contact->phone), MTP_string(contact->firstName), MTP_string(contact->lastName)), MTP_long(randomId)), App::main()->rpcDone(&MainWidget::sentFullDataReceived, randomId)); @@ -2066,7 +2196,11 @@ PeerData *HistoryWidget::peer() const { } PeerData *HistoryWidget::activePeer() const { - return histPeer ? histPeer : _activePeer; + return histPeer ? histPeer : (_activeHist ? _activeHist->peer : 0); +} + +MsgId HistoryWidget::activeMsgId() const { + return hist ? hist->activeMsgId : (_activeHist ? _activeHist->activeMsgId : 0); } void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTopBarCache, bool back) { @@ -2077,6 +2211,7 @@ void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTo _animTopBarCache = myGrab(App::main()->topBar(), QRect(0, 0, width(), st::topBarHeight)); App::main()->topBar()->startAnim(); _scroll.hide(); + _toHistoryEnd.hide(); _attachDocument.hide(); _attachPhoto.hide(); _attachEmoji.hide(); @@ -2103,7 +2238,7 @@ bool HistoryWidget::animStep(float64 ms) { _bgAnimCache = _animCache = _animTopBarCache = _bgAnimTopBarCache = QPixmap(); App::main()->topBar()->stopAnim(); updateControlsVisibility(); - if (hist && hist->unreadLoaded) { + if (hist && hist->readyForWork()) { _scroll.show(); if (hist->lastScrollTop == History::ScrollMax) { _scroll.scrollToY(hist->lastScrollTop); @@ -2197,18 +2332,24 @@ void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { } void HistoryWidget::dragLeaveEvent(QDragLeaveEvent *e) { - _attachDrag = DragStateNone; - updateDragAreas(); + if (_attachDrag != DragStateNone || !_attachDragPhoto.isHidden() || !_attachDragDocument.isHidden()) { + _attachDrag = DragStateNone; + updateDragAreas(); + } } void HistoryWidget::leaveEvent(QEvent *e) { - _attachDrag = DragStateNone; - updateDragAreas(); + if (_attachDrag != DragStateNone || !_attachDragPhoto.isHidden() || !_attachDragDocument.isHidden()) { + _attachDrag = DragStateNone; + updateDragAreas(); + } } void HistoryWidget::mouseReleaseEvent(QMouseEvent *e) { - _attachDrag = DragStateNone; - updateDragAreas(); + if (_attachDrag != DragStateNone || !_attachDragPhoto.isHidden() || !_attachDragDocument.isHidden()) { + _attachDrag = DragStateNone; + updateDragAreas(); + } } DragState HistoryWidget::getDragState(const QMimeData *d) { @@ -2486,13 +2627,18 @@ void HistoryWidget::confirmSendImage(const ReadyLocalMedia &img) { App::uploader()->uploadMedia(newId, img); + History *h = App::history(img.peer); if (img.type == ToPreparePhoto) { - App::history(img.peer)->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(img.photo))); + h->loadAround(0); + h->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(img.photo))); } else if (img.type == ToPrepareDocument) { - App::history(img.peer)->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(img.document))); + h->loadAround(0); + h->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(img.peer), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(img.document))); } - if (hist && histPeer && img.peer == histPeer->id) App::main()->historyToDown(hist); + if (hist && histPeer && img.peer == histPeer->id) { + App::main()->historyToDown(hist); + } App::main()->dialogsToUp(); peerMessagesUpdated(img.peer); } @@ -2580,6 +2726,9 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { updateListSize(); _field.resize(width() - _send.width() - _attachDocument.width() - _attachEmoji.width(), _field.height()); + + _toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip); + _attachEmoji.move(_field.x() + _field.width(), height() - _attachEmoji.height()); _send.move(width() - _send.width(), _attachDocument.y()); @@ -2604,15 +2753,16 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { } } -void HistoryWidget::updateListSize(int32 addToY, bool initial) { +void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown) { if (!hist || (!_histInited && !initial)) return; if (!App::wnd()->isVisible()) return; // scrollTopMax etc are not working after recountHeight() - int32 newScrollHeight = height() - (hist->unreadLoaded && (!histPeer->chat || !histPeer->asChat()->forbidden) ? (_field.height() + 2 * st::sendPadding) : 0); + int32 newScrollHeight = height() - (hist->readyForWork() && (!histPeer->chat || !histPeer->asChat()->forbidden) ? (_field.height() + 2 * st::sendPadding) : 0); bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight; if (needResize) { _scroll.resize(width(), newScrollHeight); + _toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip); } if (!initial) { @@ -2627,20 +2777,29 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial) { if (washidden) { _scroll.hide(); } - if (!hist->unreadLoaded) return; + if (!hist->readyForWork()) return; - if (!initial && !wasAtBottom) { + if (!initial && !wasAtBottom || loadedDown) { _scroll.scrollToY(newSt + addToY); return; } - if (!hist->unreadLoaded) return; if (initial) { _histInited = true; } int32 toY = History::ScrollMax; - if (initial && hist->unreadBar) { + if (initial && hist->activeMsgId && !hist->lastWidth) { + HistoryItem *item = App::histItemById(hist->activeMsgId); + if (!item || item->detached()) { + hist->activeMsgId = 0; + return updateListSize(addToY, initial); + } else { + toY = (_scroll.height() > item->height()) ? qMax(item->y + item->block()->y - (_scroll.height() - item->height()) / 2, 0) : (item->y + item->block()->y); + _animActiveStart = getms(); + _animActiveTimer.start(AnimationTimerDelta); + } + } else if (initial && hist->unreadBar) { toY = hist->unreadBar->y + hist->unreadBar->block()->y; } else if (hist->showFrom) { toY = hist->showFrom->y + hist->showFrom->block()->y; @@ -2654,7 +2813,6 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial) { toY = newSt; hist->lastWidth = 0; } else { - int blabla = 0; } _scroll.scrollToY(toY); } @@ -2666,6 +2824,13 @@ void HistoryWidget::addMessagesToFront(const QVector &messages) { checkUnreadLoaded(true); } +void HistoryWidget::addMessagesToBack(const QVector &messages) { + int32 sliceFrom = 0; + _list->messagesReceivedDown(messages); + updateListSize(0, false, true); + checkUnreadLoaded(true); +} + void HistoryWidget::mousePressEvent(QMouseEvent *e) { } @@ -2784,6 +2949,22 @@ void HistoryWidget::onClearSelected() { if (_list) _list->clearSelectedItems(); } +void HistoryWidget::onAnimActiveStep() { + if (!hist || !hist->activeMsgId) return _animActiveTimer.stop(); + HistoryItem *item = App::histItemById(hist->activeMsgId); + if (!item || item->detached()) return _animActiveTimer.stop(); + + App::main()->msgUpdated(histPeer->id, item); +} + +uint64 HistoryWidget::animActiveTime() const { + return _animActiveTimer.isActive() ? (getms() - _animActiveStart) : 0; +} + +void HistoryWidget::stopAnimActive() { + _animActiveTimer.stop(); +} + void HistoryWidget::updateTopBarSelection() { if (!_list) { App::main()->topBar()->showSelected(0); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 363e8589b9bf6e..5e88b8b4a56633 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -40,6 +40,7 @@ class HistoryList : public QWidget { HistoryList(HistoryWidget *historyWidget, ScrollArea *scroll, History *history); void messagesReceived(const QVector &messages); + void messagesReceivedDown(const QVector &messages); bool event(QEvent *e); // calls touchEvent when necessary void touchEvent(QTouchEvent *e); @@ -251,6 +252,7 @@ class HistoryWidget : public QWidget, public RPCSender, public Animated { void messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId); void windowShown(); + bool isActive() const; void resizeEvent(QResizeEvent *e); void keyPressEvent(QKeyEvent *e); @@ -269,6 +271,7 @@ class HistoryWidget : public QWidget, public RPCSender, public Animated { void topBarClick(); void loadMessages(); + void loadMessagesDown(); void peerMessagesUpdated(PeerId peer); void peerMessagesUpdated(); @@ -300,6 +303,7 @@ class HistoryWidget : public QWidget, public RPCSender, public Animated { PeerData *peer() const; PeerData *activePeer() const; + MsgId activeMsgId() const; void animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTopBarCache, bool back = false); bool animStep(float64 ms); @@ -314,6 +318,9 @@ class HistoryWidget : public QWidget, public RPCSender, public Animated { QString prepareMessage(QString text); + uint64 animActiveTime() const; + void stopAnimActive(); + ~HistoryWidget(); signals: @@ -334,6 +341,7 @@ public slots: void onDocumentFailed(MsgId msgId); void onListScroll(); + void onHistoryToEnd(); void onSend(); void onPhotoSelect(); @@ -343,7 +351,7 @@ public slots: void onPhotoReady(); void onPhotoFailed(quint64 id); - void showPeer(const PeerId &peer, bool force = false, bool leaveActive = false); + void showPeer(const PeerId &peer, MsgId msgId = 0, bool force = false, bool leaveActive = false); void activate(); void onTextChange(); @@ -364,11 +372,14 @@ public slots: void onDeleteContextSure(); void onClearSelected(); + void onAnimActiveStep(); + private: bool messagesFailed(const RPCError &error, mtpRequestId requestId); - void updateListSize(int32 addToY = 0, bool initial = false); + void updateListSize(int32 addToY = 0, bool initial = false, bool loadedDown = false); void addMessagesToFront(const QVector &messages); + void addMessagesToBack(const QVector &messages); void chatLoaded(const MTPmessages_ChatFull &res); QStringList getMediasFromMime(const QMimeData *d); @@ -376,18 +387,20 @@ public slots: void updateDragAreas(); - int32 histOffset, histCount, histReadRequestId; int32 histRequestsCount; - PeerData *histPeer, *_activePeer; + PeerData *histPeer; + History *_activeHist; MTPinputPeer histInputPeer; - mtpRequestId histPreloading; - QVector histPreload; + mtpRequestId histPreloading, histPreloadingDown; + QVector histPreload, histPreloadDown; ScrollArea _scroll; HistoryList *_list; History *hist; bool _histInited; // initial updateListSize() called + IconedButton _toHistoryEnd; + FlatButton _send; IconedButton _attachDocument, _attachPhoto, _attachEmoji; MessageField _field; @@ -422,5 +435,8 @@ public slots: QTimer _scrollTimer; int32 _scrollDelta; + QTimer _animActiveTimer; + float64 _animActiveStart; + }; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8be1ecf1f997c1..84789d3d3d8ee8 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -85,7 +85,7 @@ void TopBarWidget::onDeleteContactSure() { PeerData *p = App::main() ? App::main()->profilePeer() : 0; UserData *u = (p && !p->chat) ? p->asUser() : 0; if (u) { - App::main()->showPeer(0, true); + App::main()->showPeer(0, 0, true); App::wnd()->hideLayer(); MTP::send(MTPcontacts_DeleteContact(u->inputUser), App::main()->rpcDone(&MainWidget::deletedContact, u)); } @@ -105,7 +105,7 @@ void TopBarWidget::onDeleteAndExitSure() { PeerData *p = App::main() ? App::main()->profilePeer() : 0; ChatData *c = (p && p->chat) ? p->asChat() : 0; if (c) { - App::main()->showPeer(0, true); + App::main()->showPeer(0, 0, true); App::wnd()->hideLayer(); MTP::send(MTPmessages_DeleteChatUser(MTP_int(p->id & 0xFFFFFFFF), App::self()->inputUser), App::main()->rpcDone(&MainWidget::deleteHistory, p), App::main()->rpcFail(&MainWidget::leaveChatFailed, p)); } @@ -266,7 +266,7 @@ MainWidget::MainWidget(Window *window) : QWidget(window), failedObjId(0), _dialo setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight)); connect(window, SIGNAL(resized(const QSize &)), this, SLOT(onParentResize(const QSize &))); - connect(&dialogs, SIGNAL(peerChosen(const PeerId &)), this, SLOT(showPeer(const PeerId &))); + connect(&dialogs, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SLOT(showPeer(const PeerId &, MsgId))); connect(&dialogs, SIGNAL(cancelled()), this, SLOT(dialogsCancelled())); connect(&history, SIGNAL(cancelled()), &dialogs, SLOT(activate())); connect(this, SIGNAL(peerPhotoChanged(PeerData *)), this, SIGNAL(dialogsUpdated())); @@ -423,7 +423,7 @@ void MainWidget::addParticipants(ChatData *chat, const QVector &users MTP::send(MTPmessages_AddChatUser(MTP_int(chat->id & 0xFFFFFFFF), (*i)->inputUser, MTP_int(ForwardOnAdd)), rpcDone(&MainWidget::addParticipantDone, chat), rpcFail(&MainWidget::addParticipantFail, chat), 0, 5); } App::wnd()->hideLayer(); - showPeer(chat->id, false); + showPeer(chat->id, 0, false); } void MainWidget::addParticipantDone(ChatData *chat, const MTPmessages_StatedMessage &result) { @@ -439,7 +439,7 @@ bool MainWidget::addParticipantFail(ChatData *chat, const RPCError &e) { void MainWidget::kickParticipant(ChatData *chat, UserData *user) { MTP::send(MTPmessages_DeleteChatUser(MTP_int(chat->id & 0xFFFFFFFF), user->inputUser), rpcDone(&MainWidget::kickParticipantDone, chat), rpcFail(&MainWidget::kickParticipantFail, chat)); App::wnd()->hideLayer(); - showPeer(chat->id, false); + showPeer(chat->id, 0, false); } void MainWidget::kickParticipantDone(ChatData *chat, const MTPmessages_StatedMessage &result) { @@ -476,9 +476,9 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu } dialogs.removePeer(peer); } else { - if (App::historyLoaded(peer->id)) { - History *h = App::history(peer->id); - h->addToBack((*v)[0], false); + History *h = App::historyLoaded(peer->id); + if (!h->last) { + h->addToBack((*v)[0], 0); } } } @@ -508,6 +508,8 @@ void MainWidget::sendMessage(History *hist, const QString &text) { App::historyRegRandom(randomId, newId); + hist->loadAround(0); + MTPstring msgText(MTP_string(msg)); hist->addToBack(MTP_message(MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTP_bool(true), MTP_bool(true), MTP_int(unixtime()), msgText, MTP_messageMediaEmpty())); historyToDown(hist); @@ -520,7 +522,7 @@ void MainWidget::sendMessage(History *hist, const QString &text) { } void MainWidget::readServerHistory(History *hist, bool force) { - if (!hist || (!force && (!hist->unreadCount || !hist->unreadLoaded))) return; + if (!hist || (!force && (!hist->unreadCount || !hist->readyForWork()))) return; ReadRequests::const_iterator i = _readRequests.constFind(hist->peer); if (i == _readRequests.cend()) { @@ -529,6 +531,14 @@ void MainWidget::readServerHistory(History *hist, bool force) { } } +uint64 MainWidget::animActiveTime() const { + return history.animActiveTime(); +} + +void MainWidget::stopAnimActive() { + history.stopAnimActive(); +} + void MainWidget::partWasRead(PeerData *peer, const MTPmessages_AffectedHistory &result) { const MTPDmessages_affectedHistory &d(result.c_messages_affectedHistory()); App::main()->updUpdated(d.vpts.v, 0, 0, d.vseq.v); @@ -713,7 +723,7 @@ bool MainWidget::getVideoCoords(VideoData *video, int32 &x, int32 &y, int32 &w) return false; } -void MainWidget::showPeer(const PeerId &peerId, bool back, bool force) { +void MainWidget::showPeer(const PeerId &peerId, MsgId msgId, bool back, bool force) { if (!back && profileStack.size() == 1 && profileStack[0]->id == peerId) { back = true; } @@ -738,7 +748,7 @@ void MainWidget::showPeer(const PeerId &peerId, bool back, bool force) { history.show(); } } - history.showPeer(peerId, force); + history.showPeer(peerId, msgId, force); if (force || !selectingPeer()) { if (profile) { if (profile) profile->deleteLater(); @@ -775,6 +785,10 @@ PeerData *MainWidget::activePeer() { return history.activePeer(); } +MsgId MainWidget::activeMsgId() { + return history.activeMsgId(); +} + PeerData *MainWidget::profilePeer() { return profile ? profile->peer() : 0; } @@ -798,7 +812,7 @@ void MainWidget::showPeerProfile(const PeerData *peer, bool back) { resizeEvent(0); profile->animShow(animCache, animTopBarCache, back); history.animStop(); - history.showPeer(0, false, true); + history.showPeer(0, 0, false, true); history.hide(); _topBar.raise(); dialogs.raise(); @@ -810,7 +824,7 @@ void MainWidget::showPeerBack() { PeerData *peer = profileStack.back(); profileStack.pop_back(); if (profileStack.isEmpty()) { - showPeer(peer->id, true); + showPeer(peer->id, App::main()->activeMsgId(), true); } else { showPeerProfile(peer, true); } @@ -971,7 +985,7 @@ void MainWidget::sentFullDatasReceived(const MTPmessages_StatedMessages &result) void MainWidget::forwardDone(PeerId peer, const MTPmessages_StatedMessages &result) { sentFullDatasReceived(result); if (hider) hider->forwardDone(); - showPeer(peer, false, true); + showPeer(peer, 0, false, true); history.onClearSelected(); } @@ -991,7 +1005,7 @@ void MainWidget::dialogsToUp() { } void MainWidget::dialogsClear() { - dialogs.onCancel(); + dialogs.clearFiltered(); } void MainWidget::newUnreadMsg(History *hist, MsgId msgId) { @@ -1394,7 +1408,7 @@ bool MainWidget::isActive() const { } bool MainWidget::historyIsActive() const { - return isActive() && !profile; + return isActive() && !profile && history.isActive(); } int32 MainWidget::dlgsWidth() const { @@ -1487,8 +1501,10 @@ void MainWidget::updateReceived(const mtpPrime *from, const mtpPrime *end) { } if (!App::userLoaded(d.vfrom_id.v)) return getDifference(); - PeerId peer = App::histories().addToBack(MTP_message(d.vid, d.vfrom_id, MTP_peerUser(MTP_int(MTP::authedId())), MTP_bool(false), MTP_bool(true), d.vdate, d.vmessage, MTP_messageMediaEmpty())); - history.peerMessagesUpdated(peer); + HistoryItem *item = App::histories().addToBack(MTP_message(d.vid, d.vfrom_id, MTP_peerUser(MTP_int(MTP::authedId())), MTP_bool(false), MTP_bool(true), d.vdate, d.vmessage, MTP_messageMediaEmpty())); + if (item) { + history.peerMessagesUpdated(item->history()->peer->id); + } updSetState(d.vpts.v, d.vdate.v, updQts, d.vseq.v); } break; @@ -1500,8 +1516,10 @@ void MainWidget::updateReceived(const mtpPrime *from, const mtpPrime *end) { } if (!App::chatLoaded(d.vchat_id.v) || !App::userLoaded(d.vfrom_id.v)) return getDifference(); - PeerId peer = App::histories().addToBack(MTP_message(d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), MTP_bool(false), MTP_bool(true), d.vdate, d.vmessage, MTP_messageMediaEmpty())); - history.peerMessagesUpdated(peer); + HistoryItem *item = App::histories().addToBack(MTP_message(d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), MTP_bool(false), MTP_bool(true), d.vdate, d.vmessage, MTP_messageMediaEmpty())); + if (item) { + history.peerMessagesUpdated(item->history()->peer->id); + } updSetState(d.vpts.v, d.vdate.v, updQts, d.vseq.v); } break; @@ -1523,8 +1541,10 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { switch (update.type()) { case mtpc_updateNewMessage: { const MTPDupdateNewMessage &d(update.c_updateNewMessage()); - PeerId peer = App::histories().addToBack(d.vmessage); - history.peerMessagesUpdated(peer); + HistoryItem *item = App::histories().addToBack(d.vmessage); + if (item) { + history.peerMessagesUpdated(item->history()->peer->id); + } if (updPts < d.vpts.v) updPts = d.vpts.v; } break; @@ -1535,10 +1555,8 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { HistoryItem *msgRow = App::histItemById(msg); if (msgRow) { App::historyUnregItem(msgRow); - if (msgRow->id > 0) --msgRow->history()->offset; msgRow->id = d.vid.v; - if (msgRow->id > 0) ++msgRow->history()->offset; - if (App::historyRegItem(msgRow)) { + if (!App::historyRegItem(msgRow)) { msgUpdated(msgRow->history()->peer->id, msgRow); } else { msgRow->destroy(); @@ -1635,7 +1653,9 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { if (false && !d.vprevious.v && d.vuser_id.v != MTP::authedId() && d.vphoto.type() == mtpc_userProfilePhoto) { MTPPhoto photo(App::photoFromUserPhoto(MTP_int(user->id & 0xFFFFFFFF), d.vdate, d.vphoto)); HistoryMedia *media = new HistoryPhoto(photo.c_photo(), 100); - App::history(user->id)->addToBackService(clientMsgId(), date(d.vdate), lang(lng_action_user_photo).replace(qsl("{from}"), user->name), false, true, media); + if (App::history(user->id)->loadedAtBottom()) { + App::history(user->id)->addToBackService(clientMsgId(), date(d.vdate), lang(lng_action_user_photo).replace(qsl("{from}"), user->name), false, true, media); + } } if (App::main()) App::main()->peerUpdated(user); } @@ -1645,7 +1665,9 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { const MTPDupdateContactRegistered &d(update.c_updateContactRegistered()); UserData *user = App::userLoaded(d.vuser_id.v); if (user) { - App::history(user->id)->addToBackService(clientMsgId(), date(d.vdate), lang(lng_action_user_registered).replace(qsl("{from}"), user->name), false, true); + if (App::history(user->id)->loadedAtBottom()) { + App::history(user->id)->addToBackService(clientMsgId(), date(d.vdate), lang(lng_action_user_registered).replace(qsl("{from}"), user->name), false, true); + } } } break; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 491365a9c754f5..0bf767186a20e2 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -134,6 +134,7 @@ class MainWidget : public QWidget, public Animated, public RPCSender { PeerData *peerAfter(const PeerData *peer); PeerData *peer(); PeerData *activePeer(); + MsgId activeMsgId(); PeerData *profilePeer(); void showPeerProfile(const PeerData *peer, bool back = false); void showPeerBack(); @@ -193,6 +194,9 @@ class MainWidget : public QWidget, public Animated, public RPCSender { void readServerHistory(History *history, bool force = true); + uint64 animActiveTime() const; + void stopAnimActive(); + ~MainWidget(); signals: @@ -201,6 +205,7 @@ class MainWidget : public QWidget, public Animated, public RPCSender { void peerNameChanged(PeerData *peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars); void peerPhotoChanged(PeerData *peer); void dialogRowReplaced(DialogRow *oldRow, DialogRow *newRow); + void historyItemReplaced(HistoryItem *oldItem, HistoryItem *newItem); void dialogToTop(const History::DialogLinks &links); void dialogsUpdated(); void historyItemDeleted(HistoryItem *item); @@ -227,7 +232,7 @@ public slots: void mainStateChanged(Qt::WindowState state); void updateOnlineDisplay(); - void showPeer(const PeerId &peer, bool back = false, bool force = false); + void showPeer(const PeerId &peer, MsgId msgId = 0, bool back = false, bool force = false); void onTopBarClick(); void onPeerShown(PeerData *peer); diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index 3cab29832e3988..0f40d5f17e7bb4 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -189,19 +189,13 @@ funcsText += '\tmtpTypeId type() const {\n\t\treturn mtpc_' + name + ';\n\t}\n'; # type id - if (len(prmsList)): - funcsText += '\tvoid read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_' + name + ') {\n'; # read method - else: - funcsText += '\tvoid read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_' + name + ') {\n'; # read method + funcsText += '\tvoid read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_' + name + ') {\n'; # read method for k in prmsList: v = prms[k]; funcsText += '\t\tv' + k + '.read(from, end);\n'; funcsText += '\t}\n'; - if (len(prmsList)): - funcsText += '\tvoid write(mtpBuffer &to) const {\n'; # write method - else: - funcsText += '\tvoid write(mtpBuffer &/*to*/) const {\n'; # write method + funcsText += '\tvoid write(mtpBuffer &to) const {\n'; # write method for k in prmsList: v = prms[k]; funcsText += '\t\tv' + k + '.write(to);\n'; @@ -538,10 +532,7 @@ def addTextSerialize(dct): inlineMethods += '}\n'; typesText += '\tvoid write(mtpBuffer &to) const;\n'; # write method - if (len(writer)): - inlineMethods += 'inline void MTP' + restype + '::write(mtpBuffer &to) const {\n'; - else: - inlineMethods += 'inline void MTP' + restype + '::write(mtpBuffer &/*to*/) const {\n'; + inlineMethods += 'inline void MTP' + restype + '::write(mtpBuffer &to) const {\n'; if (withType): inlineMethods += '\tswitch (_type) {\n'; inlineMethods += writer; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 0714c18237d740..25fafbc7ee9909 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -41,6 +41,7 @@ inline bool mtpRequestData::needAckByType(mtpTypeId type) { case mtpc_http_wait: case mtpc_bad_msg_notification: case mtpc_msgs_all_info: + case mtpc_msgs_state_info: case mtpc_msg_detailed_info: case mtpc_msg_new_detailed_info: return false; diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index c19477c7c3610c..eb97e8bf3cd64d 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -328,6 +328,7 @@ enum { mtpc_invokeWithLayer12 = 0xdda60d3c, mtpc_invokeWithLayer13 = 0x427c8ea2, mtpc_invokeWithLayer14 = 0x2b9b08fa, + mtpc_invokeWithLayer15 = 0xb4418b64, // manually parsed mtpc_rpc_result = 0xf35c6d01, @@ -352,6 +353,7 @@ static const mtpTypeId mtpLayers[] = { mtpc_invokeWithLayer12, mtpc_invokeWithLayer13, mtpc_invokeWithLayer14, + mtpc_invokeWithLayer15, }, mtpLayerMax = sizeof(mtpLayers) / sizeof(mtpLayers[0]); template diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 15a4d4befc7df4..9ffa73e61e5ba0 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -213,6 +213,7 @@ enum { mtpc_inputMessagesFilterVideo = 0x9fc00e65, mtpc_inputMessagesFilterPhotoVideo = 0x56e9f0e4, mtpc_inputMessagesFilterDocument = 0x9eddf188, + mtpc_inputMessagesFilterAudio = 0xcfc87522, mtpc_updateNewMessage = 0x13abdb3, mtpc_updateMessageID = 0x4e90bfd6, mtpc_updateReadMessages = 0xc6649e31, @@ -4969,6 +4970,7 @@ class MTPmessagesFilter { friend MTPmessagesFilter MTP_inputMessagesFilterVideo(); friend MTPmessagesFilter MTP_inputMessagesFilterPhotoVideo(); friend MTPmessagesFilter MTP_inputMessagesFilterDocument(); + friend MTPmessagesFilter MTP_inputMessagesFilterAudio(); mtpTypeId _type; }; @@ -9829,7 +9831,7 @@ class MTPreq_pq { // RPC method 'req_pq' mtpTypeId type() const { return mtpc_req_pq; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_req_pq) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_req_pq) { vnonce.read(from, end); } void write(mtpBuffer &to) const { @@ -9873,7 +9875,7 @@ class MTPreq_DH_params { // RPC method 'req_DH_params' mtpTypeId type() const { return mtpc_req_DH_params; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_req_DH_params) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_req_DH_params) { vnonce.read(from, end); vserver_nonce.read(from, end); vp.read(from, end); @@ -9924,7 +9926,7 @@ class MTPset_client_DH_params { // RPC method 'set_client_DH_params' mtpTypeId type() const { return mtpc_set_client_DH_params; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_set_client_DH_params) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_set_client_DH_params) { vnonce.read(from, end); vserver_nonce.read(from, end); vencrypted_data.read(from, end); @@ -9967,7 +9969,7 @@ class MTPrpc_drop_answer { // RPC method 'rpc_drop_answer' mtpTypeId type() const { return mtpc_rpc_drop_answer; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_rpc_drop_answer) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_rpc_drop_answer) { vreq_msg_id.read(from, end); } void write(mtpBuffer &to) const { @@ -10006,7 +10008,7 @@ class MTPget_future_salts { // RPC method 'get_future_salts' mtpTypeId type() const { return mtpc_get_future_salts; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_get_future_salts) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_get_future_salts) { vnum.read(from, end); } void write(mtpBuffer &to) const { @@ -10045,7 +10047,7 @@ class MTPping { // RPC method 'ping' mtpTypeId type() const { return mtpc_ping; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_ping) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_ping) { vping_id.read(from, end); } void write(mtpBuffer &to) const { @@ -10085,7 +10087,7 @@ class MTPping_delay_disconnect { // RPC method 'ping_delay_disconnect' mtpTypeId type() const { return mtpc_ping_delay_disconnect; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_ping_delay_disconnect) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_ping_delay_disconnect) { vping_id.read(from, end); vdisconnect_delay.read(from, end); } @@ -10126,7 +10128,7 @@ class MTPdestroy_session { // RPC method 'destroy_session' mtpTypeId type() const { return mtpc_destroy_session; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_destroy_session) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_destroy_session) { vsession_id.read(from, end); } void write(mtpBuffer &to) const { @@ -10169,7 +10171,7 @@ class MTPregister_saveDeveloperInfo { // RPC method 'register.saveDeveloperInfo' mtpTypeId type() const { return mtpc_register_saveDeveloperInfo; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_register_saveDeveloperInfo) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_register_saveDeveloperInfo) { vname.read(from, end); vemail.read(from, end); vphone_number.read(from, end); @@ -10218,7 +10220,7 @@ class MTPinvokeAfterMsg { // RPC method 'invokeAfterMsg' mtpTypeId type() const { return mtpc_invokeAfterMsg; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_invokeAfterMsg) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeAfterMsg) { vmsg_id.read(from, end); vquery.read(from, end); } @@ -10260,7 +10262,7 @@ class MTPinvokeAfterMsgs { // RPC method 'invokeAfterMsgs' mtpTypeId type() const { return mtpc_invokeAfterMsgs; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_invokeAfterMsgs) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_invokeAfterMsgs) { vmsg_ids.read(from, end); vquery.read(from, end); } @@ -10300,7 +10302,7 @@ class MTPauth_checkPhone { // RPC method 'auth.checkPhone' mtpTypeId type() const { return mtpc_auth_checkPhone; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_checkPhone) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_checkPhone) { vphone_number.read(from, end); } void write(mtpBuffer &to) const { @@ -10343,7 +10345,7 @@ class MTPauth_sendCode { // RPC method 'auth.sendCode' mtpTypeId type() const { return mtpc_auth_sendCode; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_sendCode) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCode) { vphone_number.read(from, end); vsms_type.read(from, end); vapi_id.read(from, end); @@ -10391,7 +10393,7 @@ class MTPauth_sendCall { // RPC method 'auth.sendCall' mtpTypeId type() const { return mtpc_auth_sendCall; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_sendCall) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCall) { vphone_number.read(from, end); vphone_code_hash.read(from, end); } @@ -10436,7 +10438,7 @@ class MTPauth_signUp { // RPC method 'auth.signUp' mtpTypeId type() const { return mtpc_auth_signUp; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_signUp) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_signUp) { vphone_number.read(from, end); vphone_code_hash.read(from, end); vphone_code.read(from, end); @@ -10485,7 +10487,7 @@ class MTPauth_signIn { // RPC method 'auth.signIn' mtpTypeId type() const { return mtpc_auth_signIn; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_signIn) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_signIn) { vphone_number.read(from, end); vphone_code_hash.read(from, end); vphone_code.read(from, end); @@ -10524,9 +10526,9 @@ class MTPauth_logOut { // RPC method 'auth.logOut' mtpTypeId type() const { return mtpc_auth_logOut; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_auth_logOut) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_logOut) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPBool ResponseType; @@ -10555,9 +10557,9 @@ class MTPauth_resetAuthorizations { // RPC method 'auth.resetAuthorizations' mtpTypeId type() const { return mtpc_auth_resetAuthorizations; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_auth_resetAuthorizations) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_resetAuthorizations) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPBool ResponseType; @@ -10591,7 +10593,7 @@ class MTPauth_sendInvites { // RPC method 'auth.sendInvites' mtpTypeId type() const { return mtpc_auth_sendInvites; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_sendInvites) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendInvites) { vphone_numbers.read(from, end); vmessage.read(from, end); } @@ -10632,7 +10634,7 @@ class MTPauth_exportAuthorization { // RPC method 'auth.exportAuthorization' mtpTypeId type() const { return mtpc_auth_exportAuthorization; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_exportAuthorization) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_exportAuthorization) { vdc_id.read(from, end); } void write(mtpBuffer &to) const { @@ -10672,7 +10674,7 @@ class MTPauth_importAuthorization { // RPC method 'auth.importAuthorization' mtpTypeId type() const { return mtpc_auth_importAuthorization; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_auth_importAuthorization) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_importAuthorization) { vid.read(from, end); vbytes.read(from, end); } @@ -10719,7 +10721,7 @@ class MTPaccount_registerDevice { // RPC method 'account.registerDevice' mtpTypeId type() const { return mtpc_account_registerDevice; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_registerDevice) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_registerDevice) { vtoken_type.read(from, end); vtoken.read(from, end); vdevice_model.read(from, end); @@ -10771,7 +10773,7 @@ class MTPaccount_unregisterDevice { // RPC method 'account.unregisterDevice' mtpTypeId type() const { return mtpc_account_unregisterDevice; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_unregisterDevice) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_unregisterDevice) { vtoken_type.read(from, end); vtoken.read(from, end); } @@ -10813,7 +10815,7 @@ class MTPaccount_updateNotifySettings { // RPC method 'account.updateNotifySetti mtpTypeId type() const { return mtpc_account_updateNotifySettings; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_updateNotifySettings) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateNotifySettings) { vpeer.read(from, end); vsettings.read(from, end); } @@ -10854,7 +10856,7 @@ class MTPaccount_getNotifySettings { // RPC method 'account.getNotifySettings' mtpTypeId type() const { return mtpc_account_getNotifySettings; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_getNotifySettings) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getNotifySettings) { vpeer.read(from, end); } void write(mtpBuffer &to) const { @@ -10889,9 +10891,9 @@ class MTPaccount_resetNotifySettings { // RPC method 'account.resetNotifySetting mtpTypeId type() const { return mtpc_account_resetNotifySettings; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_account_resetNotifySettings) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_resetNotifySettings) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPBool ResponseType; @@ -10925,7 +10927,7 @@ class MTPaccount_updateProfile { // RPC method 'account.updateProfile' mtpTypeId type() const { return mtpc_account_updateProfile; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_updateProfile) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateProfile) { vfirst_name.read(from, end); vlast_name.read(from, end); } @@ -10966,7 +10968,7 @@ class MTPaccount_updateStatus { // RPC method 'account.updateStatus' mtpTypeId type() const { return mtpc_account_updateStatus; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_account_updateStatus) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateStatus) { voffline.read(from, end); } void write(mtpBuffer &to) const { @@ -11001,9 +11003,9 @@ class MTPaccount_getWallPapers { // RPC method 'account.getWallPapers' mtpTypeId type() const { return mtpc_account_getWallPapers; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_account_getWallPapers) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_getWallPapers) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPVector ResponseType; @@ -11036,7 +11038,7 @@ class MTPusers_getUsers { // RPC method 'users.getUsers' mtpTypeId type() const { return mtpc_users_getUsers; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_users_getUsers) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_users_getUsers) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11075,7 +11077,7 @@ class MTPusers_getFullUser { // RPC method 'users.getFullUser' mtpTypeId type() const { return mtpc_users_getFullUser; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_users_getFullUser) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_users_getFullUser) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11110,9 +11112,9 @@ class MTPcontacts_getStatuses { // RPC method 'contacts.getStatuses' mtpTypeId type() const { return mtpc_contacts_getStatuses; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_contacts_getStatuses) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getStatuses) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPVector ResponseType; @@ -11145,7 +11147,7 @@ class MTPcontacts_getContacts { // RPC method 'contacts.getContacts' mtpTypeId type() const { return mtpc_contacts_getContacts; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_getContacts) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getContacts) { vhash.read(from, end); } void write(mtpBuffer &to) const { @@ -11185,7 +11187,7 @@ class MTPcontacts_importContacts { // RPC method 'contacts.importContacts' mtpTypeId type() const { return mtpc_contacts_importContacts; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_importContacts) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_importContacts) { vcontacts.read(from, end); vreplace.read(from, end); } @@ -11227,7 +11229,7 @@ class MTPcontacts_search { // RPC method 'contacts.search' mtpTypeId type() const { return mtpc_contacts_search; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_search) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_search) { vq.read(from, end); vlimit.read(from, end); } @@ -11268,7 +11270,7 @@ class MTPcontacts_getSuggested { // RPC method 'contacts.getSuggested' mtpTypeId type() const { return mtpc_contacts_getSuggested; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_getSuggested) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getSuggested) { vlimit.read(from, end); } void write(mtpBuffer &to) const { @@ -11307,7 +11309,7 @@ class MTPcontacts_deleteContact { // RPC method 'contacts.deleteContact' mtpTypeId type() const { return mtpc_contacts_deleteContact; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_deleteContact) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_deleteContact) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11346,7 +11348,7 @@ class MTPcontacts_deleteContacts { // RPC method 'contacts.deleteContacts' mtpTypeId type() const { return mtpc_contacts_deleteContacts; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_deleteContacts) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_deleteContacts) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11385,7 +11387,7 @@ class MTPcontacts_block { // RPC method 'contacts.block' mtpTypeId type() const { return mtpc_contacts_block; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_block) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_block) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11424,7 +11426,7 @@ class MTPcontacts_unblock { // RPC method 'contacts.unblock' mtpTypeId type() const { return mtpc_contacts_unblock; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_unblock) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_unblock) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11464,7 +11466,7 @@ class MTPcontacts_getBlocked { // RPC method 'contacts.getBlocked' mtpTypeId type() const { return mtpc_contacts_getBlocked; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_contacts_getBlocked) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getBlocked) { voffset.read(from, end); vlimit.read(from, end); } @@ -11505,7 +11507,7 @@ class MTPmessages_getMessages { // RPC method 'messages.getMessages' mtpTypeId type() const { return mtpc_messages_getMessages; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getMessages) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getMessages) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11546,7 +11548,7 @@ class MTPmessages_getDialogs { // RPC method 'messages.getDialogs' mtpTypeId type() const { return mtpc_messages_getDialogs; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getDialogs) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDialogs) { voffset.read(from, end); vmax_id.read(from, end); vlimit.read(from, end); @@ -11592,7 +11594,7 @@ class MTPmessages_getHistory { // RPC method 'messages.getHistory' mtpTypeId type() const { return mtpc_messages_getHistory; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getHistory) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getHistory) { vpeer.read(from, end); voffset.read(from, end); vmax_id.read(from, end); @@ -11644,7 +11646,7 @@ class MTPmessages_search { // RPC method 'messages.search' mtpTypeId type() const { return mtpc_messages_search; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_search) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_search) { vpeer.read(from, end); vq.read(from, end); vfilter.read(from, end); @@ -11699,7 +11701,7 @@ class MTPmessages_readHistory { // RPC method 'messages.readHistory' mtpTypeId type() const { return mtpc_messages_readHistory; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_readHistory) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_readHistory) { vpeer.read(from, end); vmax_id.read(from, end); voffset.read(from, end); @@ -11743,7 +11745,7 @@ class MTPmessages_deleteHistory { // RPC method 'messages.deleteHistory' mtpTypeId type() const { return mtpc_messages_deleteHistory; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_deleteHistory) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_deleteHistory) { vpeer.read(from, end); voffset.read(from, end); } @@ -11784,7 +11786,7 @@ class MTPmessages_deleteMessages { // RPC method 'messages.deleteMessages' mtpTypeId type() const { return mtpc_messages_deleteMessages; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_deleteMessages) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_deleteMessages) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11823,7 +11825,7 @@ class MTPmessages_restoreMessages { // RPC method 'messages.restoreMessages' mtpTypeId type() const { return mtpc_messages_restoreMessages; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_restoreMessages) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_restoreMessages) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -11862,7 +11864,7 @@ class MTPmessages_receivedMessages { // RPC method 'messages.receivedMessages' mtpTypeId type() const { return mtpc_messages_receivedMessages; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_receivedMessages) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_receivedMessages) { vmax_id.read(from, end); } void write(mtpBuffer &to) const { @@ -11902,7 +11904,7 @@ class MTPmessages_setTyping { // RPC method 'messages.setTyping' mtpTypeId type() const { return mtpc_messages_setTyping; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_setTyping) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_setTyping) { vpeer.read(from, end); vtyping.read(from, end); } @@ -11945,7 +11947,7 @@ class MTPmessages_sendMessage { // RPC method 'messages.sendMessage' mtpTypeId type() const { return mtpc_messages_sendMessage; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendMessage) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendMessage) { vpeer.read(from, end); vmessage.read(from, end); vrandom_id.read(from, end); @@ -11990,7 +11992,7 @@ class MTPmessages_sendMedia { // RPC method 'messages.sendMedia' mtpTypeId type() const { return mtpc_messages_sendMedia; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendMedia) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendMedia) { vpeer.read(from, end); vmedia.read(from, end); vrandom_id.read(from, end); @@ -12034,7 +12036,7 @@ class MTPmessages_forwardMessages { // RPC method 'messages.forwardMessages' mtpTypeId type() const { return mtpc_messages_forwardMessages; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_forwardMessages) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_forwardMessages) { vpeer.read(from, end); vid.read(from, end); } @@ -12075,7 +12077,7 @@ class MTPmessages_getChats { // RPC method 'messages.getChats' mtpTypeId type() const { return mtpc_messages_getChats; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getChats) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getChats) { vid.read(from, end); } void write(mtpBuffer &to) const { @@ -12114,7 +12116,7 @@ class MTPmessages_getFullChat { // RPC method 'messages.getFullChat' mtpTypeId type() const { return mtpc_messages_getFullChat; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getFullChat) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getFullChat) { vchat_id.read(from, end); } void write(mtpBuffer &to) const { @@ -12154,7 +12156,7 @@ class MTPmessages_editChatTitle { // RPC method 'messages.editChatTitle' mtpTypeId type() const { return mtpc_messages_editChatTitle; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_editChatTitle) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editChatTitle) { vchat_id.read(from, end); vtitle.read(from, end); } @@ -12196,7 +12198,7 @@ class MTPmessages_editChatPhoto { // RPC method 'messages.editChatPhoto' mtpTypeId type() const { return mtpc_messages_editChatPhoto; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_editChatPhoto) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editChatPhoto) { vchat_id.read(from, end); vphoto.read(from, end); } @@ -12239,7 +12241,7 @@ class MTPmessages_addChatUser { // RPC method 'messages.addChatUser' mtpTypeId type() const { return mtpc_messages_addChatUser; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_addChatUser) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_addChatUser) { vchat_id.read(from, end); vuser_id.read(from, end); vfwd_limit.read(from, end); @@ -12283,7 +12285,7 @@ class MTPmessages_deleteChatUser { // RPC method 'messages.deleteChatUser' mtpTypeId type() const { return mtpc_messages_deleteChatUser; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_deleteChatUser) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_deleteChatUser) { vchat_id.read(from, end); vuser_id.read(from, end); } @@ -12325,7 +12327,7 @@ class MTPmessages_createChat { // RPC method 'messages.createChat' mtpTypeId type() const { return mtpc_messages_createChat; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_createChat) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_createChat) { vusers.read(from, end); vtitle.read(from, end); } @@ -12362,9 +12364,9 @@ class MTPupdates_getState { // RPC method 'updates.getState' mtpTypeId type() const { return mtpc_updates_getState; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_updates_getState) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getState) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPupdates_State ResponseType; @@ -12399,7 +12401,7 @@ class MTPupdates_getDifference { // RPC method 'updates.getDifference' mtpTypeId type() const { return mtpc_updates_getDifference; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_updates_getDifference) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_updates_getDifference) { vpts.read(from, end); vdate.read(from, end); vqts.read(from, end); @@ -12443,7 +12445,7 @@ class MTPphotos_updateProfilePhoto { // RPC method 'photos.updateProfilePhoto' mtpTypeId type() const { return mtpc_photos_updateProfilePhoto; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_photos_updateProfilePhoto) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_updateProfilePhoto) { vid.read(from, end); vcrop.read(from, end); } @@ -12487,7 +12489,7 @@ class MTPphotos_uploadProfilePhoto { // RPC method 'photos.uploadProfilePhoto' mtpTypeId type() const { return mtpc_photos_uploadProfilePhoto; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_photos_uploadProfilePhoto) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_uploadProfilePhoto) { vfile.read(from, end); vcaption.read(from, end); vgeo_point.read(from, end); @@ -12534,7 +12536,7 @@ class MTPupload_saveFilePart { // RPC method 'upload.saveFilePart' mtpTypeId type() const { return mtpc_upload_saveFilePart; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_upload_saveFilePart) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveFilePart) { vfile_id.read(from, end); vfile_part.read(from, end); vbytes.read(from, end); @@ -12579,7 +12581,7 @@ class MTPupload_getFile { // RPC method 'upload.getFile' mtpTypeId type() const { return mtpc_upload_getFile; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_upload_getFile) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_getFile) { vlocation.read(from, end); voffset.read(from, end); vlimit.read(from, end); @@ -12618,9 +12620,9 @@ class MTPhelp_getConfig { // RPC method 'help.getConfig' mtpTypeId type() const { return mtpc_help_getConfig; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_help_getConfig) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getConfig) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPConfig ResponseType; @@ -12649,9 +12651,9 @@ class MTPhelp_getNearestDc { // RPC method 'help.getNearestDc' mtpTypeId type() const { return mtpc_help_getNearestDc; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_help_getNearestDc) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getNearestDc) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPNearestDc ResponseType; @@ -12687,7 +12689,7 @@ class MTPhelp_getAppUpdate { // RPC method 'help.getAppUpdate' mtpTypeId type() const { return mtpc_help_getAppUpdate; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_help_getAppUpdate) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getAppUpdate) { vdevice_model.read(from, end); vsystem_version.read(from, end); vapp_version.read(from, end); @@ -12732,7 +12734,7 @@ class MTPhelp_saveAppLog { // RPC method 'help.saveAppLog' mtpTypeId type() const { return mtpc_help_saveAppLog; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_help_saveAppLog) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_saveAppLog) { vevents.read(from, end); } void write(mtpBuffer &to) const { @@ -12771,7 +12773,7 @@ class MTPhelp_getInviteText { // RPC method 'help.getInviteText' mtpTypeId type() const { return mtpc_help_getInviteText; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_help_getInviteText) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getInviteText) { vlang_code.read(from, end); } void write(mtpBuffer &to) const { @@ -12813,7 +12815,7 @@ class MTPphotos_getUserPhotos { // RPC method 'photos.getUserPhotos' mtpTypeId type() const { return mtpc_photos_getUserPhotos; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_photos_getUserPhotos) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_photos_getUserPhotos) { vuser_id.read(from, end); voffset.read(from, end); vmax_id.read(from, end); @@ -12860,7 +12862,7 @@ class MTPmessages_forwardMessage { // RPC method 'messages.forwardMessage' mtpTypeId type() const { return mtpc_messages_forwardMessage; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_forwardMessage) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_forwardMessage) { vpeer.read(from, end); vid.read(from, end); vrandom_id.read(from, end); @@ -12905,7 +12907,7 @@ class MTPmessages_sendBroadcast { // RPC method 'messages.sendBroadcast' mtpTypeId type() const { return mtpc_messages_sendBroadcast; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendBroadcast) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendBroadcast) { vcontacts.read(from, end); vmessage.read(from, end); vmedia.read(from, end); @@ -12950,7 +12952,7 @@ class MTPgeochats_getLocated { // RPC method 'geochats.getLocated' mtpTypeId type() const { return mtpc_geochats_getLocated; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_getLocated) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getLocated) { vgeo_point.read(from, end); vradius.read(from, end); vlimit.read(from, end); @@ -12994,7 +12996,7 @@ class MTPgeochats_getRecents { // RPC method 'geochats.getRecents' mtpTypeId type() const { return mtpc_geochats_getRecents; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_getRecents) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getRecents) { voffset.read(from, end); vlimit.read(from, end); } @@ -13035,7 +13037,7 @@ class MTPgeochats_checkin { // RPC method 'geochats.checkin' mtpTypeId type() const { return mtpc_geochats_checkin; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_checkin) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_checkin) { vpeer.read(from, end); } void write(mtpBuffer &to) const { @@ -13074,7 +13076,7 @@ class MTPgeochats_getFullChat { // RPC method 'geochats.getFullChat' mtpTypeId type() const { return mtpc_geochats_getFullChat; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_getFullChat) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getFullChat) { vpeer.read(from, end); } void write(mtpBuffer &to) const { @@ -13115,7 +13117,7 @@ class MTPgeochats_editChatTitle { // RPC method 'geochats.editChatTitle' mtpTypeId type() const { return mtpc_geochats_editChatTitle; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_editChatTitle) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatTitle) { vpeer.read(from, end); vtitle.read(from, end); vaddress.read(from, end); @@ -13159,7 +13161,7 @@ class MTPgeochats_editChatPhoto { // RPC method 'geochats.editChatPhoto' mtpTypeId type() const { return mtpc_geochats_editChatPhoto; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_editChatPhoto) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatPhoto) { vpeer.read(from, end); vphoto.read(from, end); } @@ -13207,7 +13209,7 @@ class MTPgeochats_search { // RPC method 'geochats.search' mtpTypeId type() const { return mtpc_geochats_search; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_search) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_search) { vpeer.read(from, end); vq.read(from, end); vfilter.read(from, end); @@ -13263,7 +13265,7 @@ class MTPgeochats_getHistory { // RPC method 'geochats.getHistory' mtpTypeId type() const { return mtpc_geochats_getHistory; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_getHistory) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getHistory) { vpeer.read(from, end); voffset.read(from, end); vmax_id.read(from, end); @@ -13309,7 +13311,7 @@ class MTPgeochats_setTyping { // RPC method 'geochats.setTyping' mtpTypeId type() const { return mtpc_geochats_setTyping; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_setTyping) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_setTyping) { vpeer.read(from, end); vtyping.read(from, end); } @@ -13352,7 +13354,7 @@ class MTPgeochats_sendMessage { // RPC method 'geochats.sendMessage' mtpTypeId type() const { return mtpc_geochats_sendMessage; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_sendMessage) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMessage) { vpeer.read(from, end); vmessage.read(from, end); vrandom_id.read(from, end); @@ -13397,7 +13399,7 @@ class MTPgeochats_sendMedia { // RPC method 'geochats.sendMedia' mtpTypeId type() const { return mtpc_geochats_sendMedia; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_sendMedia) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMedia) { vpeer.read(from, end); vmedia.read(from, end); vrandom_id.read(from, end); @@ -13443,7 +13445,7 @@ class MTPgeochats_createGeoChat { // RPC method 'geochats.createGeoChat' mtpTypeId type() const { return mtpc_geochats_createGeoChat; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_geochats_createGeoChat) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_createGeoChat) { vtitle.read(from, end); vgeo_point.read(from, end); vaddress.read(from, end); @@ -13489,7 +13491,7 @@ class MTPmessages_getDhConfig { // RPC method 'messages.getDhConfig' mtpTypeId type() const { return mtpc_messages_getDhConfig; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_getDhConfig) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getDhConfig) { vversion.read(from, end); vrandom_length.read(from, end); } @@ -13532,7 +13534,7 @@ class MTPmessages_requestEncryption { // RPC method 'messages.requestEncryption' mtpTypeId type() const { return mtpc_messages_requestEncryption; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_requestEncryption) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_requestEncryption) { vuser_id.read(from, end); vrandom_id.read(from, end); vg_a.read(from, end); @@ -13577,7 +13579,7 @@ class MTPmessages_acceptEncryption { // RPC method 'messages.acceptEncryption' mtpTypeId type() const { return mtpc_messages_acceptEncryption; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_acceptEncryption) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_acceptEncryption) { vpeer.read(from, end); vg_b.read(from, end); vkey_fingerprint.read(from, end); @@ -13620,7 +13622,7 @@ class MTPmessages_discardEncryption { // RPC method 'messages.discardEncryption' mtpTypeId type() const { return mtpc_messages_discardEncryption; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_discardEncryption) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_discardEncryption) { vchat_id.read(from, end); } void write(mtpBuffer &to) const { @@ -13660,7 +13662,7 @@ class MTPmessages_setEncryptedTyping { // RPC method 'messages.setEncryptedTypin mtpTypeId type() const { return mtpc_messages_setEncryptedTyping; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_setEncryptedTyping) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_setEncryptedTyping) { vpeer.read(from, end); vtyping.read(from, end); } @@ -13702,7 +13704,7 @@ class MTPmessages_readEncryptedHistory { // RPC method 'messages.readEncryptedHi mtpTypeId type() const { return mtpc_messages_readEncryptedHistory; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_readEncryptedHistory) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_readEncryptedHistory) { vpeer.read(from, end); vmax_date.read(from, end); } @@ -13745,7 +13747,7 @@ class MTPmessages_sendEncrypted { // RPC method 'messages.sendEncrypted' mtpTypeId type() const { return mtpc_messages_sendEncrypted; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendEncrypted) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendEncrypted) { vpeer.read(from, end); vrandom_id.read(from, end); vdata.read(from, end); @@ -13791,7 +13793,7 @@ class MTPmessages_sendEncryptedFile { // RPC method 'messages.sendEncryptedFile' mtpTypeId type() const { return mtpc_messages_sendEncryptedFile; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendEncryptedFile) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendEncryptedFile) { vpeer.read(from, end); vrandom_id.read(from, end); vdata.read(from, end); @@ -13838,7 +13840,7 @@ class MTPmessages_sendEncryptedService { // RPC method 'messages.sendEncryptedSe mtpTypeId type() const { return mtpc_messages_sendEncryptedService; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_sendEncryptedService) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendEncryptedService) { vpeer.read(from, end); vrandom_id.read(from, end); vdata.read(from, end); @@ -13881,7 +13883,7 @@ class MTPmessages_receivedQueue { // RPC method 'messages.receivedQueue' mtpTypeId type() const { return mtpc_messages_receivedQueue; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_messages_receivedQueue) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_receivedQueue) { vmax_qts.read(from, end); } void write(mtpBuffer &to) const { @@ -13923,7 +13925,7 @@ class MTPupload_saveBigFilePart { // RPC method 'upload.saveBigFilePart' mtpTypeId type() const { return mtpc_upload_saveBigFilePart; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_upload_saveBigFilePart) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_upload_saveBigFilePart) { vfile_id.read(from, end); vfile_part.read(from, end); vfile_total_parts.read(from, end); @@ -13974,7 +13976,7 @@ class MTPinitConnection { // RPC method 'initConnection' mtpTypeId type() const { return mtpc_initConnection; } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId /*cons*/ = mtpc_initConnection) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_initConnection) { vapi_id.read(from, end); vdevice_model.read(from, end); vsystem_version.read(from, end); @@ -14018,9 +14020,9 @@ class MTPhelp_getSupport { // RPC method 'help.getSupport' mtpTypeId type() const { return mtpc_help_getSupport; } - void read(const mtpPrime *&/*from*/, const mtpPrime */*end*/, mtpTypeId /*cons*/ = mtpc_help_getSupport) { + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_help_getSupport) { } - void write(mtpBuffer &/*to*/) const { + void write(mtpBuffer &to) const { } typedef MTPhelp_Support ResponseType; @@ -16027,7 +16029,7 @@ inline void MTPstorage_fileType::read(const mtpPrime *&from, const mtpPrime *end default: throw mtpErrorUnexpected(cons, "MTPstorage_fileType"); } } -inline void MTPstorage_fileType::write(mtpBuffer &/*to*/) const { +inline void MTPstorage_fileType::write(mtpBuffer &to) const { switch (_type) { } } @@ -17807,7 +17809,7 @@ inline void MTPinputPeerNotifyEvents::read(const mtpPrime *&from, const mtpPrime default: throw mtpErrorUnexpected(cons, "MTPinputPeerNotifyEvents"); } } -inline void MTPinputPeerNotifyEvents::write(mtpBuffer &/*to*/) const { +inline void MTPinputPeerNotifyEvents::write(mtpBuffer &to) const { switch (_type) { } } @@ -17872,7 +17874,7 @@ inline void MTPpeerNotifyEvents::read(const mtpPrime *&from, const mtpPrime *end default: throw mtpErrorUnexpected(cons, "MTPpeerNotifyEvents"); } } -inline void MTPpeerNotifyEvents::write(mtpBuffer &/*to*/) const { +inline void MTPpeerNotifyEvents::write(mtpBuffer &to) const { switch (_type) { } } @@ -19184,10 +19186,11 @@ inline void MTPmessagesFilter::read(const mtpPrime *&from, const mtpPrime *end, case mtpc_inputMessagesFilterVideo: _type = cons; break; case mtpc_inputMessagesFilterPhotoVideo: _type = cons; break; case mtpc_inputMessagesFilterDocument: _type = cons; break; + case mtpc_inputMessagesFilterAudio: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPmessagesFilter"); } } -inline void MTPmessagesFilter::write(mtpBuffer &/*to*/) const { +inline void MTPmessagesFilter::write(mtpBuffer &to) const { switch (_type) { } } @@ -19198,6 +19201,7 @@ inline MTPmessagesFilter::MTPmessagesFilter(mtpTypeId type) : _type(type) { case mtpc_inputMessagesFilterVideo: break; case mtpc_inputMessagesFilterPhotoVideo: break; case mtpc_inputMessagesFilterDocument: break; + case mtpc_inputMessagesFilterAudio: break; default: throw mtpErrorBadTypeId(type, "MTPmessagesFilter"); } } @@ -19216,6 +19220,9 @@ inline MTPmessagesFilter MTP_inputMessagesFilterPhotoVideo() { inline MTPmessagesFilter MTP_inputMessagesFilterDocument() { return MTPmessagesFilter(mtpc_inputMessagesFilterDocument); } +inline MTPmessagesFilter MTP_inputMessagesFilterAudio() { + return MTPmessagesFilter(mtpc_inputMessagesFilterAudio); +} inline uint32 MTPupdate::size() const { switch (_type) { @@ -22007,23 +22014,6 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP QString result; switch (mtpTypeId(cons)) { - case mtpc_userProfilePhotoEmpty: - result = " "; - return "{ userProfilePhotoEmpty" + result + "}"; - - case mtpc_userProfilePhoto: - result += "\n" + add; - result += " photo_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " photo_small: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " photo_big: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ userProfilePhoto" + result + "}"; - - case mtpc_rpc_error: - result += "\n" + add; - result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " error_message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ rpc_error" + result + "}"; - case mtpc_dh_gen_ok: result += "\n" + add; result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; @@ -22045,310 +22035,165 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " new_nonce_hash3: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; return "{ dh_gen_fail" + result + "}"; - case mtpc_inputPeerEmpty: - result = " "; - return "{ inputPeerEmpty" + result + "}"; - - case mtpc_inputPeerSelf: - result = " "; - return "{ inputPeerSelf" + result + "}"; - - case mtpc_inputPeerContact: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputPeerContact" + result + "}"; - - case mtpc_inputPeerForeign: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputPeerForeign" + result + "}"; - - case mtpc_inputPeerChat: + case mtpc_help_support: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputPeerChat" + result + "}"; + result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ help_support" + result + "}"; - case mtpc_photoEmpty: + case mtpc_audioEmpty: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ photoEmpty" + result + "}"; + return "{ audioEmpty" + result + "}"; - case mtpc_photo: + case mtpc_audio: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " geo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " sizes: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photo" + result + "}"; + result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ audio" + result + "}"; - case mtpc_p_q_inner_data: + case mtpc_auth_sentCode: result += "\n" + add; - result += " pq: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " p: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " new_nonce: " + mtpTextSerialize(from, end, mtpc_int256, level + 1) + ",\n" + add; - return "{ p_q_inner_data" + result + "}"; + result += " phone_registered: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " phone_code_hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " send_call_timeout: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " is_password: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ auth_sentCode" + result + "}"; - case mtpc_client_DH_inner_data: + case mtpc_future_salts: result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " retry_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " g_b: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ client_DH_inner_data" + result + "}"; + result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " now: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " salts: " + mtpTextSerialize(from, end, mtpc_vector, level + 1, mtpc_future_salt) + ",\n" + add; + return "{ future_salts" + result + "}"; - case mtpc_contacts_link: + case mtpc_contactSuggested: result += "\n" + add; - result += " my_link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " foreign_link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_link" + result + "}"; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " mutual_contacts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contactSuggested" + result + "}"; - case mtpc_inputPhotoCropAuto: - result = " "; - return "{ inputPhotoCropAuto" + result + "}"; + case mtpc_inputFileLocation: + result += "\n" + add; + result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputFileLocation" + result + "}"; - case mtpc_inputPhotoCrop: + case mtpc_inputVideoFileLocation: result += "\n" + add; - result += " crop_left: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " crop_top: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " crop_width: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - return "{ inputPhotoCrop" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputVideoFileLocation" + result + "}"; - case mtpc_inputFile: + case mtpc_inputEncryptedFileLocation: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " md5_checksum: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ inputFile" + result + "}"; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputEncryptedFileLocation" + result + "}"; - case mtpc_inputFileBig: + case mtpc_inputAudioFileLocation: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ inputFileBig" + result + "}"; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputAudioFileLocation" + result + "}"; - case mtpc_messageActionEmpty: - result = " "; - return "{ messageActionEmpty" + result + "}"; + case mtpc_inputDocumentFileLocation: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputDocumentFileLocation" + result + "}"; - case mtpc_messageActionChatCreate: + case mtpc_future_salt: result += "\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messageActionChatCreate" + result + "}"; + result += " valid_since: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " valid_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ future_salt" + result + "}"; - case mtpc_messageActionChatEditTitle: + case mtpc_messages_dhConfigNotModified: result += "\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ messageActionChatEditTitle" + result + "}"; + result += " random: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messages_dhConfigNotModified" + result + "}"; - case mtpc_messageActionChatEditPhoto: + case mtpc_messages_dhConfig: result += "\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageActionChatEditPhoto" + result + "}"; + result += " g: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " p: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " random: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messages_dhConfig" + result + "}"; - case mtpc_messageActionChatDeletePhoto: + case mtpc_inputChatPhotoEmpty: result = " "; - return "{ messageActionChatDeletePhoto" + result + "}"; + return "{ inputChatPhotoEmpty" + result + "}"; - case mtpc_messageActionChatAddUser: + case mtpc_inputChatUploadedPhoto: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messageActionChatAddUser" + result + "}"; + result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ inputChatUploadedPhoto" + result + "}"; - case mtpc_messageActionChatDeleteUser: + case mtpc_inputChatPhoto: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messageActionChatDeleteUser" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ inputChatPhoto" + result + "}"; - case mtpc_messageActionGeoChatCreate: + case mtpc_upload_file: result += "\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ messageActionGeoChatCreate" + result + "}"; - - case mtpc_messageActionGeoChatCheckin: - result = " "; - return "{ messageActionGeoChatCheckin" + result + "}"; - - case mtpc_inputMessagesFilterEmpty: - result = " "; - return "{ inputMessagesFilterEmpty" + result + "}"; - - case mtpc_inputMessagesFilterPhotos: - result = " "; - return "{ inputMessagesFilterPhotos" + result + "}"; + result += " type: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " mtime: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ upload_file" + result + "}"; - case mtpc_inputMessagesFilterVideo: - result = " "; - return "{ inputMessagesFilterVideo" + result + "}"; + case mtpc_photos_photo: + result += "\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ photos_photo" + result + "}"; - case mtpc_inputMessagesFilterPhotoVideo: + case mtpc_inputPeerNotifyEventsEmpty: result = " "; - return "{ inputMessagesFilterPhotoVideo" + result + "}"; + return "{ inputPeerNotifyEventsEmpty" + result + "}"; - case mtpc_inputMessagesFilterDocument: + case mtpc_inputPeerNotifyEventsAll: result = " "; - return "{ inputMessagesFilterDocument" + result + "}"; + return "{ inputPeerNotifyEventsAll" + result + "}"; - case mtpc_help_support: + case mtpc_inputAppEvent: result += "\n" + add; - result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ help_support" + result + "}"; + result += " time: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " peer: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ inputAppEvent" + result + "}"; - case mtpc_contactFound: + case mtpc_updates_state: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contactFound" + result + "}"; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " unread_count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updates_state" + result + "}"; - case mtpc_future_salts: + case mtpc_msgs_state_req: result += "\n" + add; - result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " now: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " salts: " + mtpTextSerialize(from, end, mtpc_vector, level + 1, mtpc_future_salt) + ",\n" + add; - return "{ future_salts" + result + "}"; + result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + return "{ msgs_state_req" + result + "}"; - case mtpc_inputPhotoEmpty: + case mtpc_inputMediaEmpty: result = " "; - return "{ inputPhotoEmpty" + result + "}"; + return "{ inputMediaEmpty" + result + "}"; - case mtpc_inputPhoto: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputPhoto" + result + "}"; - - case mtpc_chatParticipant: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " inviter_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ chatParticipant" + result + "}"; - - case mtpc_auth_exportedAuthorization: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ auth_exportedAuthorization" + result + "}"; - - case mtpc_contactStatus: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contactStatus" + result + "}"; - - case mtpc_new_session_created: - result += "\n" + add; - result += " first_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " unique_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " server_salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ new_session_created" + result + "}"; - - case mtpc_geochats_located: - result += "\n" + add; - result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_located" + result + "}"; - - case mtpc_updatesTooLong: - result = " "; - return "{ updatesTooLong" + result + "}"; - - case mtpc_updateShortMessage: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updateShortMessage" + result + "}"; - - case mtpc_updateShortChatMessage: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updateShortChatMessage" + result + "}"; - - case mtpc_updateShort: - result += "\n" + add; - result += " update: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updateShort" + result + "}"; - - case mtpc_updatesCombined: - result += "\n" + add; - result += " updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq_start: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updatesCombined" + result + "}"; - - case mtpc_updates: - result += "\n" + add; - result += " updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updates" + result + "}"; - - case mtpc_future_salt: - result += "\n" + add; - result += " valid_since: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " valid_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ future_salt" + result + "}"; - - case mtpc_server_DH_inner_data: - result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " g: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " dh_prime: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " g_a: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " server_time: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ server_DH_inner_data" + result + "}"; - - case mtpc_resPQ: - result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " pq: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " server_public_key_fingerprints: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ resPQ" + result + "}"; - - case mtpc_upload_file: - result += "\n" + add; - result += " type: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " mtime: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ upload_file" + result + "}"; - - case mtpc_inputMediaEmpty: - result = " "; - return "{ inputMediaEmpty" + result + "}"; - - case mtpc_inputMediaUploadedPhoto: + case mtpc_inputMediaUploadedPhoto: result += "\n" + add; result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; return "{ inputMediaUploadedPhoto" + result + "}"; @@ -22426,213 +22271,316 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; return "{ inputMediaDocument" + result + "}"; - case mtpc_documentEmpty: + case mtpc_userProfilePhotoEmpty: + result = " "; + return "{ userProfilePhotoEmpty" + result + "}"; + + case mtpc_userProfilePhoto: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ documentEmpty" + result + "}"; + result += " photo_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " photo_small: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " photo_big: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ userProfilePhoto" + result + "}"; - case mtpc_document: + case mtpc_decryptedMessageLayer: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " file_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " thumb: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ document" + result + "}"; + result += " layer: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ decryptedMessageLayer" + result + "}"; - case mtpc_inputEncryptedFileEmpty: + case mtpc_contacts_foreignLinkUnknown: result = " "; - return "{ inputEncryptedFileEmpty" + result + "}"; + return "{ contacts_foreignLinkUnknown" + result + "}"; - case mtpc_inputEncryptedFileUploaded: + case mtpc_contacts_foreignLinkRequested: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " md5_checksum: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputEncryptedFileUploaded" + result + "}"; + result += " has_phone: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_foreignLinkRequested" + result + "}"; - case mtpc_inputEncryptedFile: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputEncryptedFile" + result + "}"; + case mtpc_contacts_foreignLinkMutual: + result = " "; + return "{ contacts_foreignLinkMutual" + result + "}"; - case mtpc_inputEncryptedFileBigUploaded: + case mtpc_chatLocated: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputEncryptedFileBigUploaded" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " distance: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ chatLocated" + result + "}"; - case mtpc_contacts_found: + case mtpc_dcOption: result += "\n" + add; - result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_found" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " hostname: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " ip_address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " port: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ dcOption" + result + "}"; - case mtpc_inputFileLocation: + case mtpc_geoPointEmpty: + result = " "; + return "{ geoPointEmpty" + result + "}"; + + case mtpc_geoPoint: result += "\n" + add; - result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputFileLocation" + result + "}"; + result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + return "{ geoPoint" + result + "}"; - case mtpc_inputVideoFileLocation: + case mtpc_contacts_myLinkEmpty: + result = " "; + return "{ contacts_myLinkEmpty" + result + "}"; + + case mtpc_contacts_myLinkRequested: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputVideoFileLocation" + result + "}"; + result += " contact: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_myLinkRequested" + result + "}"; - case mtpc_inputEncryptedFileLocation: + case mtpc_contacts_myLinkContact: + result = " "; + return "{ contacts_myLinkContact" + result + "}"; + + case mtpc_inputNotifyPeer: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputEncryptedFileLocation" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ inputNotifyPeer" + result + "}"; - case mtpc_inputAudioFileLocation: + case mtpc_inputNotifyUsers: + result = " "; + return "{ inputNotifyUsers" + result + "}"; + + case mtpc_inputNotifyChats: + result = " "; + return "{ inputNotifyChats" + result + "}"; + + case mtpc_inputNotifyAll: + result = " "; + return "{ inputNotifyAll" + result + "}"; + + case mtpc_inputNotifyGeoChatPeer: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputAudioFileLocation" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ inputNotifyGeoChatPeer" + result + "}"; - case mtpc_inputDocumentFileLocation: + case mtpc_userEmpty: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputDocumentFileLocation" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ userEmpty" + result + "}"; - case mtpc_chatFull: + case mtpc_userSelf: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " participants: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chat_photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ chatFull" + result + "}"; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " inactive: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ userSelf" + result + "}"; - case mtpc_chatParticipantsForbidden: + case mtpc_userContact: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ chatParticipantsForbidden" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ userContact" + result + "}"; - case mtpc_chatParticipants: + case mtpc_userRequest: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " participants: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ chatParticipants" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ userRequest" + result + "}"; - case mtpc_msgs_ack: + case mtpc_userForeign: result += "\n" + add; - result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ msgs_ack" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ userForeign" + result + "}"; - case mtpc_userFull: + case mtpc_userDeleted: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ userDeleted" + result + "}"; + + case mtpc_messages_sentMessage: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_sentMessage" + result + "}"; + + case mtpc_messages_sentMessageLink: result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_sentMessageLink" + result + "}"; + + case mtpc_msgs_state_info: + result += "\n" + add; + result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " info: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ msgs_state_info" + result + "}"; + + case mtpc_auth_authorization: + result += "\n" + add; + result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " profile_photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " real_first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " real_last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ userFull" + result + "}"; + return "{ auth_authorization" + result + "}"; - case mtpc_videoEmpty: + case mtpc_contactStatus: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contactStatus" + result + "}"; + + case mtpc_config: + result += "\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " test_mode: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " this_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " dc_options: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chat_size_max: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " broadcast_size_max: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ config" + result + "}"; + + case mtpc_msg_resend_req: + result += "\n" + add; + result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + return "{ msg_resend_req" + result + "}"; + + case mtpc_documentEmpty: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ videoEmpty" + result + "}"; + return "{ documentEmpty" + result + "}"; - case mtpc_video: + case mtpc_document: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " file_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " thumb: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ video" + result + "}"; - - case mtpc_messageEmpty: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messageEmpty" + result + "}"; + return "{ document" + result + "}"; - case mtpc_message: + case mtpc_messages_statedMessages: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ message" + result + "}"; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_statedMessages" + result + "}"; - case mtpc_messageForwarded: + case mtpc_messages_statedMessagesLinks: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " fwd_from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " fwd_date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageForwarded" + result + "}"; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_statedMessagesLinks" + result + "}"; - case mtpc_messageService: + case mtpc_messages_messages: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageService" + result + "}"; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_messages" + result + "}"; - case mtpc_notifyPeer: + case mtpc_messages_messagesSlice: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ notifyPeer" + result + "}"; + result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_messagesSlice" + result + "}"; - case mtpc_notifyUsers: + case mtpc_chatPhotoEmpty: result = " "; - return "{ notifyUsers" + result + "}"; + return "{ chatPhotoEmpty" + result + "}"; - case mtpc_notifyChats: - result = " "; - return "{ notifyChats" + result + "}"; + case mtpc_chatPhoto: + result += "\n" + add; + result += " photo_small: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " photo_big: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ chatPhoto" + result + "}"; - case mtpc_notifyAll: - result = " "; - return "{ notifyAll" + result + "}"; + case mtpc_messages_chat: + result += "\n" + add; + result += " chat: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_chat" + result + "}"; - case mtpc_messages_messageEmpty: - result = " "; - return "{ messages_messageEmpty" + result + "}"; + case mtpc_updates_differenceEmpty: + result += "\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updates_differenceEmpty" + result + "}"; - case mtpc_messages_message: + case mtpc_updates_difference: result += "\n" + add; - result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " new_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " new_encrypted_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " other_updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_message" + result + "}"; + result += " state: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ updates_difference" + result + "}"; + + case mtpc_updates_differenceSlice: + result += "\n" + add; + result += " new_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " new_encrypted_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " other_updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " intermediate_state: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ updates_differenceSlice" + result + "}"; + + case mtpc_p_q_inner_data: + result += "\n" + add; + result += " pq: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " p: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " new_nonce: " + mtpTextSerialize(from, end, mtpc_int256, level + 1) + ",\n" + add; + return "{ p_q_inner_data" + result + "}"; + + case mtpc_auth_exportedAuthorization: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ auth_exportedAuthorization" + result + "}"; + + case mtpc_contacts_link: + result += "\n" + add; + result += " my_link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " foreign_link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_link" + result + "}"; case mtpc_inputPhoneContact: result += "\n" + add; @@ -22642,257 +22590,230 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; return "{ inputPhoneContact" + result + "}"; - case mtpc_rpc_answer_unknown: - result = " "; - return "{ rpc_answer_unknown" + result + "}"; - - case mtpc_rpc_answer_dropped_running: - result = " "; - return "{ rpc_answer_dropped_running" + result + "}"; - - case mtpc_rpc_answer_dropped: - result += "\n" + add; - result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " seq_no: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ rpc_answer_dropped" + result + "}"; - - case mtpc_inputVideoEmpty: - result = " "; - return "{ inputVideoEmpty" + result + "}"; - - case mtpc_inputVideo: + case mtpc_decryptedMessage: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputVideo" + result + "}"; - - case mtpc_decryptedMessageMediaEmpty: - result = " "; - return "{ decryptedMessageMediaEmpty" + result + "}"; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " random_bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ decryptedMessage" + result + "}"; - case mtpc_decryptedMessageMediaPhoto: + case mtpc_decryptedMessageService: result += "\n" + add; - result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaPhoto" + result + "}"; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " random_bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ decryptedMessageService" + result + "}"; - case mtpc_decryptedMessageMediaVideo: + case mtpc_http_wait: result += "\n" + add; - result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaVideo" + result + "}"; + result += " max_delay: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " wait_after: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " max_wait: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ http_wait" + result + "}"; - case mtpc_decryptedMessageMediaGeoPoint: + case mtpc_destroy_session_ok: result += "\n" + add; - result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaGeoPoint" + result + "}"; + result += " session_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ destroy_session_ok" + result + "}"; - case mtpc_decryptedMessageMediaContact: + case mtpc_destroy_session_none: result += "\n" + add; - result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaContact" + result + "}"; + result += " session_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ destroy_session_none" + result + "}"; - case mtpc_decryptedMessageMediaDocument: + case mtpc_inputFile: result += "\n" + add; - result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " file_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaDocument" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " md5_checksum: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ inputFile" + result + "}"; - case mtpc_decryptedMessageMediaAudio: + case mtpc_inputFileBig: result += "\n" + add; - result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ decryptedMessageMediaAudio" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ inputFileBig" + result + "}"; - case mtpc_geoChatMessageEmpty: + case mtpc_msgs_all_info: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geoChatMessageEmpty" + result + "}"; + result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + result += " info: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ msgs_all_info" + result + "}"; - case mtpc_geoChatMessage: + case mtpc_help_inviteText: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geoChatMessage" + result + "}"; + return "{ help_inviteText" + result + "}"; - case mtpc_geoChatMessageService: + case mtpc_peerUser: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ peerUser" + result + "}"; + + case mtpc_peerChat: result += "\n" + add; result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geoChatMessageService" + result + "}"; + return "{ peerChat" + result + "}"; - case mtpc_geoPointEmpty: - result = " "; - return "{ geoPointEmpty" + result + "}"; + case mtpc_contacts_blocked: + result += "\n" + add; + result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_blocked" + result + "}"; - case mtpc_geoPoint: + case mtpc_contacts_blockedSlice: result += "\n" + add; - result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - return "{ geoPoint" + result + "}"; + result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_blockedSlice" + result + "}"; - case mtpc_messages_dialogs: + case mtpc_geochats_messages: result += "\n" + add; - result += " dialogs: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_dialogs" + result + "}"; + return "{ geochats_messages" + result + "}"; - case mtpc_messages_dialogsSlice: + case mtpc_geochats_messagesSlice: result += "\n" + add; result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " dialogs: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_dialogsSlice" + result + "}"; + return "{ geochats_messagesSlice" + result + "}"; - case mtpc_messages_dhConfigNotModified: - result += "\n" + add; - result += " random: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messages_dhConfigNotModified" + result + "}"; + case mtpc_inputGeoPointEmpty: + result = " "; + return "{ inputGeoPointEmpty" + result + "}"; - case mtpc_messages_dhConfig: + case mtpc_inputGeoPoint: result += "\n" + add; - result += " g: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " p: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " random: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messages_dhConfig" + result + "}"; + result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + return "{ inputGeoPoint" + result + "}"; - case mtpc_peerUser: + case mtpc_contactFound: result += "\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ peerUser" + result + "}"; + return "{ contactFound" + result + "}"; - case mtpc_peerChat: + case mtpc_encryptedMessage: result += "\n" + add; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ peerChat" + result + "}"; - - case mtpc_server_DH_params_fail: - result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " new_nonce_hash: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - return "{ server_DH_params_fail" + result + "}"; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ encryptedMessage" + result + "}"; - case mtpc_server_DH_params_ok: + case mtpc_encryptedMessageService: result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " encrypted_answer: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ server_DH_params_ok" + result + "}"; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ encryptedMessageService" + result + "}"; - case mtpc_inputAppEvent: + case mtpc_photos_photos: result += "\n" + add; - result += " time: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " peer: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ inputAppEvent" + result + "}"; + result += " photos: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ photos_photos" + result + "}"; - case mtpc_photos_photo: + case mtpc_photos_photosSlice: result += "\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " photos: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photos_photo" + result + "}"; + return "{ photos_photosSlice" + result + "}"; - case mtpc_peerNotifyEventsEmpty: - result = " "; - return "{ peerNotifyEventsEmpty" + result + "}"; + case mtpc_dialog: + result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " top_message: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " unread_count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ dialog" + result + "}"; - case mtpc_peerNotifyEventsAll: + case mtpc_updatesTooLong: result = " "; - return "{ peerNotifyEventsAll" + result + "}"; + return "{ updatesTooLong" + result + "}"; - case mtpc_nearestDc: + case mtpc_updateShortMessage: result += "\n" + add; - result += " country: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " this_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " nearest_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ nearestDc" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updateShortMessage" + result + "}"; - case mtpc_wallPaper: + case mtpc_updateShortChatMessage: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " sizes: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ wallPaper" + result + "}"; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updateShortChatMessage" + result + "}"; - case mtpc_wallPaperSolid: + case mtpc_updateShort: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " bg_color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ wallPaperSolid" + result + "}"; + result += " update: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updateShort" + result + "}"; - case mtpc_geochats_messages: + case mtpc_updatesCombined: result += "\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_messages" + result + "}"; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq_start: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updatesCombined" + result + "}"; - case mtpc_geochats_messagesSlice: + case mtpc_updates: result += "\n" + add; - result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_messagesSlice" + result + "}"; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updates" + result + "}"; - case mtpc_contacts_blocked: + case mtpc_contacts_importedContacts: result += "\n" + add; - result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " imported: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " retry_contacts: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_blocked" + result + "}"; + return "{ contacts_importedContacts" + result + "}"; - case mtpc_contacts_blockedSlice: + case mtpc_resPQ: result += "\n" + add; - result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_blockedSlice" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " pq: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " server_public_key_fingerprints: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + return "{ resPQ" + result + "}"; + + case mtpc_inputPhotoCropAuto: + result = " "; + return "{ inputPhotoCropAuto" + result + "}"; + + case mtpc_inputPhotoCrop: + result += "\n" + add; + result += " crop_left: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " crop_top: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " crop_width: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + return "{ inputPhotoCrop" + result + "}"; case mtpc_messages_statedMessage: result += "\n" + add; @@ -22903,191 +22824,307 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; return "{ messages_statedMessage" + result + "}"; - case mtpc_messages_statedMessageLink: + case mtpc_messages_statedMessageLink: + result += "\n" + add; + result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_statedMessageLink" + result + "}"; + + case mtpc_messageEmpty: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messageEmpty" + result + "}"; + + case mtpc_message: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ message" + result + "}"; + + case mtpc_messageForwarded: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " fwd_from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " fwd_date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageForwarded" + result + "}"; + + case mtpc_messageService: result += "\n" + add; - result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_statedMessageLink" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " to_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " out: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " unread: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageService" + result + "}"; - case mtpc_messageMediaEmpty: + case mtpc_new_session_created: + result += "\n" + add; + result += " first_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " unique_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " server_salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ new_session_created" + result + "}"; + + case mtpc_decryptedMessageMediaEmpty: result = " "; - return "{ messageMediaEmpty" + result + "}"; + return "{ decryptedMessageMediaEmpty" + result + "}"; - case mtpc_messageMediaPhoto: + case mtpc_decryptedMessageMediaPhoto: result += "\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageMediaPhoto" + result + "}"; + result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ decryptedMessageMediaPhoto" + result + "}"; - case mtpc_messageMediaVideo: + case mtpc_decryptedMessageMediaVideo: result += "\n" + add; - result += " video: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageMediaVideo" + result + "}"; + result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ decryptedMessageMediaVideo" + result + "}"; - case mtpc_messageMediaGeo: + case mtpc_decryptedMessageMediaGeoPoint: result += "\n" + add; - result += " geo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageMediaGeo" + result + "}"; + result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; + return "{ decryptedMessageMediaGeoPoint" + result + "}"; - case mtpc_messageMediaContact: + case mtpc_decryptedMessageMediaContact: result += "\n" + add; result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messageMediaContact" + result + "}"; + return "{ decryptedMessageMediaContact" + result + "}"; - case mtpc_messageMediaUnsupported: + case mtpc_decryptedMessageMediaDocument: result += "\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messageMediaUnsupported" + result + "}"; + result += " thumb: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " thumb_w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " thumb_h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " file_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ decryptedMessageMediaDocument" + result + "}"; - case mtpc_messageMediaDocument: + case mtpc_decryptedMessageMediaAudio: result += "\n" + add; - result += " document: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageMediaDocument" + result + "}"; + result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " iv: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ decryptedMessageMediaAudio" + result + "}"; - case mtpc_messageMediaAudio: + case mtpc_inputEncryptedFileEmpty: + result = " "; + return "{ inputEncryptedFileEmpty" + result + "}"; + + case mtpc_inputEncryptedFileUploaded: result += "\n" + add; - result += " audio: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messageMediaAudio" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " md5_checksum: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputEncryptedFileUploaded" + result + "}"; - case mtpc_inputGeoChat: + case mtpc_inputEncryptedFile: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputGeoChat" + result + "}"; + return "{ inputEncryptedFile" + result + "}"; - case mtpc_help_appUpdate: + case mtpc_inputEncryptedFileBigUploaded: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " critical: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " url: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " text: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ help_appUpdate" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " parts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputEncryptedFileBigUploaded" + result + "}"; - case mtpc_help_noAppUpdate: - result = " "; - return "{ help_noAppUpdate" + result + "}"; + case mtpc_fileLocationUnavailable: + result += "\n" + add; + result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ fileLocationUnavailable" + result + "}"; - case mtpc_updates_differenceEmpty: + case mtpc_fileLocation: result += "\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updates_differenceEmpty" + result + "}"; + result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ fileLocation" + result + "}"; - case mtpc_updates_difference: + case mtpc_geoChatMessageEmpty: result += "\n" + add; - result += " new_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " new_encrypted_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " other_updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " state: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ updates_difference" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ geoChatMessageEmpty" + result + "}"; - case mtpc_updates_differenceSlice: + case mtpc_geoChatMessage: result += "\n" + add; - result += " new_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " new_encrypted_messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " other_updates: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " intermediate_state: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ updates_differenceSlice" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ geoChatMessage" + result + "}"; - case mtpc_msgs_state_info: + case mtpc_geoChatMessageService: result += "\n" + add; - result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " info: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ msgs_state_info" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " from_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ geoChatMessageService" + result + "}"; - case mtpc_msgs_state_req: + case mtpc_rpc_error: result += "\n" + add; - result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ msgs_state_req" + result + "}"; + result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " error_message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ rpc_error" + result + "}"; - case mtpc_msg_resend_req: + case mtpc_msgs_ack: result += "\n" + add; result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ msg_resend_req" + result + "}"; + return "{ msgs_ack" + result + "}"; - case mtpc_inputDocumentEmpty: - result = " "; - return "{ inputDocumentEmpty" + result + "}"; + case mtpc_encryptedChatEmpty: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ encryptedChatEmpty" + result + "}"; - case mtpc_inputDocument: + case mtpc_encryptedChatWaiting: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputDocument" + result + "}"; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ encryptedChatWaiting" + result + "}"; - case mtpc_userStatusEmpty: - result = " "; - return "{ userStatusEmpty" + result + "}"; + case mtpc_encryptedChatRequested: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " g_a: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ encryptedChatRequested" + result + "}"; - case mtpc_userStatusOnline: + case mtpc_encryptedChat: result += "\n" + add; - result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ userStatusOnline" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " g_a_or_b: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ encryptedChat" + result + "}"; - case mtpc_userStatusOffline: + case mtpc_encryptedChatDiscarded: result += "\n" + add; - result += " was_online: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ userStatusOffline" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ encryptedChatDiscarded" + result + "}"; + + case mtpc_help_appUpdate: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " critical: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " url: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " text: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ help_appUpdate" + result + "}"; + + case mtpc_help_noAppUpdate: + result = " "; + return "{ help_noAppUpdate" + result + "}"; + + case mtpc_chatFull: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " participants: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chat_photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ chatFull" + result + "}"; - case mtpc_photos_photos: - result += "\n" + add; - result += " photos: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photos_photos" + result + "}"; + case mtpc_inputUserEmpty: + result = " "; + return "{ inputUserEmpty" + result + "}"; - case mtpc_photos_photosSlice: - result += "\n" + add; - result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " photos: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photos_photosSlice" + result + "}"; + case mtpc_inputUserSelf: + result = " "; + return "{ inputUserSelf" + result + "}"; - case mtpc_decryptedMessage: + case mtpc_inputUserContact: result += "\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " random_bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ decryptedMessage" + result + "}"; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputUserContact" + result + "}"; - case mtpc_decryptedMessageService: + case mtpc_inputUserForeign: result += "\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " random_bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " action: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ decryptedMessageService" + result + "}"; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputUserForeign" + result + "}"; - case mtpc_contacts_importedContacts: + case mtpc_nearestDc: result += "\n" + add; - result += " imported: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " retry_contacts: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_importedContacts" + result + "}"; + result += " country: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " this_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " nearest_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ nearestDc" + result + "}"; - case mtpc_fileLocationUnavailable: + case mtpc_photoEmpty: result += "\n" + add; - result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ fileLocationUnavailable" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ photoEmpty" + result + "}"; - case mtpc_fileLocation: + case mtpc_photo: result += "\n" + add; - result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " volume_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " local_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " secret: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ fileLocation" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " geo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " sizes: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ photo" + result + "}"; case mtpc_photoSizeEmpty: result += "\n" + add; @@ -23112,54 +23149,6 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; return "{ photoCachedSize" + result + "}"; - case mtpc_msg_detailed_info: - result += "\n" + add; - result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " answer_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ msg_detailed_info" + result + "}"; - - case mtpc_msg_new_detailed_info: - result += "\n" + add; - result += " answer_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ msg_new_detailed_info" + result + "}"; - - case mtpc_inputChatPhotoEmpty: - result = " "; - return "{ inputChatPhotoEmpty" + result + "}"; - - case mtpc_inputChatUploadedPhoto: - result += "\n" + add; - result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ inputChatUploadedPhoto" + result + "}"; - - case mtpc_inputChatPhoto: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ inputChatPhoto" + result + "}"; - - case mtpc_messages_sentMessage: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_sentMessage" + result + "}"; - - case mtpc_messages_sentMessageLink: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_sentMessageLink" + result + "}"; - case mtpc_messages_chatFull: result += "\n" + add; result += " full_chat: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; @@ -23167,193 +23156,194 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; return "{ messages_chatFull" + result + "}"; - case mtpc_geochats_statedMessage: + case mtpc_messages_affectedHistory: result += "\n" + add; - result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geochats_statedMessage" + result + "}"; - - case mtpc_chatPhotoEmpty: - result = " "; - return "{ chatPhotoEmpty" + result + "}"; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_affectedHistory" + result + "}"; - case mtpc_chatPhoto: + case mtpc_userFull: result += "\n" + add; - result += " photo_small: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " photo_big: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ chatPhoto" + result + "}"; + result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " link: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " profile_photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " blocked: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " real_first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " real_last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ userFull" + result + "}"; - case mtpc_encryptedMessage: + case mtpc_chatParticipantsForbidden: result += "\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ encryptedMessage" + result + "}"; + return "{ chatParticipantsForbidden" + result + "}"; - case mtpc_encryptedMessageService: + case mtpc_chatParticipants: result += "\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ encryptedMessageService" + result + "}"; - - case mtpc_destroy_session_ok: - result += "\n" + add; - result += " session_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ destroy_session_ok" + result + "}"; - - case mtpc_destroy_session_none: - result += "\n" + add; - result += " session_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ destroy_session_none" + result + "}"; - - case mtpc_http_wait: - result += "\n" + add; - result += " max_delay: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " wait_after: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " max_wait: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ http_wait" + result + "}"; - - case mtpc_messages_sentEncryptedMessage: - result += "\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_sentEncryptedMessage" + result + "}"; - - case mtpc_messages_sentEncryptedFile: - result += "\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_sentEncryptedFile" + result + "}"; - - case mtpc_contacts_myLinkEmpty: - result = " "; - return "{ contacts_myLinkEmpty" + result + "}"; - - case mtpc_contacts_myLinkRequested: - result += "\n" + add; - result += " contact: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_myLinkRequested" + result + "}"; + result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " participants: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ chatParticipants" + result + "}"; - case mtpc_contacts_myLinkContact: + case mtpc_messages_messageEmpty: result = " "; - return "{ contacts_myLinkContact" + result + "}"; - - case mtpc_inputEncryptedChat: - result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputEncryptedChat" + result + "}"; + return "{ messages_messageEmpty" + result + "}"; - case mtpc_messages_chats: + case mtpc_messages_message: result += "\n" + add; + result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_chats" + result + "}"; + return "{ messages_message" + result + "}"; - case mtpc_encryptedChatEmpty: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ encryptedChatEmpty" + result + "}"; + case mtpc_encryptedFileEmpty: + result = " "; + return "{ encryptedFileEmpty" + result + "}"; - case mtpc_encryptedChatWaiting: + case mtpc_encryptedFile: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ encryptedChatWaiting" + result + "}"; + result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ encryptedFile" + result + "}"; - case mtpc_encryptedChatRequested: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " g_a: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ encryptedChatRequested" + result + "}"; + case mtpc_inputVideoEmpty: + result = " "; + return "{ inputVideoEmpty" + result + "}"; - case mtpc_encryptedChat: + case mtpc_inputVideo: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " admin_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " participant_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " g_a_or_b: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ encryptedChat" + result + "}"; + return "{ inputVideo" + result + "}"; - case mtpc_encryptedChatDiscarded: + case mtpc_server_DH_inner_data: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ encryptedChatDiscarded" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " g: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " dh_prime: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " g_a: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " server_time: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ server_DH_inner_data" + result + "}"; - case mtpc_messages_messages: + case mtpc_contactBlocked: result += "\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_messages" + result + "}"; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contactBlocked" + result + "}"; - case mtpc_messages_messagesSlice: + case mtpc_server_DH_params_fail: result += "\n" + add; - result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_messagesSlice" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " new_nonce_hash: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + return "{ server_DH_params_fail" + result + "}"; - case mtpc_auth_checkedPhone: + case mtpc_server_DH_params_ok: result += "\n" + add; - result += " phone_registered: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " phone_invited: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ auth_checkedPhone" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " encrypted_answer: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ server_DH_params_ok" + result + "}"; - case mtpc_contactSuggested: + case mtpc_importedContact: result += "\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " mutual_contacts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contactSuggested" + result + "}"; + result += " client_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ importedContact" + result + "}"; - case mtpc_contacts_foreignLinkUnknown: + case mtpc_inputMessagesFilterEmpty: result = " "; - return "{ contacts_foreignLinkUnknown" + result + "}"; + return "{ inputMessagesFilterEmpty" + result + "}"; - case mtpc_contacts_foreignLinkRequested: + case mtpc_inputMessagesFilterPhotos: + result = " "; + return "{ inputMessagesFilterPhotos" + result + "}"; + + case mtpc_inputMessagesFilterVideo: + result = " "; + return "{ inputMessagesFilterVideo" + result + "}"; + + case mtpc_inputMessagesFilterPhotoVideo: + result = " "; + return "{ inputMessagesFilterPhotoVideo" + result + "}"; + + case mtpc_inputMessagesFilterDocument: + result = " "; + return "{ inputMessagesFilterDocument" + result + "}"; + + case mtpc_inputMessagesFilterAudio: + result = " "; + return "{ inputMessagesFilterAudio" + result + "}"; + + case mtpc_inputPeerNotifySettings: result += "\n" + add; - result += " has_phone: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_foreignLinkRequested" + result + "}"; + result += " mute_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " sound: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " show_previews: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " events_mask: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputPeerNotifySettings" + result + "}"; - case mtpc_contacts_foreignLinkMutual: + case mtpc_inputPeerEmpty: result = " "; - return "{ contacts_foreignLinkMutual" + result + "}"; + return "{ inputPeerEmpty" + result + "}"; - case mtpc_inputAudioEmpty: + case mtpc_inputPeerSelf: result = " "; - return "{ inputAudioEmpty" + result + "}"; + return "{ inputPeerSelf" + result + "}"; - case mtpc_inputAudio: + case mtpc_inputPeerContact: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputPeerContact" + result + "}"; + + case mtpc_inputPeerForeign: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputAudio" + result + "}"; + return "{ inputPeerForeign" + result + "}"; - case mtpc_contacts_contacts: + case mtpc_inputPeerChat: result += "\n" + add; - result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_contacts" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ inputPeerChat" + result + "}"; - case mtpc_contacts_contactsNotModified: + case mtpc_inputDocumentEmpty: result = " "; - return "{ contacts_contactsNotModified" + result + "}"; + return "{ inputDocumentEmpty" + result + "}"; + + case mtpc_inputDocument: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputDocument" + result + "}"; + + case mtpc_wallPaper: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " sizes: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ wallPaper" + result + "}"; + + case mtpc_wallPaperSolid: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " bg_color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " color: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ wallPaperSolid" + result + "}"; + + case mtpc_inputGeoChat: + result += "\n" + add; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputGeoChat" + result + "}"; case mtpc_chatEmpty: result += "\n" + add; @@ -23393,132 +23383,240 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; return "{ geoChat" + result + "}"; - case mtpc_pong: - result += "\n" + add; - result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ pong" + result + "}"; + case mtpc_inputEncryptedChat: + result += "\n" + add; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputEncryptedChat" + result + "}"; + + case mtpc_messages_sentEncryptedMessage: + result += "\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_sentEncryptedMessage" + result + "}"; + + case mtpc_messages_sentEncryptedFile: + result += "\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_sentEncryptedFile" + result + "}"; + + case mtpc_peerNotifySettingsEmpty: + result = " "; + return "{ peerNotifySettingsEmpty" + result + "}"; + + case mtpc_peerNotifySettings: + result += "\n" + add; + result += " mute_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " sound: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " show_previews: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " events_mask: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ peerNotifySettings" + result + "}"; + + case mtpc_messageMediaEmpty: + result = " "; + return "{ messageMediaEmpty" + result + "}"; + + case mtpc_messageMediaPhoto: + result += "\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageMediaPhoto" + result + "}"; + + case mtpc_messageMediaVideo: + result += "\n" + add; + result += " video: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageMediaVideo" + result + "}"; + + case mtpc_messageMediaGeo: + result += "\n" + add; + result += " geo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageMediaGeo" + result + "}"; + + case mtpc_messageMediaContact: + result += "\n" + add; + result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messageMediaContact" + result + "}"; + + case mtpc_messageMediaUnsupported: + result += "\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messageMediaUnsupported" + result + "}"; + + case mtpc_messageMediaDocument: + result += "\n" + add; + result += " document: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageMediaDocument" + result + "}"; + + case mtpc_messageMediaAudio: + result += "\n" + add; + result += " audio: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageMediaAudio" + result + "}"; + + case mtpc_messages_chats: + result += "\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_chats" + result + "}"; + + case mtpc_msg_detailed_info: + result += "\n" + add; + result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " answer_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ msg_detailed_info" + result + "}"; + + case mtpc_msg_new_detailed_info: + result += "\n" + add; + result += " answer_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " status: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ msg_new_detailed_info" + result + "}"; + + case mtpc_client_DH_inner_data: + result += "\n" + add; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " retry_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " g_b: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ client_DH_inner_data" + result + "}"; + + case mtpc_rpc_answer_unknown: + result = " "; + return "{ rpc_answer_unknown" + result + "}"; + + case mtpc_rpc_answer_dropped_running: + result = " "; + return "{ rpc_answer_dropped_running" + result + "}"; + + case mtpc_rpc_answer_dropped: + result += "\n" + add; + result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " seq_no: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " bytes: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ rpc_answer_dropped" + result + "}"; + + case mtpc_peerNotifyEventsEmpty: + result = " "; + return "{ peerNotifyEventsEmpty" + result + "}"; + + case mtpc_peerNotifyEventsAll: + result = " "; + return "{ peerNotifyEventsAll" + result + "}"; + + case mtpc_storage_fileUnknown: + result = " "; + return "{ storage_fileUnknown" + result + "}"; - case mtpc_inputPeerNotifyEventsEmpty: + case mtpc_storage_fileJpeg: result = " "; - return "{ inputPeerNotifyEventsEmpty" + result + "}"; + return "{ storage_fileJpeg" + result + "}"; - case mtpc_inputPeerNotifyEventsAll: + case mtpc_storage_fileGif: result = " "; - return "{ inputPeerNotifyEventsAll" + result + "}"; + return "{ storage_fileGif" + result + "}"; - case mtpc_inputPeerNotifySettings: - result += "\n" + add; - result += " mute_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " sound: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " show_previews: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " events_mask: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputPeerNotifySettings" + result + "}"; + case mtpc_storage_filePng: + result = " "; + return "{ storage_filePng" + result + "}"; - case mtpc_messages_affectedHistory: - result += "\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_affectedHistory" + result + "}"; + case mtpc_storage_filePdf: + result = " "; + return "{ storage_filePdf" + result + "}"; - case mtpc_inputNotifyPeer: - result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ inputNotifyPeer" + result + "}"; + case mtpc_storage_fileMp3: + result = " "; + return "{ storage_fileMp3" + result + "}"; - case mtpc_inputNotifyUsers: + case mtpc_storage_fileMov: result = " "; - return "{ inputNotifyUsers" + result + "}"; + return "{ storage_fileMov" + result + "}"; - case mtpc_inputNotifyChats: + case mtpc_storage_filePartial: result = " "; - return "{ inputNotifyChats" + result + "}"; + return "{ storage_filePartial" + result + "}"; - case mtpc_inputNotifyAll: + case mtpc_storage_fileMp4: result = " "; - return "{ inputNotifyAll" + result + "}"; + return "{ storage_fileMp4" + result + "}"; - case mtpc_inputNotifyGeoChatPeer: - result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ inputNotifyGeoChatPeer" + result + "}"; + case mtpc_storage_fileWebp: + result = " "; + return "{ storage_fileWebp" + result + "}"; - case mtpc_bad_msg_notification: + case mtpc_userStatusEmpty: + result = " "; + return "{ userStatusEmpty" + result + "}"; + + case mtpc_userStatusOnline: result += "\n" + add; - result += " bad_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " bad_msg_seqno: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ bad_msg_notification" + result + "}"; + result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ userStatusOnline" + result + "}"; - case mtpc_bad_server_salt: + case mtpc_userStatusOffline: result += "\n" + add; - result += " bad_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " bad_msg_seqno: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " new_server_salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ bad_server_salt" + result + "}"; + result += " was_online: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ userStatusOffline" + result + "}"; - case mtpc_config: + case mtpc_chatParticipant: result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " inviter_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " test_mode: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " this_dc: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " dc_options: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chat_size_max: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " broadcast_size_max: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ config" + result + "}"; - - case mtpc_inputGeoPointEmpty: - result = " "; - return "{ inputGeoPointEmpty" + result + "}"; + return "{ chatParticipant" + result + "}"; - case mtpc_inputGeoPoint: + case mtpc_notifyPeer: result += "\n" + add; - result += " lat: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - result += " long: " + mtpTextSerialize(from, end, mtpc_double, level + 1) + ",\n" + add; - return "{ inputGeoPoint" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ notifyPeer" + result + "}"; - case mtpc_inputUserEmpty: + case mtpc_notifyUsers: result = " "; - return "{ inputUserEmpty" + result + "}"; + return "{ notifyUsers" + result + "}"; - case mtpc_inputUserSelf: + case mtpc_notifyChats: result = " "; - return "{ inputUserSelf" + result + "}"; + return "{ notifyChats" + result + "}"; - case mtpc_inputUserContact: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ inputUserContact" + result + "}"; + case mtpc_notifyAll: + result = " "; + return "{ notifyAll" + result + "}"; - case mtpc_inputUserForeign: + case mtpc_inputPhotoEmpty: + result = " "; + return "{ inputPhotoEmpty" + result + "}"; + + case mtpc_inputPhoto: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ inputUserForeign" + result + "}"; + return "{ inputPhoto" + result + "}"; - case mtpc_dialog: + case mtpc_inputAudioEmpty: + result = " "; + return "{ inputAudioEmpty" + result + "}"; + + case mtpc_inputAudio: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " top_message: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " unread_count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " notify_settings: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ dialog" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ inputAudio" + result + "}"; - case mtpc_importedContact: + case mtpc_contacts_suggested: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " client_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ importedContact" + result + "}"; + result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_suggested" + result + "}"; - case mtpc_dcOption: + case mtpc_geochats_statedMessage: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " hostname: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " ip_address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " port: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ dcOption" + result + "}"; + result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ geochats_statedMessage" + result + "}"; case mtpc_updateNewMessage: result += "\n" + add; @@ -23682,212 +23780,159 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP case mtpc_decryptedMessageActionReadMessages: result += "\n" + add; result += " random_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ decryptedMessageActionReadMessages" + result + "}"; - - case mtpc_decryptedMessageActionDeleteMessages: - result += "\n" + add; - result += " random_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ decryptedMessageActionDeleteMessages" + result + "}"; - - case mtpc_decryptedMessageActionScreenshotMessages: - result += "\n" + add; - result += " random_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - return "{ decryptedMessageActionScreenshotMessages" + result + "}"; - - case mtpc_decryptedMessageActionFlushHistory: - result = " "; - return "{ decryptedMessageActionFlushHistory" + result + "}"; - - case mtpc_decryptedMessageActionNotifyLayer: - result += "\n" + add; - result += " layer: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ decryptedMessageActionNotifyLayer" + result + "}"; - - case mtpc_peerNotifySettingsEmpty: - result = " "; - return "{ peerNotifySettingsEmpty" + result + "}"; - - case mtpc_peerNotifySettings: - result += "\n" + add; - result += " mute_until: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " sound: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " show_previews: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " events_mask: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ peerNotifySettings" + result + "}"; - - case mtpc_userEmpty: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ userEmpty" + result + "}"; - - case mtpc_userSelf: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " inactive: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ userSelf" + result + "}"; - - case mtpc_userContact: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ userContact" + result + "}"; - - case mtpc_userRequest: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " phone: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ userRequest" + result + "}"; - - case mtpc_userForeign: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " status: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ userForeign" + result + "}"; - - case mtpc_userDeleted: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " first_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ userDeleted" + result + "}"; - - case mtpc_contacts_suggested: - result += "\n" + add; - result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_suggested" + result + "}"; + return "{ decryptedMessageActionReadMessages" + result + "}"; - case mtpc_auth_authorization: + case mtpc_decryptedMessageActionDeleteMessages: result += "\n" + add; - result += " expires: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " user: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ auth_authorization" + result + "}"; + result += " random_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + return "{ decryptedMessageActionDeleteMessages" + result + "}"; - case mtpc_messages_chat: + case mtpc_decryptedMessageActionScreenshotMessages: result += "\n" + add; - result += " chat: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_chat" + result + "}"; + result += " random_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + return "{ decryptedMessageActionScreenshotMessages" + result + "}"; - case mtpc_auth_sentCode: + case mtpc_decryptedMessageActionFlushHistory: + result = " "; + return "{ decryptedMessageActionFlushHistory" + result + "}"; + + case mtpc_decryptedMessageActionNotifyLayer: result += "\n" + add; - result += " phone_registered: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " phone_code_hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " send_call_timeout: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " is_password: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ auth_sentCode" + result + "}"; + result += " layer: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ decryptedMessageActionNotifyLayer" + result + "}"; - case mtpc_audioEmpty: + case mtpc_videoEmpty: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ audioEmpty" + result + "}"; + return "{ videoEmpty" + result + "}"; - case mtpc_audio: + case mtpc_video: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " duration: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " mime_type: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " thumb: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ audio" + result + "}"; + result += " w: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " h: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ video" + result + "}"; - case mtpc_messages_statedMessages: + case mtpc_contacts_found: result += "\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_statedMessages" + result + "}"; + return "{ contacts_found" + result + "}"; - case mtpc_messages_statedMessagesLinks: + case mtpc_auth_checkedPhone: result += "\n" + add; - result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " links: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_statedMessagesLinks" + result + "}"; + result += " phone_registered: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " phone_invited: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ auth_checkedPhone" + result + "}"; - case mtpc_contactBlocked: + case mtpc_messageActionEmpty: + result = " "; + return "{ messageActionEmpty" + result + "}"; + + case mtpc_messageActionChatCreate: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contactBlocked" + result + "}"; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messageActionChatCreate" + result + "}"; - case mtpc_storage_fileUnknown: - result = " "; - return "{ storage_fileUnknown" + result + "}"; + case mtpc_messageActionChatEditTitle: + result += "\n" + add; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ messageActionChatEditTitle" + result + "}"; - case mtpc_storage_fileJpeg: - result = " "; - return "{ storage_fileJpeg" + result + "}"; + case mtpc_messageActionChatEditPhoto: + result += "\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messageActionChatEditPhoto" + result + "}"; - case mtpc_storage_fileGif: + case mtpc_messageActionChatDeletePhoto: result = " "; - return "{ storage_fileGif" + result + "}"; + return "{ messageActionChatDeletePhoto" + result + "}"; - case mtpc_storage_filePng: - result = " "; - return "{ storage_filePng" + result + "}"; + case mtpc_messageActionChatAddUser: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messageActionChatAddUser" + result + "}"; - case mtpc_storage_filePdf: - result = " "; - return "{ storage_filePdf" + result + "}"; + case mtpc_messageActionChatDeleteUser: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messageActionChatDeleteUser" + result + "}"; - case mtpc_storage_fileMp3: - result = " "; - return "{ storage_fileMp3" + result + "}"; + case mtpc_messageActionGeoChatCreate: + result += "\n" + add; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ messageActionGeoChatCreate" + result + "}"; - case mtpc_storage_fileMov: + case mtpc_messageActionGeoChatCheckin: result = " "; - return "{ storage_fileMov" + result + "}"; + return "{ messageActionGeoChatCheckin" + result + "}"; - case mtpc_storage_filePartial: - result = " "; - return "{ storage_filePartial" + result + "}"; + case mtpc_messages_dialogs: + result += "\n" + add; + result += " dialogs: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_dialogs" + result + "}"; - case mtpc_storage_fileMp4: - result = " "; - return "{ storage_fileMp4" + result + "}"; + case mtpc_messages_dialogsSlice: + result += "\n" + add; + result += " count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " dialogs: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_dialogsSlice" + result + "}"; - case mtpc_storage_fileWebp: + case mtpc_contacts_contacts: + result += "\n" + add; + result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_contacts" + result + "}"; + + case mtpc_contacts_contactsNotModified: result = " "; - return "{ storage_fileWebp" + result + "}"; + return "{ contacts_contactsNotModified" + result + "}"; - case mtpc_help_inviteText: + case mtpc_geochats_located: result += "\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ help_inviteText" + result + "}"; + result += " results: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " messages: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " chats: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " users: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ geochats_located" + result + "}"; - case mtpc_chatLocated: + case mtpc_pong: result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " distance: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ chatLocated" + result + "}"; + result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ pong" + result + "}"; + + case mtpc_bad_msg_notification: + result += "\n" + add; + result += " bad_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " bad_msg_seqno: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ bad_msg_notification" + result + "}"; + + case mtpc_bad_server_salt: + result += "\n" + add; + result += " bad_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " bad_msg_seqno: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " error_code: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " new_server_salt: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ bad_server_salt" + result + "}"; case mtpc_contact: result += "\n" + add; @@ -23895,60 +23940,38 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " mutual: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; return "{ contact" + result + "}"; - case mtpc_decryptedMessageLayer: + case mtpc_messages_receivedQueue: result += "\n" + add; - result += " layer: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ decryptedMessageLayer" + result + "}"; + result += " max_qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_receivedQueue" + result + "}"; - case mtpc_updates_state: + case mtpc_set_client_DH_params: result += "\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " seq: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " unread_count: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updates_state" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " encrypted_data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ set_client_DH_params" + result + "}"; - case mtpc_encryptedFileEmpty: + case mtpc_help_getSupport: result = " "; - return "{ encryptedFileEmpty" + result + "}"; - - case mtpc_encryptedFile: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " access_hash: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " size: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ encryptedFile" + result + "}"; - - case mtpc_msgs_all_info: - result += "\n" + add; - result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - result += " info: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ msgs_all_info" + result + "}"; - - case mtpc_photos_updateProfilePhoto: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photos_updateProfilePhoto" + result + "}"; + return "{ help_getSupport" + result + "}"; - case mtpc_messages_getMessages: + case mtpc_auth_sendCode: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messages_getMessages" + result + "}"; + result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " sms_type: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " api_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " api_hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ auth_sendCode" + result + "}"; - case mtpc_messages_getHistory: + case mtpc_geochats_getRecents: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_getHistory" + result + "}"; + return "{ geochats_getRecents" + result + "}"; - case mtpc_messages_search: + case mtpc_geochats_search: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; @@ -23958,23 +23981,20 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_search" + result + "}"; + return "{ geochats_search" + result + "}"; - case mtpc_set_client_DH_params: + case mtpc_geochats_getHistory: result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " encrypted_data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ set_client_DH_params" + result + "}"; - - case mtpc_contacts_getStatuses: - result = " "; - return "{ contacts_getStatuses" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ geochats_getHistory" + result + "}"; - case mtpc_auth_checkPhone: + case mtpc_get_future_salts: result += "\n" + add; - result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ auth_checkPhone" + result + "}"; + result += " num: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ get_future_salts" + result + "}"; case mtpc_help_getAppUpdate: result += "\n" + add; @@ -23984,133 +24004,108 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; return "{ help_getAppUpdate" + result + "}"; - case mtpc_updates_getDifference: - result += "\n" + add; - result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ updates_getDifference" + result + "}"; - case mtpc_help_getInviteText: result += "\n" + add; result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; return "{ help_getInviteText" + result + "}"; - case mtpc_users_getFullUser: - result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ users_getFullUser" + result + "}"; - - case mtpc_updates_getState: + case mtpc_help_getNearestDc: result = " "; - return "{ updates_getState" + result + "}"; + return "{ help_getNearestDc" + result + "}"; - case mtpc_contacts_getContacts: + case mtpc_messages_deleteMessages: result += "\n" + add; - result += " hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ contacts_getContacts" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messages_deleteMessages" + result + "}"; - case mtpc_geochats_checkin: + case mtpc_messages_restoreMessages: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_checkin" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messages_restoreMessages" + result + "}"; - case mtpc_geochats_editChatTitle: + case mtpc_messages_receivedMessages: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ geochats_editChatTitle" + result + "}"; + result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_receivedMessages" + result + "}"; - case mtpc_geochats_editChatPhoto: + case mtpc_contacts_getBlocked: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_editChatPhoto" + result + "}"; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contacts_getBlocked" + result + "}"; - case mtpc_geochats_sendMessage: + case mtpc_messages_getFullChat: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ geochats_sendMessage" + result + "}"; + result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_getFullChat" + result + "}"; - case mtpc_geochats_sendMedia: + case mtpc_geochats_getFullChat: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ geochats_sendMedia" + result + "}"; + return "{ geochats_getFullChat" + result + "}"; - case mtpc_geochats_createGeoChat: + case mtpc_messages_getDhConfig: result += "\n" + add; - result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " venue: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ geochats_createGeoChat" + result + "}"; + result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " random_length: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_getDhConfig" + result + "}"; - case mtpc_ping: + case mtpc_messages_forwardMessages: result += "\n" + add; - result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ ping" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messages_forwardMessages" + result + "}"; - case mtpc_ping_delay_disconnect: + case mtpc_messages_sendBroadcast: result += "\n" + add; - result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " disconnect_delay: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ ping_delay_disconnect" + result + "}"; - - case mtpc_help_getSupport: - result = " "; - return "{ help_getSupport" + result + "}"; + result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_sendBroadcast" + result + "}"; - case mtpc_messages_readHistory: + case mtpc_users_getFullUser: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_readHistory" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ users_getFullUser" + result + "}"; - case mtpc_messages_deleteHistory: + case mtpc_photos_getUserPhotos: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_deleteHistory" + result + "}"; + result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ photos_getUserPhotos" + result + "}"; - case mtpc_messages_deleteMessages: + case mtpc_photos_uploadProfilePhoto: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messages_deleteMessages" + result + "}"; + result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ photos_uploadProfilePhoto" + result + "}"; - case mtpc_messages_restoreMessages: + case mtpc_updates_getState: + result = " "; + return "{ updates_getState" + result + "}"; + + case mtpc_photos_updateProfilePhoto: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messages_restoreMessages" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ photos_updateProfilePhoto" + result + "}"; - case mtpc_messages_receivedMessages: + case mtpc_messages_getDialogs: result += "\n" + add; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_receivedMessages" + result + "}"; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_getDialogs" + result + "}"; case mtpc_users_getUsers: result += "\n" + add; result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; return "{ users_getUsers" + result + "}"; - case mtpc_get_future_salts: - result += "\n" + add; - result += " num: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ get_future_salts" + result + "}"; - - case mtpc_photos_getUserPhotos: - result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ photos_getUserPhotos" + result + "}"; - case mtpc_register_saveDeveloperInfo: result += "\n" + add; result += " name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; @@ -24236,59 +24231,9 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; return "{ upload_saveBigFilePart" + result + "}"; - case mtpc_req_pq: - result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - return "{ req_pq" + result + "}"; - - case mtpc_auth_exportAuthorization: - result += "\n" + add; - result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ auth_exportAuthorization" + result + "}"; - - case mtpc_contacts_importContacts: - result += "\n" + add; - result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " replace: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_importContacts" + result + "}"; - - case mtpc_rpc_drop_answer: - result += "\n" + add; - result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ rpc_drop_answer" + result + "}"; - - case mtpc_help_getConfig: - result = " "; - return "{ help_getConfig" + result + "}"; - - case mtpc_help_getNearestDc: + case mtpc_account_getWallPapers: result = " "; - return "{ help_getNearestDc" + result + "}"; - - case mtpc_messages_getDialogs: - result += "\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_getDialogs" + result + "}"; - - case mtpc_account_getNotifySettings: - result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ account_getNotifySettings" + result + "}"; - - case mtpc_geochats_getLocated: - result += "\n" + add; - result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " radius: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geochats_getLocated" + result + "}"; - - case mtpc_messages_getDhConfig: - result += "\n" + add; - result += " version: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " random_length: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_getDhConfig" + result + "}"; + return "{ account_getWallPapers" + result + "}"; case mtpc_account_updateProfile: result += "\n" + add; @@ -24296,30 +24241,10 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " last_name: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; return "{ account_updateProfile" + result + "}"; - case mtpc_messages_getFullChat: - result += "\n" + add; - result += " chat_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_getFullChat" + result + "}"; - - case mtpc_geochats_getFullChat: + case mtpc_account_getNotifySettings: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ geochats_getFullChat" + result + "}"; - - case mtpc_req_DH_params: - result += "\n" + add; - result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; - result += " p: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " public_key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " encrypted_data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ req_DH_params" + result + "}"; - - case mtpc_contacts_getSuggested: - result += "\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contacts_getSuggested" + result + "}"; + return "{ account_getNotifySettings" + result + "}"; case mtpc_auth_signUp: result += "\n" + add; @@ -24343,68 +24268,92 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " bytes: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; return "{ auth_importAuthorization" + result + "}"; - case mtpc_upload_getFile: + case mtpc_messages_sendMessage: + result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ messages_sendMessage" + result + "}"; + + case mtpc_help_getConfig: + result = " "; + return "{ help_getConfig" + result + "}"; + + case mtpc_req_DH_params: + result += "\n" + add; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " server_nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + result += " p: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " public_key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " encrypted_data: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ req_DH_params" + result + "}"; + + case mtpc_messages_getChats: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messages_getChats" + result + "}"; + + case mtpc_contacts_importContacts: result += "\n" + add; - result += " location: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ upload_getFile" + result + "}"; + result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " replace: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_importContacts" + result + "}"; - case mtpc_photos_uploadProfilePhoto: + case mtpc_rpc_drop_answer: result += "\n" + add; - result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " caption: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " crop: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ photos_uploadProfilePhoto" + result + "}"; + result += " req_msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ rpc_drop_answer" + result + "}"; - case mtpc_auth_sendCode: + case mtpc_messages_sendEncrypted: result += "\n" + add; - result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " sms_type: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " api_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " api_hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - return "{ auth_sendCode" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messages_sendEncrypted" + result + "}"; - case mtpc_messages_forwardMessages: + case mtpc_messages_sendEncryptedFile: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messages_forwardMessages" + result + "}"; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ messages_sendEncryptedFile" + result + "}"; - case mtpc_messages_sendBroadcast: + case mtpc_messages_sendEncryptedService: result += "\n" + add; - result += " contacts: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_sendBroadcast" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messages_sendEncryptedService" + result + "}"; - case mtpc_messages_receivedQueue: + case mtpc_messages_readHistory: result += "\n" + add; - result += " max_qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ messages_receivedQueue" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_readHistory" + result + "}"; - case mtpc_contacts_search: + case mtpc_messages_deleteHistory: result += "\n" + add; - result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contacts_search" + result + "}"; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ messages_deleteHistory" + result + "}"; - case mtpc_messages_sendMessage: + case mtpc_messages_getMessages: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ messages_sendMessage" + result + "}"; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; + return "{ messages_getMessages" + result + "}"; - case mtpc_geochats_getRecents: + case mtpc_messages_getHistory: result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geochats_getRecents" + result + "}"; + return "{ messages_getHistory" + result + "}"; - case mtpc_geochats_search: + case mtpc_messages_search: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; @@ -24414,84 +24363,127 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geochats_search" + result + "}"; + return "{ messages_search" + result + "}"; - case mtpc_geochats_getHistory: + case mtpc_updates_getDifference: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " max_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ geochats_getHistory" + result + "}"; + result += " pts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " date: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " qts: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ updates_getDifference" + result + "}"; + + case mtpc_contacts_getStatuses: + result = " "; + return "{ contacts_getStatuses" + result + "}"; + + case mtpc_auth_exportAuthorization: + result += "\n" + add; + result += " dc_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ auth_exportAuthorization" + result + "}"; + + case mtpc_contacts_deleteContact: + result += "\n" + add; + result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ contacts_deleteContact" + result + "}"; case mtpc_destroy_session: result += "\n" + add; result += " session_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; return "{ destroy_session" + result + "}"; - case mtpc_account_getWallPapers: - result = " "; - return "{ account_getWallPapers" + result + "}"; + case mtpc_upload_getFile: + result += "\n" + add; + result += " location: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ upload_getFile" + result + "}"; - case mtpc_messages_sendEncrypted: + case mtpc_messages_requestEncryption: + result += "\n" + add; + result += " user_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " random_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " g_a: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + return "{ messages_requestEncryption" + result + "}"; + + case mtpc_messages_acceptEncryption: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messages_sendEncrypted" + result + "}"; + result += " g_b: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; + result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ messages_acceptEncryption" + result + "}"; - case mtpc_messages_sendEncryptedFile: + case mtpc_contacts_getSuggested: + result += "\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contacts_getSuggested" + result + "}"; + + case mtpc_geochats_checkin: + result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ geochats_checkin" + result + "}"; + + case mtpc_geochats_editChatTitle: + result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ geochats_editChatTitle" + result + "}"; + + case mtpc_geochats_editChatPhoto: + result += "\n" + add; + result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " photo: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ geochats_editChatPhoto" + result + "}"; + + case mtpc_geochats_sendMessage: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " message: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " file: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ messages_sendEncryptedFile" + result + "}"; + return "{ geochats_sendMessage" + result + "}"; - case mtpc_messages_sendEncryptedService: + case mtpc_geochats_sendMedia: result += "\n" + add; result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " media: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " data: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messages_sendEncryptedService" + result + "}"; + return "{ geochats_sendMedia" + result + "}"; - case mtpc_contacts_getBlocked: + case mtpc_geochats_createGeoChat: result += "\n" + add; - result += " offset: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - return "{ contacts_getBlocked" + result + "}"; + result += " title: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " address: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " venue: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ geochats_createGeoChat" + result + "}"; - case mtpc_contacts_deleteContact: + case mtpc_contacts_search: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ contacts_deleteContact" + result + "}"; + result += " q: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ contacts_search" + result + "}"; - case mtpc_invokeAfterMsg: + case mtpc_auth_checkPhone: result += "\n" + add; - result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ invokeAfterMsg" + result + "}"; + result += " phone_number: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ auth_checkPhone" + result + "}"; - case mtpc_invokeAfterMsgs: + case mtpc_contacts_getContacts: result += "\n" + add; - result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; - result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ invokeAfterMsgs" + result + "}"; + result += " hash: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + return "{ contacts_getContacts" + result + "}"; - case mtpc_initConnection: + case mtpc_geochats_getLocated: result += "\n" + add; - result += " api_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " device_model: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " system_version: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " app_version: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; - result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - return "{ initConnection" + result + "}"; + result += " geo_point: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + result += " radius: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " limit: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ geochats_getLocated" + result + "}"; - case mtpc_messages_getChats: + case mtpc_req_pq: result += "\n" + add; - result += " id: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_int) + ",\n" + add; - return "{ messages_getChats" + result + "}"; + result += " nonce: " + mtpTextSerialize(from, end, mtpc_int128, level + 1) + ",\n" + add; + return "{ req_pq" + result + "}"; case mtpc_messages_sendMedia: result += "\n" + add; @@ -24538,19 +24530,38 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end, mtpP result += " random_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; return "{ messages_forwardMessage" + result + "}"; - case mtpc_messages_requestEncryption: + case mtpc_ping: result += "\n" + add; - result += " user_id: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " random_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; - result += " g_a: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - return "{ messages_requestEncryption" + result + "}"; + result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + return "{ ping" + result + "}"; - case mtpc_messages_acceptEncryption: + case mtpc_ping_delay_disconnect: result += "\n" + add; - result += " peer: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; - result += " g_b: " + mtpTextSerialize(from, end, mtpc_bytes, level + 1) + ",\n" + add; - result += " key_fingerprint: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; - return "{ messages_acceptEncryption" + result + "}"; + result += " ping_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " disconnect_delay: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + return "{ ping_delay_disconnect" + result + "}"; + + case mtpc_invokeAfterMsg: + result += "\n" + add; + result += " msg_id: " + mtpTextSerialize(from, end, mtpc_long, level + 1) + ",\n" + add; + result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ invokeAfterMsg" + result + "}"; + + case mtpc_invokeAfterMsgs: + result += "\n" + add; + result += " msg_ids: " + mtpTextSerialize(from, end, 0, level + 1, mtpc_long) + ",\n" + add; + result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ invokeAfterMsgs" + result + "}"; + + case mtpc_initConnection: + result += "\n" + add; + result += " api_id: " + mtpTextSerialize(from, end, mtpc_int, level + 1) + ",\n" + add; + result += " device_model: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " system_version: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " app_version: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " lang_code: " + mtpTextSerialize(from, end, mtpc_string, level + 1) + ",\n" + add; + result += " query: " + mtpTextSerialize(from, end, 0, level + 1) + ",\n" + add; + return "{ initConnection" + result + "}"; } return mtpTextSerializeCore(from, end, cons, level, vcons); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 8b84bcf13bb05d..5afcae92d7779e 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -30,6 +30,7 @@ //invokeWithLayer12#dda60d3c query:!X = X; //invokeWithLayer13#427c8ea2 query:!X = X; //invokeWithLayer14#2b9b08fa query:!X = X; +//invokeWithLayer15#b4418b64 query:!X = X; /////////////////////////////// /// Authorization key creation @@ -123,6 +124,7 @@ register.saveDeveloperInfo#9a5f6e95 name:string email:string phone_number:string ---types--- + inputPeerEmpty#7f3b18ea = InputPeer; inputPeerSelf#7da07ec9 = InputPeer; inputPeerContact#1023dbe8 user_id:int = InputPeer; @@ -340,6 +342,7 @@ inputMessagesFilterPhotos#9609a51c = MessagesFilter; inputMessagesFilterVideo#9fc00e65 = MessagesFilter; inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter; inputMessagesFilterDocument#9eddf188 = MessagesFilter; +inputMessagesFilterAudio#cfc87522 = MessagesFilter; updateNewMessage#13abdb3 message:Message pts:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 15c7bb823e4443..faaadeb6a6bc48 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -171,7 +171,7 @@ void ProfileInner::onClearHistory() { } void ProfileInner::onClearHistorySure() { - App::main()->showPeer(0, true); + App::main()->showPeer(0, 0, true); App::wnd()->hideLayer(); App::main()->clearHistory(_peer); } @@ -546,7 +546,7 @@ void ProfileInner::onKickConfirm() { void ProfileInner::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Escape) { - App::main()->showPeer(0, true); + App::main()->showPeer(0, 0, true); } } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 45fa011853a9d3..93660eeb0e7ede 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -1393,12 +1393,12 @@ PsMainWindow::~PsMainWindow() { } void PsMainWindow::psNotify(History *history, MsgId msgId) { - if (App::quiting() || !history->notifyFrom) return; + if (App::quiting() || !history->currentNotification()) return; bool haveSetting = (history->peer->notify != UnknownNotifySettings); if (haveSetting) { if (history->peer->notify != EmptyNotifySettings && history->peer->notify->mute > unixtime()) { - history->clearNotifyFrom(); + history->clearNotifications(); return; } } else { @@ -1454,7 +1454,7 @@ void PsMainWindow::psClearNotify(History *history) { (*i)->unlinkHistory(); } for (NotifyWhenMaps::const_iterator i = notifyWhenMaps.cbegin(), e = notifyWhenMaps.cend(); i != e; ++i) { - i.key()->clearNotifyFrom(); + i.key()->clearNotifications(); } notifyWaiters.clear(); notifySettingWaiters.clear(); @@ -1588,24 +1588,24 @@ void PsMainWindow::psShowNextNotify(PsNotifyWindow *remove) { NotifyWaiters::iterator notifyWaiter; for (NotifyWaiters::iterator i = notifyWaiters.begin(); i != notifyWaiters.end(); ++i) { History *history = i.key(); - if (history->notifyFrom && history->notifyFrom->id != i.value().msg) { + if (history->currentNotification() && history->currentNotification()->id != i.value().msg) { NotifyWhenMaps::iterator j = notifyWhenMaps.find(history); if (j == notifyWhenMaps.end()) { - history->clearNotifyFrom(); + history->clearNotifications(); i = notifyWaiters.erase(i); continue; } do { - NotifyWhenMap::const_iterator k = j.value().constFind(history->notifyFrom->id); + NotifyWhenMap::const_iterator k = j.value().constFind(history->currentNotification()->id); if (k != j.value().cend()) { i.value().msg = k.key(); i.value().when = k.value(); break; } - history->getNextNotifyFrom(); - } while (history->notifyFrom); + history->skipNotification(); + } while (history->currentNotification()); } - if (!history->notifyFrom) { + if (!history->currentNotification()) { notifyWhenMaps.remove(history); i = notifyWaiters.erase(i); continue; @@ -1613,7 +1613,7 @@ void PsMainWindow::psShowNextNotify(PsNotifyWindow *remove) { uint64 when = i.value().when; if (!notifyItem || next > when) { next = when; - notifyItem = history->notifyFrom; + notifyItem = history->currentNotification(); notifyWaiter = i; } } @@ -1631,25 +1631,25 @@ void PsMainWindow::psShowNextNotify(PsNotifyWindow *remove) { uint64 ms = getms(); History *history = notifyItem->history(); - history->getNextNotifyFrom(); + history->skipNotification(); NotifyWhenMaps::iterator j = notifyWhenMaps.find(history); - if (j == notifyWhenMaps.end() || !history->notifyFrom) { - history->clearNotifyFrom(); + if (j == notifyWhenMaps.end() || !history->currentNotification()) { + history->clearNotifications(); notifyWaiters.erase(notifyWaiter); if (j != notifyWhenMaps.end()) notifyWhenMaps.erase(j); continue; } j.value().remove(notifyItem->id); do { - NotifyWhenMap::const_iterator k = j.value().constFind(history->notifyFrom->id); + NotifyWhenMap::const_iterator k = j.value().constFind(history->currentNotification()->id); if (k != j.value().cend()) { notifyWaiter.value().msg = k.key(); notifyWaiter.value().when = k.value(); break; } - history->getNextNotifyFrom(); - } while (history->notifyFrom); - if (!history->notifyFrom) { + history->skipNotification(); + } while (history->currentNotification()); + if (!history->currentNotification()) { notifyWaiters.erase(notifyWaiter); notifyWhenMaps.erase(j); continue; @@ -1829,7 +1829,7 @@ void PsNotifyWindow::mousePressEvent(QMouseEvent *e) { } else if (history) { App::wnd()->showFromTray(); App::wnd()->hideSettings(); - App::main()->showPeer(history->peer->id, false, true); + App::main()->showPeer(history->peer->id, 0, false, true); e->ignore(); } } diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 6ac7aec17627fb..05f1ab58db6cf2 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -56,6 +56,7 @@ Copyright (c) 2014 John Preston, https://tdesktop.com #include "gui/flatinput.h" #include "gui/flattextarea.h" #include "gui/flatbutton.h" +#include "gui/switcher.h" #include "gui/scrollarea.h" #include "gui/images.h" #include "gui/text.h" diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index f817ae7c4225cb..722d4c90c377bd 100644 Binary files a/Telegram/Telegram.rc and b/Telegram/Telegram.rc differ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 735b600e729940..7becdb7db545c1 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -314,6 +314,10 @@ true true + + true + true + true true @@ -498,6 +502,10 @@ true true + + true + true + true true @@ -691,6 +699,10 @@ true true + + true + true + true true @@ -740,6 +752,7 @@ + @@ -1213,6 +1226,20 @@ $(QTDIR)\bin\moc.exe;%(FullPath) + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing switcher.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/gui/switcher.h" -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.0\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.0\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing switcher.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/gui/switcher.h" -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.0\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.0\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing switcher.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/gui/switcher.h" -DUNICODE -D_WITH_DEBUG -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\OpenSSL-Win32\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.3.0\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.3.0\QtGui" + diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index afe3515a2cdb33..3ac3f30a8e5fc3 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -656,6 +656,18 @@ Generated Files\Release + + gui + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + @@ -891,6 +903,9 @@ gui + + gui +