From 47c7f76f2cc38a8ad896dc79ac008706acbf4704 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 17 Mar 2016 21:03:08 +0300 Subject: [PATCH 01/10] added some additional logging for file downloadings --- Telegram/Deploy.sh | 3 -- Telegram/SourceFiles/facades.cpp | 4 ++ Telegram/SourceFiles/facades.h | 14 ++++++ .../SourceFiles/mtproto/mtpFileLoader.cpp | 44 +++++++++++++++++-- Telegram/SourceFiles/settingswidget.cpp | 18 ++++++-- 5 files changed, 74 insertions(+), 9 deletions(-) diff --git a/Telegram/Deploy.sh b/Telegram/Deploy.sh index 4a54d780a..f87d403cf 100755 --- a/Telegram/Deploy.sh +++ b/Telegram/Deploy.sh @@ -188,7 +188,6 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$Build fi if [ "$DeployMac" == "1" ]; then - cp -v "$DeployPath/$UpdateFile" "$DropboxDeployPath/" cp -v "$DeployPath/$SetupFile" "$DropboxDeployPath/$DropboxSetupFile" if [ -d "$DropboxDeployPath/Telegram.app.dSYM" ]; then rm -rf "$DropboxDeployPath/Telegram.app.dSYM" @@ -196,7 +195,6 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$Build cp -rv "$DeployPath/Telegram.app.dSYM" "$DropboxDeployPath/" fi if [ "$DeployMac32" == "1" ]; then - mv -v "$Mac32DeployPath/$Mac32UpdateFile" "$DropboxDeployPath/" mv -v "$Mac32DeployPath/$Mac32SetupFile" "$DropboxDeployPath/$DropboxMac32SetupFile" if [ -d "$DropboxDeployPath/Telegram32.app.dSYM" ]; then rm -rf "$DropboxDeployPath/Telegram32.app.dSYM" @@ -207,7 +205,6 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$Build mv -v "$WinDeployPath/Telegram.pdb" "$DropboxDeployPath/" mv -v "$WinDeployPath/Updater.exe" "$DropboxDeployPath/" mv -v "$WinDeployPath/Updater.pdb" "$DropboxDeployPath/" - mv -v "$WinDeployPath/$WinUpdateFile" "$DropboxDeployPath/" if [ "$BetaVersion" == "0" ]; then mv -v "$WinDeployPath/$WinSetupFile" "$DropboxDeployPath/" fi diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index eccc5255c..63b8df37c 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -355,6 +355,8 @@ struct GlobalDataStruct { Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; bool AdaptiveForWide = true; + int32 DebugLoggingFlags = 0; + // config int32 ChatSizeMax = 200; int32 MegagroupSizeMax = 1000; @@ -398,6 +400,8 @@ namespace Global { DefineVar(Global, Adaptive::Layout, AdaptiveLayout); DefineVar(Global, bool, AdaptiveForWide); + DefineVar(Global, int32, DebugLoggingFlags); + // config DefineVar(Global, int32, ChatSizeMax); DefineVar(Global, int32, MegagroupSizeMax); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index e572f45c1..26bcf391d 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -131,6 +131,12 @@ namespace Adaptive { }; }; +namespace DebugLogging { + enum Flags { + FileLoaderFlag = 0x00000001, + }; +} + namespace Global { bool started(); @@ -142,6 +148,8 @@ namespace Global { DeclareVar(Adaptive::Layout, AdaptiveLayout); DeclareVar(bool, AdaptiveForWide); + DeclareVar(int32, DebugLoggingFlags); + // config DeclareVar(int32, ChatSizeMax); DeclareVar(int32, MegagroupSizeMax); @@ -175,3 +183,9 @@ namespace Adaptive { return Global::AdaptiveForWide() && (Global::AdaptiveLayout() == WideLayout); } } + +namespace DebugLogging { + inline bool FileLoader() { + return (Global::DebugLoggingFlags() | FileLoaderFlag) != 0; + } +} diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index f260f2ca4..311fbebf8 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -376,9 +376,33 @@ int32 mtpFileLoader::currentOffset(bool includeSkipped) const { return (_fileIsOpen ? _file.size() : _data.size()) - (includeSkipped ? 0 : _skippedBytes); } +namespace { + QString serializereqs(const QMap &reqs) { // serialize requests map in json-like format + QString result; + result.reserve(reqs.size() * 16 + 4); + result.append(qsl("{ ")); + for (auto i = reqs.cbegin(), e = reqs.cend(); i != e;) { + result.append(QString::number(i.key())).append(qsl(" : ")).append(QString::number(i.value())); + if (++i == e) { + break; + } else { + result.append(qsl(", ")); + } + } + result.append(qsl(" }")); + return result; + } +} + bool mtpFileLoader::loadPart() { - if (_complete || _lastComplete || (!_requests.isEmpty() && !_size)) return false; - if (_size && _nextRequestOffset >= _size) return false; + if (_complete || _lastComplete || (!_requests.isEmpty() && !_size)) { + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): loadPart() returned, _complete=%2, _lastComplete=%3, _requests.size()=%4, _size=%5").arg(_id).arg(Logs::b(_complete)).arg(Logs::b(_lastComplete)).arg(_requests.size()).arg(_size)); + return false; + } + if (_size && _nextRequestOffset >= _size) { + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): loadPart() returned, _size=%2, _nextRequestOffset=%3, _requests=%4").arg(_id).arg(_size).arg(_nextRequestOffset).arg(serializereqs(_requests))); + return false; + } int32 limit = DocumentDownloadPartSize; MTPInputFileLocation loc; @@ -412,12 +436,21 @@ bool mtpFileLoader::loadPart() { _requests.insert(reqId, dcIndex); _nextRequestOffset += limit; + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): requested part with offset=%2, _queue->queries=%3, _nextRequestOffset=%4, _requests=%5").arg(_id).arg(offset).arg(_queue->queries).arg(_nextRequestOffset).arg(serializereqs(_requests))); + return true; } void mtpFileLoader::partLoaded(int32 offset, const MTPupload_File &result, mtpRequestId req) { Requests::iterator i = _requests.find(req); - if (i == _requests.cend()) return loadNext(); + if (i == _requests.cend()) { + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): request req=%2 for offset=%3 not found in _requests=%4").arg(_id).arg(req).arg(offset).arg(serializereqs(_requests))); + return loadNext(); + } + if (result.type() != mtpc_upload_file) { + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): bad cons received! %2").arg(_id).arg(result.type())); + return cancel(true); + } int32 limit = (_locationType == UnknownFileLocation) ? DownloadPartSize : DocumentDownloadPartSize; int32 dcIndex = i.value(); @@ -428,6 +461,9 @@ void mtpFileLoader::partLoaded(int32 offset, const MTPupload_File &result, mtpRe const MTPDupload_file &d(result.c_upload_file()); const string &bytes(d.vbytes.c_string().v); + + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): got part with offset=%2, bytes=%3, _queue->queries=%4, _nextRequestOffset=%5, _requests=%6").arg(_id).arg(offset).arg(bytes.size()).arg(_queue->queries).arg(_nextRequestOffset).arg(serializereqs(_requests))); + if (bytes.size()) { if (_fileIsOpen) { int64 fsize = _file.size(); @@ -502,6 +538,8 @@ void mtpFileLoader::partLoaded(int32 offset, const MTPupload_File &result, mtpRe Local::writeImage(storageKey(*_location), StorageImageSaved(mtpToStorageType(_type), _data)); } } + } else { + if (DebugLogging::FileLoader() && _id) DEBUG_LOG(("FileLoader(%1): not done yet, _lastComplete=%2, _size=%3, _nextRequestOffset=%4, _requests=%5").arg(_id).arg(Logs::b(_lastComplete)).arg(_size).arg(_nextRequestOffset).arg(serializereqs(_requests))); } emit progress(this); loadNext(); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index a6c0b8d88..a21faec32 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -811,11 +811,23 @@ void SettingsInner::keyPressEvent(QKeyEvent *e) { Ui::showLayer(box); from = size; break; - } else if (str == qstr("loadlang")) { - chooseCustomLang(); + } else if (str == qstr("loadlang")) { + chooseCustomLang(); + } else if (str == qstr("debugfiles") && cDebug()) { + if (DebugLogging::FileLoader()) { + Global::RefDebugLoggingFlags() &= ~DebugLogging::FileLoaderFlag; + } else { + Global::RefDebugLoggingFlags() |= DebugLogging::FileLoaderFlag; + } + Ui::showLayer(new InformBox(DebugLogging::FileLoader() ? "Enabled file download logging" : "Disabled file download logging")); } else if (str == qstr("crashplease")) { t_assert(!"Crashed in Settings!"); - } else if (qsl("debugmode").startsWith(str) || qsl("testmode").startsWith(str) || qsl("loadlang").startsWith(str) || qsl("crashplease").startsWith(str)) { + } else if ( + qsl("debugmode").startsWith(str) || + qsl("testmode").startsWith(str) || + qsl("loadlang").startsWith(str) || + qsl("debugfiles").startsWith(str) || + qsl("crashplease").startsWith(str)) { break; } ++from; From baf1e31b76136ab96a0e15a45776403547650d58 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 Mar 2016 13:18:30 +0300 Subject: [PATCH 02/10] circled profile images --- Telegram/SourceFiles/boxes/contactsbox.cpp | 10 +-- Telegram/SourceFiles/boxes/photosendbox.cpp | 12 +-- Telegram/SourceFiles/dialogswidget.cpp | 19 ++-- Telegram/SourceFiles/dropdown.cpp | 10 +-- Telegram/SourceFiles/facades.cpp | 4 + Telegram/SourceFiles/facades.h | 3 + Telegram/SourceFiles/gui/images.cpp | 96 +++++++++++++++++---- Telegram/SourceFiles/gui/images.h | 13 ++- Telegram/SourceFiles/history.cpp | 29 +++---- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/layout.cpp | 18 ++-- Telegram/SourceFiles/localstorage.cpp | 6 +- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mediaview.cpp | 10 +-- Telegram/SourceFiles/profilewidget.cpp | 6 +- Telegram/SourceFiles/pspecific_wnd.cpp | 12 +-- Telegram/SourceFiles/settingswidget.cpp | 6 +- Telegram/SourceFiles/structs.cpp | 54 +++++++++--- Telegram/SourceFiles/structs.h | 23 +++-- Telegram/SourceFiles/window.cpp | 9 +- 20 files changed, 224 insertions(+), 120 deletions(-) diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 833054800..72d9397c2 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -362,7 +362,7 @@ void ContactsInner::loadProfilePhotos(int32 yFrom) { preloadFrom != _contacts->list.end && (_newItemHeight + preloadFrom->pos * _rowHeight) < yTo; preloadFrom = preloadFrom->next ) { - preloadFrom->history->peer->photo->load(); + preloadFrom->history->peer->loadUserpic(); } } } else if (!_filtered.isEmpty()) { @@ -373,7 +373,7 @@ void ContactsInner::loadProfilePhotos(int32 yFrom) { if (to > _filtered.size()) to = _filtered.size(); for (; from < to; ++from) { - _filtered[from]->history->peer->photo->load(); + _filtered[from]->history->peer->loadUserpic(); } } } @@ -445,7 +445,7 @@ void ContactsInner::paintDialog(Painter &p, PeerData *peer, ContactData *data, b } p.fillRect(0, 0, width(), _rowHeight, inverse ? st::contactsBgActive : (sel ? st::contactsBgOver : st::white)); p.setPen(inverse ? st::white : st::black); - p.drawPixmapLeft(st::contactsPadding.left(), st::contactsPadding.top(), width(), peer->photo->pix(st::contactsPhotoSize)); + peer->paintUserpicLeft(p, st::contactsPhotoSize, st::contactsPadding.left(), st::contactsPadding.top(), width()); int32 namex = st::contactsPadding.left() + st::contactsPhotoSize + st::contactsPadding.left(); int32 iconw = (_chat || _creating != CreatingGroupNone) ? (st::contactsCheckPosition.x() * 2 + st::contactsCheckIcon.pxWidth()) : 0; @@ -1909,7 +1909,7 @@ void MembersInner::paintDialog(Painter &p, PeerData *peer, MemberData *data, boo UserData *user = peer->asUser(); p.fillRect(0, 0, width(), _rowHeight, (sel ? st::contactsBgOver : st::white)->b); - p.drawPixmapLeft(st::contactsPadding.left(), st::contactsPadding.top(), width(), peer->photo->pix(st::contactsPhotoSize)); + peer->paintUserpicLeft(p, st::contactsPhotoSize, st::contactsPadding.left(), st::contactsPadding.top(), width()); p.setPen(st::black); @@ -1994,7 +1994,7 @@ void MembersInner::loadProfilePhotos(int32 yFrom) { if (to > _rows.size()) to = _rows.size(); for (; from < to; ++from) { - _rows[from]->photo->load(); + _rows[from]->loadUserpic(); } } } diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index 487e2d537..cfe7664f3 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -82,7 +82,7 @@ PhotoSendBox::PhotoSendBox(const FileLoadResultPtr &file) : AbstractBox(st::boxW maxH = limitH; } } - _thumb = imagePix(_file->thumb.toImage(), maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), true, true, false, maxW, maxH); + _thumb = imagePix(_file->thumb.toImage(), maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), ImagePixSmooth | ImagePixBlurred, maxW, maxH); } else { for (PreparedPhotoThumbs::const_iterator i = _file->photoThumbs.cbegin(), e = _file->photoThumbs.cend(); i != e; ++i) { if (i->width() >= maxW && i->height() >= maxH) { @@ -124,7 +124,7 @@ PhotoSendBox::PhotoSendBox(const FileLoadResultPtr &file) : AbstractBox(st::boxW } else { _thumbw = st::msgFileThumbSize; } - _thumb = imagePix(_thumb.toImage(), _thumbw * cIntRetinaFactor(), 0, true, false, true, st::msgFileThumbSize, st::msgFileThumbSize); + _thumb = imagePix(_thumb.toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRounded, st::msgFileThumbSize, st::msgFileThumbSize); } _name.setText(st::semiboldFont, _file->filename, _textNameOptions); @@ -274,7 +274,7 @@ void PhotoSendBox::paintEvent(QPaintEvent *e) { p.drawSpriteCenter(inner, _isImage ? st::msgFileOutImage : st::msgFileOutFile); } else { - p.drawPixmapLeft(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), width(), userDefPhoto(1)->pixRounded(st::msgFileSize)); + p.drawPixmapLeft(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), width(), userDefPhoto(1)->pixCircled(st::msgFileSize)); } p.setFont(st::semiboldFont); p.setPen(st::black); @@ -428,7 +428,7 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) } else { _thumbw = st::msgFileThumbSize; } - _thumb = imagePix(image->pix().toImage(), _thumbw * cIntRetinaFactor(), 0, true, false, true, st::msgFileThumbSize, st::msgFileThumbSize); + _thumb = imagePix(image->pix().toImage(), _thumbw * cIntRetinaFactor(), 0, ImagePixSmooth | ImagePixRounded, st::msgFileThumbSize, st::msgFileThumbSize); } if (doc) { @@ -459,11 +459,11 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) maxH = limitH; } } - _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), true, true, false, maxW, maxH); + _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), ImagePixSmooth | ImagePixBlurred, maxW, maxH); } else { maxW = dimensions.width(); maxH = dimensions.height(); - _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), true, false, false, maxW, maxH); + _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), ImagePixSmooth | ImagePixRounded, maxW, maxH); } int32 tw = _thumb.width(), th = _thumb.height(); if (!tw || !th) { diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index a90b299a7..0b7aa9d19 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -247,11 +247,8 @@ void DialogsInner::peopleResultPaint(PeerData *peer, Painter &p, int32 w, bool a History *history = App::history(peer->id); - if (peer->migrateTo()) { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, peer->migrateTo()->photo->pix(st::dlgPhotoSize)); - } else { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, peer->photo->pix(st::dlgPhotoSize)); - } + PeerData *userpicPeer = (peer->migrateTo() ? peer->migrateTo() : peer); + userpicPeer->paintUserpicLeft(p, st::dlgPhotoSize, st::dlgPaddingHor, st::dlgPaddingVer, fullWidth()); int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding; int32 namewidth = w - nameleft - st::dlgPaddingHor; @@ -299,7 +296,7 @@ void DialogsInner::searchInPeerPaint(Painter &p, int32 w, bool onlyBackground) c p.fillRect(fullRect, st::dlgBG->b); if (onlyBackground) return; - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, _searchInPeer->photo->pix(st::dlgPhotoSize)); + _searchInPeer->paintUserpicLeft(p, st::dlgPhotoSize, st::dlgPaddingHor, st::dlgPaddingVer, fullWidth()); int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding; int32 namewidth = w - nameleft - st::dlgPaddingHor * 2 - st::btnCancelSearch.width; @@ -1373,7 +1370,7 @@ void DialogsInner::loadPeerPhotos(int32 yFrom) { if (yFrom < otherStart) { dialogs.list.adjustCurrent(yFrom, st::dlgHeight); for (DialogRow *row = dialogs.list.current; row != dialogs.list.end && (row->pos * st::dlgHeight) < yTo; row = row->next) { - row->history->peer->photo->load(); + row->history->peer->loadUserpic(); } yFrom = 0; } else { @@ -1383,7 +1380,7 @@ void DialogsInner::loadPeerPhotos(int32 yFrom) { if (yTo > 0) { contactsNoDialogs.list.adjustCurrent(yFrom, st::dlgHeight); for (DialogRow *row = contactsNoDialogs.list.current; row != contactsNoDialogs.list.end && (row->pos * st::dlgHeight) < yTo; row = row->next) { - row->history->peer->photo->load(); + row->history->peer->loadUserpic(); } } } else if (_state == FilteredState || _state == SearchedState) { @@ -1394,7 +1391,7 @@ void DialogsInner::loadPeerPhotos(int32 yFrom) { if (to > _filterResults.size()) to = _filterResults.size(); for (; from < to; ++from) { - _filterResults[from]->history->peer->photo->load(); + _filterResults[from]->history->peer->loadUserpic(); } } @@ -1405,7 +1402,7 @@ void DialogsInner::loadPeerPhotos(int32 yFrom) { if (to > _peopleResults.size()) to = _peopleResults.size(); for (; from < to; ++from) { - _peopleResults[from]->photo->load(); + _peopleResults[from]->loadUserpic(); } } from = (yFrom > filteredOffset() + ((_peopleResults.isEmpty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight) ? ((yFrom - filteredOffset() - (_peopleResults.isEmpty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dlgHeight)) : 0) - _filterResults.size() - _peopleResults.size(); @@ -1415,7 +1412,7 @@ void DialogsInner::loadPeerPhotos(int32 yFrom) { if (to > _searchResults.size()) to = _searchResults.size(); for (; from < to; ++from) { - _searchResults[from]->_item->history()->peer->photo->load(); + _searchResults[from]->_item->history()->peer->loadUserpic(); } } } diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 5a4823d1c..02b8e4f5e 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3944,8 +3944,8 @@ void MentionsInner::paintEvent(QPaintEvent *e) { second = st::mentionFont->elided(second, unamewidth - firstwidth); } } - user->photo->load(); - p.drawPixmap(st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), user->photo->pixRounded(st::mentionPhotoSize)); + user->loadUserpic(); + user->paintUserpicLeft(p, st::mentionPhotoSize, st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), width()); user->nameText.drawElided(p, 2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop, namewidth); p.setFont(st::mentionFont->f); @@ -3986,10 +3986,8 @@ void MentionsInner::paintEvent(QPaintEvent *e) { if (hasUsername || botStatus == 0 || botStatus == 2) { toHighlight += '@' + user->username; } - if (true || _parent->chat() || botStatus == 0 || botStatus == 2) { - user->photo->load(); - p.drawPixmap(st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), user->photo->pixRounded(st::mentionPhotoSize)); - } + user->loadUserpic(); + user->paintUserpicLeft(p, st::mentionPhotoSize, st::mentionPadding.left(), i * st::mentionHeight + st::mentionPadding.top(), width()); int32 addleft = 0, widthleft = mentionwidth; QString first = (_parent->filter().size() < 2) ? QString() : ('/' + toHighlight.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('/' + toHighlight) : toHighlight.mid(_parent->filter().size() - 1); diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 63b8df37c..e26e44f52 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -375,6 +375,8 @@ struct GlobalDataStruct { int32 EditTimeLimit = 172800; Global::HiddenPinnedMessagesMap HiddenPinnedMessages; + + Global::CircleMasksMap CircleMasks; }; GlobalDataStruct *GlobalData = 0; @@ -421,4 +423,6 @@ namespace Global { DefineVar(Global, HiddenPinnedMessagesMap, HiddenPinnedMessages); + DefineRefVar(Global, CircleMasksMap, CircleMasks); + }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 26bcf391d..d0f2737d2 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -170,6 +170,9 @@ namespace Global { typedef QMap HiddenPinnedMessagesMap; DeclareVar(HiddenPinnedMessagesMap, HiddenPinnedMessages); + typedef QMap CircleMasksMap; + DeclareRefVar(CircleMasksMap, CircleMasks); + }; namespace Adaptive { diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index eda121103..9da1f933a 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -47,6 +47,7 @@ namespace { static const uint64 ColoredCacheSkip = 0x2000000000000000LLU; static const uint64 BlurredColoredCacheSkip = 0x3000000000000000LLU; static const uint64 RoundedCacheSkip = 0x4000000000000000LLU; + static const uint64 CircledCacheSkip = 0x5000000000000000LLU; } StorageImageLocation StorageImageLocation::Null; @@ -106,7 +107,7 @@ const QPixmap &Image::pix(int32 w, int32 h) const { uint64 k = (uint64(w) << 32) | uint64(h); Sizes::const_iterator i = _sizesCache.constFind(k); if (i == _sizesCache.cend()) { - QPixmap p(pixNoCache(w, h, true)); + QPixmap p(pixNoCache(w, h, ImagePixSmooth)); if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); i = _sizesCache.insert(k, p); if (!p.isNull()) { @@ -128,7 +129,29 @@ const QPixmap &Image::pixRounded(int32 w, int32 h) const { uint64 k = RoundedCacheSkip | (uint64(w) << 32) | uint64(h); Sizes::const_iterator i = _sizesCache.constFind(k); if (i == _sizesCache.cend()) { - QPixmap p(pixNoCache(w, h, true, false, true)); + QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixRounded)); + if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); + i = _sizesCache.insert(k, p); + if (!p.isNull()) { + globalAcquiredSize += int64(p.width()) * p.height() * 4; + } + } + return i.value(); +} + +const QPixmap &Image::pixCircled(int32 w, int32 h) const { + checkload(); + + if (w <= 0 || !width() || !height()) { + w = width(); + } else if (cRetina()) { + w *= cIntRetinaFactor(); + h *= cIntRetinaFactor(); + } + uint64 k = CircledCacheSkip | (uint64(w) << 32) | uint64(h); + Sizes::const_iterator i = _sizesCache.constFind(k); + if (i == _sizesCache.cend()) { + QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixCircled)); if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); i = _sizesCache.insert(k, p); if (!p.isNull()) { @@ -150,7 +173,7 @@ const QPixmap &Image::pixBlurred(int32 w, int32 h) const { uint64 k = BlurredCacheSkip | (uint64(w) << 32) | uint64(h); Sizes::const_iterator i = _sizesCache.constFind(k); if (i == _sizesCache.cend()) { - QPixmap p(pixNoCache(w, h, true, true)); + QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixBlurred)); if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); i = _sizesCache.insert(k, p); if (!p.isNull()) { @@ -219,7 +242,7 @@ const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) co if (i != _sizesCache.cend()) { globalAcquiredSize -= int64(i->width()) * i->height() * 4; } - QPixmap p(pixNoCache(w, h, true, false, true, outerw, outerh)); + QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixRounded, outerw, outerh)); if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); i = _sizesCache.insert(k, p); if (!p.isNull()) { @@ -229,7 +252,7 @@ const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) co return i.value(); } -const QPixmap &Image::pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 outerh) const { +const QPixmap &Image::pixBlurredSingle(int w, int h, int32 outerw, int32 outerh) const { checkload(); if (w <= 0 || !width() || !height()) { @@ -244,7 +267,7 @@ const QPixmap &Image::pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 out if (i != _sizesCache.cend()) { globalAcquiredSize -= int64(i->width()) * i->height() * 4; } - QPixmap p(pixNoCache(w, h, true, true, true, outerw, outerh)); + QPixmap p(pixNoCache(w, h, ImagePixSmooth | ImagePixBlurred | ImagePixRounded, outerw, outerh)); if (cRetina()) p.setDevicePixelRatio(cRetinaFactor()); i = _sizesCache.insert(k, p); if (!p.isNull()) { @@ -375,6 +398,42 @@ yi += stride; return img; } +const QPixmap &circleMask(int width, int height) { + t_assert(Global::started()); + + uint64 key = uint64(uint32(width)) << 32 | uint64(uint32(height)); + + Global::CircleMasksMap &masks(Global::RefCircleMasks()); + auto i = masks.constFind(key); + if (i == masks.cend()) { + QImage mask(width, height, QImage::Format_ARGB32_Premultiplied); + mask.fill(st::transparent); + { + Painter p(&mask); + p.setRenderHint(QPainter::HighQualityAntialiasing); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + p.setBrush(st::white); + p.setPen(Qt::NoPen); + p.drawEllipse(0, 0, width, height); + } + i = masks.insert(key, QPixmap::fromImage(mask)); + } + return i.value(); +} + +void imageCircle(QImage &img) { + t_assert(!img.isNull()); + + img.setDevicePixelRatio(cRetinaFactor()); + img = img.convertToFormat(QImage::Format_ARGB32_Premultiplied); + t_assert(!img.isNull()); + + QPixmap mask = circleMask(img.width(), img.height()); + Painter p(&img); + p.setCompositionMode(QPainter::CompositionMode_DestinationIn); + p.drawPixmap(0, 0, mask); +} + void imageRound(QImage &img) { t_assert(!img.isNull()); @@ -435,18 +494,18 @@ QImage imageColored(const style::color &add, QImage img) { return img; } -QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) { +QPixmap imagePix(QImage img, int32 w, int32 h, ImagePixOptions options, int32 outerw, int32 outerh) { t_assert(!img.isNull()); - if (blurred) { + if (options.testFlag(ImagePixBlurred)) { img = imageBlur(img); t_assert(!img.isNull()); } if (w <= 0 || (w == img.width() && (h <= 0 || h == img.height()))) { } else if (h <= 0) { - img = img.scaledToWidth(w, smooth ? Qt::SmoothTransformation : Qt::FastTransformation); + img = img.scaledToWidth(w, options.testFlag(ImagePixSmooth) ? Qt::SmoothTransformation : Qt::FastTransformation); t_assert(!img.isNull()); } else { - img = img.scaled(w, h, Qt::IgnoreAspectRatio, smooth ? Qt::SmoothTransformation : Qt::FastTransformation); + img = img.scaled(w, h, Qt::IgnoreAspectRatio, options.testFlag(ImagePixSmooth) ? Qt::SmoothTransformation : Qt::FastTransformation); t_assert(!img.isNull()); } if (outerw > 0 && outerh > 0) { @@ -467,7 +526,10 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r t_assert(!img.isNull()); } } - if (rounded) { + if (options.testFlag(ImagePixCircled)) { + imageCircle(img); + t_assert(!img.isNull()); + } else if (options.testFlag(ImagePixRounded)) { imageRound(img); t_assert(!img.isNull()); } @@ -475,7 +537,7 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r return QPixmap::fromImage(img, Qt::ColorOnly); } -QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) const { +QPixmap Image::pixNoCache(int w, int h, ImagePixOptions options, int outerw, int outerh) const { if (!loading()) const_cast(this)->load(); restore(); @@ -483,7 +545,7 @@ QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool roun if (h <= 0 && height() > 0) { h = qRound(width() * w / float64(height())); } - return blank()->pixNoCache(w, h, smooth, blurred, rounded, outerw, outerh); + return blank()->pixNoCache(w, h, options, outerw, outerh); } if (isNull() && outerw > 0 && outerh > 0) { @@ -506,11 +568,15 @@ QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool roun p.fillRect(qMax(0, (outerw - w) / 2), qMax(0, (outerh - h) / 2), qMin(result.width(), w), qMin(result.height(), h), st::white); } - if (rounded) imageRound(result); + if (options.testFlag(ImagePixCircled)) { + imageCircle(result); + } else if (options.testFlag(ImagePixRounded)) { + imageRound(result); + } return QPixmap::fromImage(result, Qt::ColorOnly); } - return imagePix(_data.toImage(), w, h, smooth, blurred, rounded, outerw, outerh); + return imagePix(_data.toImage(), w, h, options, outerw, outerh); } QPixmap Image::pixColoredNoCache(const style::color &add, int32 w, int32 h, bool smooth) const { diff --git a/Telegram/SourceFiles/gui/images.h b/Telegram/SourceFiles/gui/images.h index 63c771379..0622dca27 100644 --- a/Telegram/SourceFiles/gui/images.h +++ b/Telegram/SourceFiles/gui/images.h @@ -107,7 +107,15 @@ inline bool operator!=(const StorageImageLocation &a, const StorageImageLocation return !(a == b); } -QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh); +enum ImagePixOption { + ImagePixSmooth = 0x01, + ImagePixBlurred = 0x02, + ImagePixRounded = 0x04, + ImagePixCircled = 0x08, +}; +Q_DECLARE_FLAGS(ImagePixOptions, ImagePixOption); +Q_DECLARE_OPERATORS_FOR_FLAGS(ImagePixOptions); +QPixmap imagePix(QImage img, int w, int h, ImagePixOptions options, int outerw, int outerh); class DelayedStorageImage; @@ -145,12 +153,13 @@ public: const QPixmap &pix(int32 w = 0, int32 h = 0) const; const QPixmap &pixRounded(int32 w = 0, int32 h = 0) const; + const QPixmap &pixCircled(int32 w = 0, int32 h = 0) const; const QPixmap &pixBlurred(int32 w = 0, int32 h = 0) const; const QPixmap &pixColored(const style::color &add, int32 w = 0, int32 h = 0) const; const QPixmap &pixBlurredColored(const style::color &add, int32 w = 0, int32 h = 0) const; const QPixmap &pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) const; const QPixmap &pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 outerh) const; - QPixmap pixNoCache(int32 w = 0, int32 h = 0, bool smooth = false, bool blurred = false, bool rounded = false, int32 outerw = -1, int32 outerh = -1) const; + QPixmap pixNoCache(int w = 0, int h = 0, ImagePixOptions options = 0, int outerw = -1, int outerh = -1) const; QPixmap pixColoredNoCache(const style::color &add, int32 w = 0, int32 h = 0, bool smooth = false) const; QPixmap pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h = 0) const; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 846ae6e76..5eb4d1c4e 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -98,11 +98,8 @@ void DialogRow::paint(Painter &p, int32 w, bool act, bool sel, bool onlyBackgrou p.fillRect(fullRect, (act ? st::dlgActiveBG : (sel ? st::dlgHoverBG : st::dlgBG))->b); if (onlyBackground) return; - if (history->peer->migrateTo()) { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->migrateTo()->photo->pix(st::dlgPhotoSize)); - } else { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->photo->pix(st::dlgPhotoSize)); - } + PeerData *userpicPeer = (history->peer->migrateTo() ? history->peer->migrateTo() : history->peer); + userpicPeer->paintUserpicLeft(p, st::dlgPhotoSize, st::dlgPaddingHor, st::dlgPaddingVer, w); int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding; int32 namewidth = w - nameleft - st::dlgPaddingHor; @@ -205,11 +202,8 @@ void FakeDialogRow::paint(Painter &p, int32 w, bool act, bool sel, bool onlyBack if (onlyBackground) return; History *history = _item->history(); - if (history->peer->migrateTo()) { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->migrateTo()->photo->pix(st::dlgPhotoSize)); - } else { - p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->photo->pix(st::dlgPhotoSize)); - } + PeerData *userpicPeer = (history->peer->migrateTo() ? history->peer->migrateTo() : history->peer); + userpicPeer->paintUserpicLeft(p, st::dlgPhotoSize, st::dlgPaddingHor, st::dlgPaddingVer, w); int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding; int32 namewidth = w - nameleft - st::dlgPaddingHor; @@ -1506,7 +1500,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo } else if (peer->isChannel()) { peer->asChannel()->setPhoto(MTP_chatPhoto(*smallLoc, *bigLoc), photo ? photo->id : 0); } - peer->photo->load(); + peer->loadUserpic(); } } } @@ -5054,7 +5048,7 @@ void HistoryContact::initDimensions(const HistoryItem *parent) { _contact = _userId ? App::userLoaded(_userId) : 0; if (_contact) { - _contact->photo->load(); + _contact->loadUserpic(); } if (_contact && _contact->contact > 0) { _linkl.reset(new SendMessageLink(_contact)); @@ -5106,11 +5100,10 @@ void HistoryContact::draw(Painter &p, const HistoryItem *parent, const QRect &r, linktop = st::msgFileThumbLinkTop; QRect rthumb(rtlrect(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, width)); - if (_contact && _contact->photo->loaded()) { - QPixmap thumb = _contact->photo->pixRounded(st::msgFileThumbSize, st::msgFileThumbSize); - p.drawPixmap(rthumb.topLeft(), thumb); + if (_contact) { + _contact->paintUserpic(p, st::msgFileThumbSize, rthumb.x(), rthumb.y()); } else { - p.drawPixmap(rthumb.topLeft(), userDefPhoto(_contact ? _contact->colorIndex : (qAbs(_userId) % UserColorsCount))->pixRounded(st::msgFileThumbSize, st::msgFileThumbSize)); + p.drawPixmap(rthumb.topLeft(), userDefPhoto(qAbs(_userId) % UserColorsCount)->pixCircled(st::msgFileThumbSize, st::msgFileThumbSize)); } if (selected) { App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); @@ -5127,7 +5120,7 @@ void HistoryContact::draw(Painter &p, const HistoryItem *parent, const QRect &r, statustop = st::msgFileStatusTop; QRect inner(rtlrect(st::msgFilePadding.left(), st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, width)); - p.drawPixmap(inner.topLeft(), userDefPhoto(qAbs(parent->id) % UserColorsCount)->pixRounded(st::msgFileSize, st::msgFileSize)); + p.drawPixmap(inner.topLeft(), userDefPhoto(qAbs(parent->id) % UserColorsCount)->pixCircled(st::msgFileSize, st::msgFileSize)); } int32 namewidth = width - nameleft - nameright; @@ -6705,7 +6698,7 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (displayFromPhoto()) { int32 photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - p.drawPixmap(photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize, author()->photo->pixRounded(st::msgPhotoSize)); + author()->paintUserpic(p, st::msgPhotoSize, photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize); } if (width < 1) return; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 0b8b34fb8..ecbdfcb6a 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6744,7 +6744,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { th = 90; } thumbSize = MTP_photoSize(MTP_string(""), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(tw), MTP_int(th), MTP_int(0)); - thumb = result->thumb->pixNoCache(tw, th, true, false, false); + thumb = result->thumb->pixNoCache(tw, th, ImagePixSmooth); } else { tw = th = 0; thumbSize = MTP_photoSizeEmpty(MTP_string("")); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index b7bfc4ab0..ab7c34696 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -866,7 +866,9 @@ void LayoutOverviewDocument::paint(Painter &p, const QRect &clip, uint32 selecti if (_data->thumb->loaded()) { if (_thumb.isNull() || loaded != _thumbForLoaded) { _thumbForLoaded = loaded; - _thumb = _data->thumb->pixNoCache(_thumbw, 0, true, !_thumbForLoaded, false, st::overviewFileSize, st::overviewFileSize); + ImagePixOptions options = ImagePixSmooth; + if (!_thumbForLoaded) options |= ImagePixBlurred; + _thumb = _data->thumb->pixNoCache(_thumbw, 0, options, st::overviewFileSize, st::overviewFileSize); } p.drawPixmap(rthumb.topLeft(), _thumb); } else { @@ -1574,7 +1576,7 @@ void LayoutInlineGif::prepareThumb(int32 width, int32 height, const QSize &frame if (doc && !doc->thumb->isNull()) { if (doc->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - _thumb = doc->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), true, false, false, width, height); + _thumb = doc->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), ImagePixSmooth, width, height); } } else { doc->thumb->load(); @@ -1582,7 +1584,7 @@ void LayoutInlineGif::prepareThumb(int32 width, int32 height, const QSize &frame } else if (_result && !_result->thumb_url.isEmpty()) { if (_result->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - _thumb = _result->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), true, false, false, width, height); + _thumb = _result->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), ImagePixSmooth, width, height); } } else { _result->thumb->load(); @@ -1792,13 +1794,13 @@ void LayoutInlinePhoto::prepareThumb(int32 width, int32 height, const QSize &fra if (photo) { if (photo->medium->loaded()) { if (!_thumbLoaded || _thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - _thumb = photo->medium->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), true, false, false, width, height); + _thumb = photo->medium->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), ImagePixSmooth, width, height); } _thumbLoaded = true; } else { if (photo->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - _thumb = photo->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), true, false, false, width, height); + _thumb = photo->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), ImagePixSmooth, width, height); } } photo->medium->load(); @@ -1806,7 +1808,7 @@ void LayoutInlinePhoto::prepareThumb(int32 width, int32 height, const QSize &fra } else { if (_result->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - _thumb = _result->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), true, false, false, width, height); + _thumb = _result->thumb->pixNoCache(frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), ImagePixSmooth, width, height); } } else { _result->thumb->load(); @@ -1933,7 +1935,7 @@ void LayoutInlineWebVideo::prepareThumb(int32 width, int32 height) const { w = width; } } - _thumb = _result->thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), true, false, false, width, height); + _thumb = _result->thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), ImagePixSmooth, width, height); } } else { _result->thumb->load(); @@ -2081,7 +2083,7 @@ void LayoutInlineArticle::prepareThumb(int32 width, int32 height) const { w = width; } } - _thumb = _result->thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), true, false, false, width, height); + _thumb = _result->thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), ImagePixSmooth, width, height); } } else { _result->thumb->load(); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 118ba1c92..4eba35bfe 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -3616,7 +3616,7 @@ namespace Local { user->inputUser = MTP_inputUser(MTP_int(peerToUser(user->id)), MTP_long((user->access == UserNoAccess) ? 0 : user->access)); } - user->photo = photoLoc.isNull() ? ImagePtr(userDefPhoto(user->colorIndex)) : ImagePtr(photoLoc); + user->setUserpic(photoLoc.isNull() ? ImagePtr(userDefPhoto(user->colorIndex)) : ImagePtr(photoLoc)); } } else if (result->isChat()) { ChatData *chat = result->asChat(); @@ -3644,7 +3644,7 @@ namespace Local { chat->input = MTP_inputPeerChat(MTP_int(peerToChat(chat->id))); chat->inputChat = MTP_int(peerToChat(chat->id)); - chat->photo = photoLoc.isNull() ? ImagePtr(chatDefPhoto(chat->colorIndex)) : ImagePtr(photoLoc); + chat->setUserpic(photoLoc.isNull() ? ImagePtr(chatDefPhoto(chat->colorIndex)) : ImagePtr(photoLoc)); } } else if (result->isChannel()) { ChannelData *channel = result->asChannel(); @@ -3666,7 +3666,7 @@ namespace Local { channel->input = MTP_inputPeerChannel(MTP_int(peerToChannel(channel->id)), MTP_long(access)); channel->inputChannel = MTP_inputChannel(MTP_int(peerToChannel(channel->id)), MTP_long(access)); - channel->photo = photoLoc.isNull() ? ImagePtr((channel->isMegagroup() ? chatDefPhoto(channel->colorIndex) : channelDefPhoto(channel->colorIndex))) : ImagePtr(photoLoc); + channel->setUserpic(photoLoc.isNull() ? ImagePtr((channel->isMegagroup() ? chatDefPhoto(channel->colorIndex) : channelDefPhoto(channel->colorIndex))) : ImagePtr(photoLoc)); } } if (!wasLoaded) { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index fb337c85b..5c02a99e4 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4414,7 +4414,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { UserData *user = App::userLoaded(d.vuser_id.v); if (user) { user->setPhoto(d.vphoto); - user->photo->load(); + user->loadUserpic(); if (mtpIsTrue(d.vprevious)) { user->photosCount = -1; user->photos.clear(); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index fc1734194..853603304 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -967,7 +967,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty if (!_doc->data().isEmpty() && _doc->isAnimation()) { if (!_gif) { if (_doc->dimensions.width() && _doc->dimensions.height()) { - _current = _doc->thumb->pixNoCache(_doc->dimensions.width(), _doc->dimensions.height(), true, true, false, _doc->dimensions.width(), _doc->dimensions.height()); + _current = _doc->thumb->pixNoCache(_doc->dimensions.width(), _doc->dimensions.height(), ImagePixSmooth | ImagePixBlurred, _doc->dimensions.width(), _doc->dimensions.height()); } _gif = new ClipReader(location, _doc->data(), func(this, &MediaView::clipCallback)); } @@ -975,7 +975,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty if (_doc->isAnimation()) { if (!_gif) { if (_doc->dimensions.width() && _doc->dimensions.height()) { - _current = _doc->thumb->pixNoCache(_doc->dimensions.width(), _doc->dimensions.height(), true, true, false, _doc->dimensions.width(), _doc->dimensions.height()); + _current = _doc->thumb->pixNoCache(_doc->dimensions.width(), _doc->dimensions.height(), ImagePixSmooth | ImagePixBlurred, _doc->dimensions.width(), _doc->dimensions.height()); } _gif = new ClipReader(location, _doc->data(), func(this, &MediaView::clipCallback)); } @@ -1116,17 +1116,17 @@ void MediaView::paintEvent(QPaintEvent *e) { int32 w = _width * cIntRetinaFactor(); if (_full <= 0 && _photo->loaded()) { int32 h = int((_photo->full->height() * (qreal(w) / qreal(_photo->full->width()))) + 0.9999); - _current = _photo->full->pixNoCache(w, h, true); + _current = _photo->full->pixNoCache(w, h, ImagePixSmooth); if (cRetina()) _current.setDevicePixelRatio(cRetinaFactor()); _full = 1; } else if (_full < 0 && _photo->medium->loaded()) { int32 h = int((_photo->full->height() * (qreal(w) / qreal(_photo->full->width()))) + 0.9999); - _current = _photo->medium->pixNoCache(w, h, true, true); + _current = _photo->medium->pixNoCache(w, h, ImagePixSmooth | ImagePixBlurred); if (cRetina()) _current.setDevicePixelRatio(cRetinaFactor()); _full = 0; } else if (_current.isNull() && _photo->thumb->loaded()) { int32 h = int((_photo->full->height() * (qreal(w) / qreal(_photo->full->width()))) + 0.9999); - _current = _photo->thumb->pixNoCache(w, h, true, true); + _current = _photo->thumb->pixNoCache(w, h, ImagePixSmooth | ImagePixBlurred); if (cRetina()) _current.setDevicePixelRatio(cRetinaFactor()); } else if (_current.isNull()) { _current = _photo->thumb->pix(); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index c28c5fba1..95dc8911b 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -282,7 +282,7 @@ void ProfileInner::loadProfilePhotos(int32 yFrom) { if (yFrom >= _participants.size()) return; if (yTo > _participants.size()) yTo = _participants.size(); for (int32 i = yFrom; i < yTo; ++i) { - _participants[i]->photo->load(); + _participants[i]->loadUserpic(); } } @@ -832,7 +832,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { // profile top += st::profilePadding.top(); if (_photoLink || _peerUser || (_peerChat && !_peerChat->canEdit()) || (_peerChannel && !_amCreator)) { - p.drawPixmap(_left, top, _peer->photo->pix(st::profilePhotoSize)); + _peer->paintUserpic(p, st::profilePhotoSize, _left, top); } else { if (a_photoOver.current() < 1) { p.drawPixmap(QPoint(_left, top), App::sprite(), st::setPhotoImg); @@ -1019,7 +1019,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { } UserData *user = *i; - p.drawPixmap(_left, top + st::profileListPadding.height(), user->photo->pix(st::profileListPhotoSize)); + user->paintUserpic(p, st::profileListPhotoSize, _left, top + st::profileListPadding.height()); ParticipantData *data = _participantsData[cnt]; if (!data) { data = _participantsData[cnt] = new ParticipantData(); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 898ac1cee..82304ce54 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -3247,10 +3247,8 @@ QString toastImage(const StorageKey &key, PeerData *peer) { v.until = 0; } v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); - if (peer->photo->loaded() && (key.first || key.second)) { - peer->photo->pix().save(v.path, "PNG"); - } else if (!key.first && key.second) { - (peer->isUser() ? userDefPhoto : chatDefPhoto)(peer->colorIndex)->pix().save(v.path, "PNG"); + if (key.first || key.second) { + peer->saveUserpic(v.path); } else { App::wnd()->iconLarge().save(v.path, "PNG"); } @@ -3275,11 +3273,7 @@ bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title StorageKey key; QString imagePath; if (showpix) { - if (peer->photoLoc.isNull() || !peer->photo->loaded()) { - key = StorageKey(0, (peer->isUser() ? 0x1000 : 0x2000) | peer->colorIndex); - } else { - key = storageKey(peer->photoLoc); - } + key = peer->userpicUniqueKey(); } else { key = StorageKey(0, 0); } diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index a21faec32..330d39d24 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -208,7 +208,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) , _logOut(this, lang(lng_settings_logout), st::btnLogout) , _supportGetRequest(0) { if (self()) { - self()->photo->load(); + self()->loadUserpic(); connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); connect(App::api(), SIGNAL(fullPeerUpdated(PeerData*)), this, SLOT(onFullPeerUpdated(PeerData*))); @@ -382,7 +382,7 @@ void SettingsInner::paintEvent(QPaintEvent *e) { updateChatBackground(); } - QPainter p(this); + Painter p(this); p.setClipRect(e->rect()); @@ -399,7 +399,7 @@ void SettingsInner::paintEvent(QPaintEvent *e) { } if (_photoLink) { - p.drawPixmap(_left, top, self()->photo->pix(st::setPhotoSize)); + self()->paintUserpicLeft(p, st::setPhotoSize, _left, top, st::setWidth); } else { if (a_photoOver.current() < 1) { p.drawPixmap(QPoint(_left, top), App::sprite(), st::setPhotoImg); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index ce45404dd..ed5ef5585 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -103,10 +103,10 @@ PeerData::PeerData(const PeerId &id) : id(id) , loaded(false) , colorIndex(peerColorIndex(id)) , color(peerColor(colorIndex)) -, photo((isChat() || isMegagroup()) ? chatDefPhoto(colorIndex) : (isChannel() ? channelDefPhoto(colorIndex) : userDefPhoto(colorIndex))) , photoId(UnknownPeerPhotoId) , nameVersion(0) -, notify(UnknownNotifySettings) { +, notify(UnknownNotifySettings) +, _userpic(isUser() ? userDefPhoto(colorIndex) : ((isChat() || isMegagroup()) ? chatDefPhoto(colorIndex) : channelDefPhoto(colorIndex))) { if (!peerIsUser(id) && !peerIsChannel(id)) updateName(QString(), QString(), QString()); } @@ -154,6 +154,36 @@ void PeerData::updateName(const QString &newName, const QString &newNameOrPhone, } } +void PeerData::setUserpic(ImagePtr userpic) { + _userpic = userpic; +} + +ImagePtr PeerData::currentUserpic() const { + if (_userpic->loaded()) { + return _userpic; + } else if (isUser()) { + return userDefPhoto(colorIndex); + } else if (isMegagroup() || isChat()) { + return chatDefPhoto(colorIndex); + } + return channelDefPhoto(colorIndex); +} + +void PeerData::paintUserpic(Painter &p, int size, int x, int y) const { + p.drawPixmap(x, y, currentUserpic()->pixCircled(size, size)); +} + +StorageKey PeerData::userpicUniqueKey() const { + if (photoLoc.isNull() || !_userpic->loaded()) { + return StorageKey(0, (isUser() ? 0x1000 : ((isChat() || isMegagroup()) ? 0x2000 : 0x3000)) | colorIndex); + } + return storageKey(photoLoc); +} + +void PeerData::saveUserpic(const QString &path) const { + currentUserpic()->pixCircled().save(path, "PNG"); +} + const Text &BotCommand::descriptionText() const { if (_descriptionText.isEmpty() && !_description.isEmpty()) { _descriptionText.setText(st::mentionFont, _description, _textNameOptions); @@ -163,7 +193,7 @@ const Text &BotCommand::descriptionText() const { void UserData::setPhoto(const MTPUserProfilePhoto &p) { // see Local::readPeer as well PhotoId newPhotoId = photoId; - ImagePtr newPhoto = photo; + ImagePtr newPhoto = _userpic; StorageImageLocation newPhotoLoc = photoLoc; switch (p.type()) { case mtpc_userProfilePhoto: { @@ -176,7 +206,7 @@ void UserData::setPhoto(const MTPUserProfilePhoto &p) { // see Local::readPeer a default: { newPhotoId = 0; if (id == ServiceUserId) { - if (photo->isNull()) { + if (_userpic->isNull()) { newPhoto = ImagePtr(QPixmap::fromImage(App::wnd()->iconLarge().scaledToWidth(160, Qt::SmoothTransformation), Qt::ColorOnly), "PNG"); } } else { @@ -185,9 +215,9 @@ void UserData::setPhoto(const MTPUserProfilePhoto &p) { // see Local::readPeer a newPhotoLoc = StorageImageLocation(); } break; } - if (newPhotoId != photoId || newPhoto.v() != photo.v() || newPhotoLoc != photoLoc) { + if (newPhotoId != photoId || newPhoto.v() != _userpic.v() || newPhotoLoc != photoLoc) { photoId = newPhotoId; - photo = newPhoto; + setUserpic(newPhoto); photoLoc = newPhotoLoc; if (App::main()) { emit App::main()->peerPhotoChanged(this); @@ -338,7 +368,7 @@ void UserData::madeAction() { void ChatData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see Local::readPeer as well PhotoId newPhotoId = photoId; - ImagePtr newPhoto = photo; + ImagePtr newPhoto = _userpic; StorageImageLocation newPhotoLoc = photoLoc; switch (p.type()) { case mtpc_chatPhoto: { @@ -357,9 +387,9 @@ void ChatData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see Loc // photoFull = ImagePtr(); } break; } - if (newPhotoId != photoId || newPhoto.v() != photo.v() || newPhotoLoc != photoLoc) { + if (newPhotoId != photoId || newPhoto.v() != _userpic.v() || newPhotoLoc != photoLoc) { photoId = newPhotoId; - photo = newPhoto; + setUserpic(newPhoto); photoLoc = newPhotoLoc; emit App::main()->peerPhotoChanged(this); } @@ -367,7 +397,7 @@ void ChatData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see Loc void ChannelData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see Local::readPeer as well PhotoId newPhotoId = photoId; - ImagePtr newPhoto = photo; + ImagePtr newPhoto = _userpic; StorageImageLocation newPhotoLoc = photoLoc; switch (p.type()) { case mtpc_chatPhoto: { @@ -386,9 +416,9 @@ void ChannelData::setPhoto(const MTPChatPhoto &p, const PhotoId &phId) { // see // photoFull = ImagePtr(); } break; } - if (newPhotoId != photoId || newPhoto.v() != photo.v() || newPhotoLoc != photoLoc) { + if (newPhotoId != photoId || newPhoto.v() != _userpic.v() || newPhotoLoc != photoLoc) { photoId = newPhotoId; - photo = newPhoto; + setUserpic(newPhoto); photoLoc = newPhotoLoc; if (App::main()) emit App::main()->peerPhotoChanged(this); } diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 23616afcd..d8630ccc0 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -272,7 +272,18 @@ public: int32 colorIndex; style::color color; - ImagePtr photo; + + void setUserpic(ImagePtr userpic); + void paintUserpic(Painter &p, int size, int x, int y) const; + void paintUserpicLeft(Painter &p, int size, int x, int y, int w) const { + paintUserpic(p, size, rtl() ? (w - x - size) : x, y); + } + void loadUserpic(bool loadFirst = false, bool prior = true) { + _userpic->load(loadFirst, prior); + } + StorageKey userpicUniqueKey() const; + void saveUserpic(const QString &path) const; + PhotoId photoId; StorageImageLocation photoLoc; @@ -280,12 +291,14 @@ public: NotifySettingsPtr notify; -private: + PeerData(const PeerData &other) = delete; + PeerData &operator=(const PeerData &other) = delete; + +protected: PeerData(const PeerId &id); - friend class UserData; - friend class ChatData; - friend class ChannelData; + ImagePtr _userpic; + ImagePtr currentUserpic() const; }; static const uint64 UserNoAccess = 0xFFFFFFFFFFFFFFFFULL; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index aad3a11f0..ab36c4734 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -172,13 +172,8 @@ void NotifyWindow::updateNotifyDisplay() { p.fillRect(0, st::notifyBorderWidth, st::notifyBorderWidth, h - st::notifyBorderWidth, st::notifyBorder->b); if (!App::passcoded() && cNotifyView() <= dbinvShowName) { - if (history->peer->photo->loaded()) { - p.drawPixmap(st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), history->peer->photo->pix(st::notifyPhotoSize)); - } else { - MTP::clearLoaderPriorities(); - peerPhoto = history->peer->photo; - peerPhoto->load(true, true); - } + history->peer->loadUserpic(true, true); + history->peer->paintUserpicLeft(p, st::notifyPhotoSize, st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), width()); } else { static QPixmap icon = QPixmap::fromImage(App::wnd()->iconLarge().scaled(st::notifyPhotoSize, st::notifyPhotoSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); p.drawPixmap(st::notifyPhotoPos.x(), st::notifyPhotoPos.y(), icon); From 9d00ec273bba1c1b6c43d2e30bf06e4ed4c2fab8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 Mar 2016 22:05:08 +0300 Subject: [PATCH 03/10] removed Date service messages, removed UnreadBar service message, started adding them to HistoryItems, saving item index in block to keep an eye on the previous message --- Telegram/SourceFiles/facades.cpp | 89 ++-- Telegram/SourceFiles/facades.h | 4 + Telegram/SourceFiles/history.cpp | 579 +++++++++---------------- Telegram/SourceFiles/history.h | 316 +++++++++----- Telegram/SourceFiles/historywidget.cpp | 30 +- Telegram/SourceFiles/historywidget.h | 3 + Telegram/SourceFiles/mainwidget.cpp | 4 +- Telegram/SourceFiles/types.h | 31 +- 8 files changed, 517 insertions(+), 539 deletions(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index e26e44f52..f928fe630 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -226,14 +226,22 @@ void Set##Name(const Type &Name) { \ Namespace##Data->Name = Name; \ } -struct SandboxDataStruct { - QString LangSystemISO; - int32 LangSystem = languageDefault; +namespace Sandbox { - QByteArray LastCrashDump; - ConnectionProxy PreLaunchProxy; -}; -SandboxDataStruct *SandboxData = 0; + namespace internal { + + struct Data { + QString LangSystemISO; + int32 LangSystem = languageDefault; + + QByteArray LastCrashDump; + ConnectionProxy PreLaunchProxy; + }; + + } + +} +Sandbox::internal::Data *SandboxData = 0; uint64 SandboxUserTag = 0; namespace Sandbox { @@ -320,7 +328,7 @@ namespace Sandbox { } void start() { - SandboxData = new SandboxDataStruct(); + SandboxData = new internal::Data(); SandboxData->LangSystemISO = psCurrentLanguage(); if (SandboxData->LangSystemISO.isEmpty()) SandboxData->LangSystemISO = qstr("en"); @@ -349,36 +357,46 @@ namespace Sandbox { } -struct GlobalDataStruct { - uint64 LaunchId = 0; +namespace Global { + namespace internal { - Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; - bool AdaptiveForWide = true; + struct Data { + uint64 LaunchId = 0; - int32 DebugLoggingFlags = 0; + Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; + bool AdaptiveForWide = true; - // config - int32 ChatSizeMax = 200; - int32 MegagroupSizeMax = 1000; - int32 ForwardedCountMax = 100; - int32 OnlineUpdatePeriod = 120000; - int32 OfflineBlurTimeout = 5000; - int32 OfflineIdleTimeout = 30000; - int32 OnlineFocusTimeout = 1000; - int32 OnlineCloudTimeout = 300000; - int32 NotifyCloudDelay = 30000; - int32 NotifyDefaultDelay = 1500; - int32 ChatBigSize = 10; - int32 PushChatPeriod = 60000; - int32 PushChatLimit = 2; - int32 SavedGifsLimit = 200; - int32 EditTimeLimit = 172800; + int32 DebugLoggingFlags = 0; - Global::HiddenPinnedMessagesMap HiddenPinnedMessages; + // config + int32 ChatSizeMax = 200; + int32 MegagroupSizeMax = 1000; + int32 ForwardedCountMax = 100; + int32 OnlineUpdatePeriod = 120000; + int32 OfflineBlurTimeout = 5000; + int32 OfflineIdleTimeout = 30000; + int32 OnlineFocusTimeout = 1000; + int32 OnlineCloudTimeout = 300000; + int32 NotifyCloudDelay = 30000; + int32 NotifyDefaultDelay = 1500; + int32 ChatBigSize = 10; + int32 PushChatPeriod = 60000; + int32 PushChatLimit = 2; + int32 SavedGifsLimit = 200; + int32 EditTimeLimit = 172800; - Global::CircleMasksMap CircleMasks; -}; -GlobalDataStruct *GlobalData = 0; + HiddenPinnedMessagesMap HiddenPinnedMessages; + + PendingItemsMap PendingInitDimensionsItems; + PendingItemsMap PendingRepaintItems; + + CircleMasksMap CircleMasks; + }; + + } +} + +Global::internal::Data *GlobalData = 0; namespace Global { @@ -387,7 +405,7 @@ namespace Global { } void start() { - GlobalData = new GlobalDataStruct(); + GlobalData = new internal::Data(); memset_rand(&GlobalData->LaunchId, sizeof(GlobalData->LaunchId)); } @@ -423,6 +441,9 @@ namespace Global { DefineVar(Global, HiddenPinnedMessagesMap, HiddenPinnedMessages); + DefineRefVar(Global, PendingItemsMap, PendingInitDimensionsItems); + DefineRefVar(Global, PendingItemsMap, PendingRepaintItems); + DefineRefVar(Global, CircleMasksMap, CircleMasks); }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index d0f2737d2..37139dfa3 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -170,6 +170,10 @@ namespace Global { typedef QMap HiddenPinnedMessagesMap; DeclareVar(HiddenPinnedMessagesMap, HiddenPinnedMessages); + typedef OrderedSet PendingItemsMap; + DeclareRefVar(PendingItemsMap, PendingInitDimensionsItems); + DeclareRefVar(PendingItemsMap, PendingRepaintItems); + typedef QMap CircleMasksMap; DeclareRefVar(CircleMasksMap, CircleMasks); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 5eb4d1c4e..df3f9790d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -493,8 +493,8 @@ void ChannelHistory::insertCollapseItem(MsgId wasMinId) { for (int32 itemIndex = 0, itemsCount = block->items.size(); itemIndex < itemsCount; ++itemIndex) { HistoryItem *item = block->items.at(itemIndex); if (insertAfter || item->id > wasMinId || (item->id == wasMinId && !item->isImportant())) { - _collapseMessage = new HistoryCollapse(this, block, wasMinId, item->date); - if (!addNewInTheMiddle(regItem(_collapseMessage), blockIndex, itemIndex)) { + _collapseMessage = HistoryCollapse::create((History*)this, wasMinId, item->date); + if (!addNewInTheMiddle(_collapseMessage, blockIndex, itemIndex)) { _collapseMessage = 0; } return; @@ -563,7 +563,7 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { _otherNewLoaded = false; } else if (_otherNewLoaded) { if (_otherList.isEmpty() || _otherList.back()->type() != HistoryItemGroup) { - _otherList.push_back(regItem(new HistoryGroup(this, 0, d, _otherList.isEmpty() ? date(d.vdate) : _otherList.back()->date))); + _otherList.push_back(HistoryGroup::create(this, d, _otherList.isEmpty() ? date(d.vdate) : _otherList.back()->date)); } else { static_cast(_otherList.back())->uniteWith(d.vmin_id.v, d.vmax_id.v, d.vcount.v); } @@ -571,8 +571,8 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { if (onlyImportant()) { if (newLoaded) { - HistoryItem *prev = blocks.isEmpty() ? 0 : blocks.back()->items.back(); - HistoryBlock *to = 0; + HistoryItem *prev = blocks.isEmpty() ? nullptr : blocks.back()->items.back(); + HistoryBlock *to = nullptr; bool newBlock = blocks.isEmpty(); if (newBlock) { to = new HistoryBlock(this); @@ -583,18 +583,6 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { } prev = addMessageGroupAfterPrevToBlock(d, prev, to); height += to->height; - if (newBlock) { - HistoryBlock *dateBlock = new HistoryBlock(this); - HistoryItem *dayItem = createDayServiceMsg(this, dateBlock, blocks.front()->items.front()->date); - dateBlock->items.push_back(dayItem); - int32 dh = dayItem->resize(width); - dateBlock->height = dh; - for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { - (*i)->y += dh; - } - blocks.push_front(dateBlock); // date block CHECK - height += dh; - } } } else { setNotLoadedAtBottom(); @@ -616,13 +604,12 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { if (isEmpty()) { HistoryBlock *to = new HistoryBlock(this); bool newBlock = true; - _joinedMessage = new HistoryJoined(this, to, inviteDate, inviter, flags); - if (!addNewItem(to, newBlock, regItem(_joinedMessage), unread)) { + _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); + if (!addNewItem(to, newBlock, _joinedMessage, unread)) { _joinedMessage = 0; } return _joinedMessage; } - HistoryItem *lastSeenDateItem = 0; for (int32 blockIndex = blocks.size(); blockIndex > 1;) { HistoryBlock *block = blocks.at(--blockIndex); for (int32 itemIndex = block->items.size(); itemIndex > 0;) { @@ -636,19 +623,10 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } ++itemIndex; - if (item->date.date() != inviteDate.date()) { - HistoryDateMsg *joinedDateItem = new HistoryDateMsg(this, block, inviteDate.date()); - if (addNewInTheMiddle(regItem(joinedDateItem), blockIndex, itemIndex)) { - ++itemIndex; - } - } - _joinedMessage = new HistoryJoined(this, block, inviteDate, inviter, flags); - if (!addNewInTheMiddle(regItem(_joinedMessage), blockIndex, itemIndex)) { + _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); + if (!addNewInTheMiddle(_joinedMessage, blockIndex, itemIndex)) { _joinedMessage = 0; } - if (lastSeenDateItem && lastSeenDateItem->date.date() == inviteDate.date()) { - lastSeenDateItem->destroy(); - } if (lastMsgDate.isNull() || inviteDate >= lastMsgDate) { setLastMessage(_joinedMessage); if (unread) { @@ -656,39 +634,21 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } } return _joinedMessage; - } else { - lastSeenDateItem = 0; } - } else if (type == HistoryItemDate) { - lastSeenDateItem = item; } } } // adding new item to new block int32 addToH = 0, skip = 0; - if (!blocks.isEmpty()) { // remove date block - if (width) addToH = -blocks.front()->height; - HistoryBlock *dateblock = blocks.front(); - blocks.pop_front(); - delete dateblock; - } HistoryItem *till = blocks.isEmpty() ? 0 : blocks.front()->items.front(); HistoryBlock *block = new HistoryBlock(this); - _joinedMessage = new HistoryJoined(this, block, inviteDate, inviter, flags); - addItemAfterPrevToBlock(regItem(_joinedMessage), 0, block); - if (till && _joinedMessage && inviteDate.date() != till->date.date()) { - HistoryItem *dayItem = createDayServiceMsg(this, block, till->date); - block->items.push_back(dayItem); - if (width) { - dayItem->y = block->height; - block->height += dayItem->resize(width); - } - } + _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); + addItemAfterPrevToBlock(_joinedMessage, 0, block); if (!block->items.isEmpty()) { - blocks.push_front(block); // CHECK + blocks.push_front(block); if (width) { addToH += block->height; ++skip; @@ -696,21 +656,6 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } else { delete block; } - if (!blocks.isEmpty()) { - HistoryBlock *dateBlock = new HistoryBlock(this); - HistoryItem *dayItem = createDayServiceMsg(this, dateBlock, blocks.front()->items.front()->date); - dateBlock->items.push_back(dayItem); - if (width) { - int32 dh = dayItem->resize(width); - dateBlock->height = dh; - if (skip) { - blocks.front()->y += dh; - } - addToH += dh; - ++skip; - } - blocks.push_front(dateBlock); // date block CHECK - } if (width && addToH) { for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { if (skip) { @@ -861,7 +806,6 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp t_assert(!newBlock); return item; } - item->attach(to); } return addNewItem(to, newBlock, item, (type == NewMessageUnread)); } @@ -877,7 +821,7 @@ void ChannelHistory::addNewToOther(HistoryItem *item, NewMessageType type) { } } else { if (_otherList.isEmpty() || _otherList.back()->type() != HistoryItemGroup) { - _otherList.push_back(regItem(new HistoryGroup(this, 0, item, _otherList.isEmpty() ? item->date : _otherList.back()->date))); + _otherList.push_back(HistoryGroup::create(this, item, _otherList.isEmpty() ? item->date : _otherList.back()->date)); } else { static_cast(_otherList.back())->uniteWith(item); } @@ -910,7 +854,6 @@ void ChannelHistory::switchMode() { oldLoaded = _otherOldLoaded; if (int32 count = _otherList.size()) { blocks.reserve(qCeil(count / float64(MessagesPerPage)) + 1); - createInitialDateBlock(_otherList.front()->date); HistoryItem *prev = 0; for (int32 i = 0; i < count;) { @@ -918,11 +861,9 @@ void ChannelHistory::switchMode() { int32 willAddToBlock = qMin(int32(MessagesPerPage), count - i); block->items.reserve(willAddToBlock); for (int32 till = i + willAddToBlock; i < till; ++i) { - HistoryItem *item = _otherList.at(i); - item->attach(block); - prev = addItemAfterPrevToBlock(item, prev, block); + prev = addItemAfterPrevToBlock(_otherList.at(i), prev, block); } - blocks.push_back(block); // CHECK + blocks.push_back(block); if (width) { block->y = height; height += block->height; @@ -1310,7 +1251,6 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo if (!result->detached()) { result->detach(); } - result->attach(block); } if (msg.type() == mtpc_message) { result->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0); @@ -1327,7 +1267,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo switch (msg.type()) { case mtpc_messageEmpty: - result = new HistoryServiceMsg(this, block, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); + result = HistoryServiceMsg::create(this, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); break; case mtpc_message: { @@ -1379,14 +1319,14 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo QString text(lng_message_unsupported(lt_link, qsl("https://desktop.telegram.org"))); EntitiesInText entities = textParseEntities(text, _historyTextNoMonoOptions.flags); entities.push_front(EntityInText(EntityInTextItalic, 0, text.size())); - result = new HistoryMessage(this, block, m.vid.v, m.vflags.v, m.vvia_bot_id.v, date(m.vdate), m.vfrom_id.v, text, entities); + result = HistoryMessage::create(this, m.vid.v, m.vflags.v, m.vvia_bot_id.v, date(m.vdate), m.vfrom_id.v, text, entities); } else if (badMedia) { - result = new HistoryServiceMsg(this, block, m.vid.v, date(m.vdate), lang(lng_message_empty), m.vflags.v, 0, m.has_from_id() ? m.vfrom_id.v : 0); + result = HistoryServiceMsg::create(this, m.vid.v, date(m.vdate), lang(lng_message_empty), m.vflags.v, nullptr, m.has_from_id() ? m.vfrom_id.v : 0); } else { if (m.has_reply_to_msg_id() && m.vreply_to_msg_id.v > 0) { - result = new HistoryReply(this, block, m); + result = HistoryReply::create(this, m); } else { - result = new HistoryMessage(this, block, m); + result = HistoryMessage::create(this, m); } if (m.has_reply_markup()) { App::feedReplyMarkup(channelId(), msgId, m.vreply_markup); @@ -1396,7 +1336,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo case mtpc_messageService: { const MTPDmessageService &d(msg.c_messageService()); - result = new HistoryServiceMsg(this, block, d); + result = HistoryServiceMsg::create(this, d); if (applyServiceAction) { const MTPmessageAction &action(d.vaction); @@ -1539,35 +1479,25 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo App::checkSavedGif(result); } - return regItem(result); + return result; } -HistoryItem *History::createItemForwarded(HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) { - return regItem(new HistoryMessage(this, block, id, flags, date, from, msg)); +HistoryItem *History::createItemForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) { + return HistoryMessage::create(this, id, flags, date, from, msg); } -HistoryItem *History::createItemDocument(HistoryBlock *block, MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - HistoryItem *result = 0; - +HistoryItem *History::createItemDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { if ((flags & MTPDmessage::flag_reply_to_msg_id) && replyTo > 0) { - result = new HistoryReply(this, block, id, flags, viaBotId, replyTo, date, from, doc, caption); - } else { - result = new HistoryMessage(this, block, id, flags, viaBotId, date, from, doc, caption); + return HistoryReply::create(this, id, flags, viaBotId, replyTo, date, from, doc, caption); } - - return regItem(result); + return HistoryMessage::create(this, id, flags, viaBotId, date, from, doc, caption); } -HistoryItem *History::createItemPhoto(HistoryBlock *block, MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - HistoryItem *result = 0; - +HistoryItem *History::createItemPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { if ((flags & MTPDmessage::flag_reply_to_msg_id) && replyTo > 0) { - result = new HistoryReply(this, block, id, flags, viaBotId, replyTo, date, from, photo, caption); - } else { - result = new HistoryMessage(this, block, id, flags, viaBotId, date, from, photo, caption); + return HistoryReply::create(this, id, flags, viaBotId, replyTo, date, from, photo, caption); } - - return regItem(result); + return HistoryMessage::create(this, id, flags, viaBotId, date, from, photo, caption); } HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, int32 flags, HistoryMedia *media, bool newMsg) { @@ -1581,8 +1511,8 @@ HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString & t_assert(to->items.back() != nullptr); } - HistoryItem *result = new HistoryServiceMsg(this, to, msgId, date, text, flags, media); - return addNewItem(to, newBlock, regItem(result), newMsg); + HistoryItem *result = HistoryServiceMsg::create(this, msgId, date, text, flags, media); + return addNewItem(to, newBlock, result, newMsg); } HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) { @@ -1615,7 +1545,6 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) t_assert(!newBlock); return item; } - item->attach(to); } return addNewItem(to, newBlock, item, (type == NewMessageUnread)); } @@ -1634,7 +1563,7 @@ HistoryItem *History::addNewForwarded(MsgId id, int32 flags, QDateTime date, int t_assert(!to->items.isEmpty()); t_assert(to->items.back() != nullptr); } - return addNewItem(to, newBlock, createItemForwarded(to, id, flags, date, from, item), true); + return addNewItem(to, newBlock, createItemForwarded(id, flags, date, from, item), true); } HistoryItem *History::addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { @@ -1647,7 +1576,7 @@ HistoryItem *History::addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgI t_assert(!to->items.isEmpty()); t_assert(to->items.back() != nullptr); } - return addNewItem(to, newBlock, createItemDocument(to, id, flags, viaBotId, replyTo, date, from, doc, caption), true); + return addNewItem(to, newBlock, createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption), true); } HistoryItem *History::addNewPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { @@ -1660,24 +1589,7 @@ HistoryItem *History::addNewPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId r t_assert(!to->items.isEmpty()); t_assert(to->items.back() != nullptr); } - return addNewItem(to, newBlock, createItemPhoto(to, id, flags, viaBotId, replyTo, date, from, photo, caption), true); -} - -void History::createInitialDateBlock(const QDateTime &date) { - HistoryBlock *dateBlock = new HistoryBlock(this); // date block - HistoryItem *dayItem = createDayServiceMsg(this, dateBlock, date); - dateBlock->items.push_back(dayItem); - if (width) { - dateBlock->height += dayItem->resize(width); - } - - blocks.push_front(dateBlock); - if (width) { - height += dateBlock->height; - for (int32 i = 1, l = blocks.size(); i < l; ++i) { - blocks.at(i)->y += dateBlock->height; - } - } + return addNewItem(to, newBlock, createItemPhoto(id, flags, viaBotId, replyTo, date, from, photo, caption), true); } bool History::addToOverview(MediaOverviewType type, MsgId msgId, AddToOverviewMethod method) { @@ -1730,21 +1642,10 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a } if (newBlock) { - createInitialDateBlock(adding->date); - to->y = height; blocks.push_back(to); - } else if (to->items.back()->date.date() != adding->date.date()) { - HistoryItem *dayItem = createDayServiceMsg(this, to, adding->date); - to->items.push_back(dayItem); - if (width) { - dayItem->y = to->height; - - int32 dh = dayItem->resize(width); - to->height += dh; - height += dh; - } } + adding->attachToBlock(to, to->items.size()); to->items.push_back(adding); setLastMessage(adding); @@ -1850,7 +1751,7 @@ void History::newItemAdded(HistoryItem *item) { item->from()->asUser()->madeAction(); } if (item->out()) { - if (unreadBar) unreadBar->destroy(); + if (unreadBar) unreadBar->destroyUnreadBar(); if (!item->unread()) { outboxRead(item); } @@ -1866,17 +1767,7 @@ void History::newItemAdded(HistoryItem *item) { } HistoryItem *History::addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block) { - if (prev && prev->date.date() != item->date.date()) { - HistoryItem *dayItem = createDayServiceMsg(this, prev->block(), item->date); - prev->block()->items.push_back(dayItem); - if (width) { - dayItem->y = prev->block()->height; - prev->block()->height += dayItem->resize(width); - if (prev->block() != block) { - height += dayItem->height(); - } - } - } + item->attachToBlock(block, block->items.size()); block->items.push_back(item); if (width) { item->y = block->height; @@ -1890,7 +1781,7 @@ HistoryItem *History::addMessageGroupAfterPrevToBlock(const MTPDmessageGroup &gr static_cast(prev)->uniteWith(group.vmin_id.v, group.vmax_id.v, group.vcount.v); return prev; } - return addItemAfterPrevToBlock(regItem(new HistoryGroup(this, block, group, prev ? prev->date : date(group.vdate))), prev, block); + return addItemAfterPrevToBlock(HistoryGroup::create(this, group, prev ? prev->date : date(group.vdate)), prev, block); } HistoryItem *History::addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev) { @@ -1902,15 +1793,13 @@ HistoryItem *History::addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem QDateTime date = prev ? prev->date : newItem->date; HistoryBlock *block = prev ? prev->block() : 0; if (!block) { - createInitialDateBlock(date); - block = new HistoryBlock(this); - blocks.push_back(block); // CHECK + blocks.push_back(block); if (width) { block->y = height; } } - return addItemAfterPrevToBlock(regItem(new HistoryGroup(this, block, newItem, date)), prev, block); + return addItemAfterPrevToBlock(HistoryGroup::create(this, newItem, date), prev, block); } void History::addOlderSlice(const QVector &slice, const QVector *collapsed) { @@ -1927,7 +1816,7 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; - HistoryItem *oldFirst = nullptr, *last = nullptr; + HistoryItem *last = nullptr; HistoryBlock *block = new HistoryBlock(this); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1952,10 +1841,7 @@ void History::addOlderSlice(const QVector &slice, const QVector 1); - oldFirst = blocks.at(1)->items.front(); - } + HistoryItem *oldFirst = blocks.isEmpty() ? nullptr : blocks.front()->items.front(); while (oldFirst && last && oldFirst->type() == HistoryItemGroup && last->type() == HistoryItemGroup) { static_cast(last)->uniteWith(static_cast(oldFirst)); oldFirst->destroy(); @@ -1966,36 +1852,24 @@ void History::addOlderSlice(const QVector &slice, const QVectoritems.front(); } } - if (oldFirst && last && last->date.date() != oldFirst->date.date()) { - HistoryItem *dayItem = createDayServiceMsg(this, block, oldFirst->date); - block->items.push_back(dayItem); - if (width) { - dayItem->y = block->height; - block->height += dayItem->resize(width); - } - } if (block->items.isEmpty()) { oldLoaded = true; delete block; } else { if (oldFirst) { - HistoryBlock *initial = blocks.at(0); - blocks[0] = block; - blocks.push_front(initial); + blocks.push_front(block); if (width) { - block->y = initial->height; - for (int32 i = 2, l = blocks.size(); i < l; ++i) { + block->y = 0; + for (int32 i = 1, l = blocks.size(); i < l; ++i) { blocks.at(i)->y += block->height; } height += block->height; } - initial->items.at(0)->setDate(block->items.at(0)->date); } else { blocks.push_front(block); if (width) { height = block->height; } - createInitialDateBlock(block->items.at(0)->date); } if (loadedAtBottom()) { // add photos to overview and authors to lastAuthors / lastParticipants @@ -2129,9 +2003,6 @@ void History::addNewerSlice(const QVector &slice, const QVectory = height; height += block->height; } - if (blocks.size() == 1) { - createInitialDateBlock(block->items.at(0)->date); - } } } @@ -2272,7 +2143,11 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { count += h->unreadCount; } } - unreadBar->setCount(count); + if (count > 0) { + unreadBar->setUnreadBarCount(count); + } else { + unreadBar->setUnreadBarFreezed(); + } } } } @@ -2323,10 +2198,13 @@ void History::addUnreadBar() { count += h->unreadCount; } } - HistoryBlock *block = showFrom->block(); - unreadBar = new HistoryUnreadBar(this, block, count, showFrom->date); - if (!addNewInTheMiddle(regItem(unreadBar), blocks.indexOf(block), block->items.indexOf(showFrom))) { - unreadBar = 0; + showFrom->setUnreadBarCount(count); + unreadBar = showFrom; +} + +void History::destroyUnreadBar() { + if (unreadBar) { + unreadBar->destroyUnreadBar(); } } @@ -2338,7 +2216,12 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, HistoryBlock *block = blocks.at(blockIndex); newItem->y = (itemIndex < block->items.size()) ? block->items.at(itemIndex)->y : block->height; + + newItem->attachToBlock(block, itemIndex); block->items.insert(itemIndex, newItem); + for (int i = itemIndex + 1, l = block->items.size(); i < l; ++i) { + block->items.at(i)->setIndexInBlock(i); + } if (width) { int32 dh = newItem->resize(width), l = block->items.size(); @@ -2539,13 +2422,13 @@ const ChannelHistory *History::asChannelHistory() const { void History::clear(bool leaveItems) { if (unreadBar) { - unreadBar->destroy(); + unreadBar = nullptr; } if (showFrom) { - showFrom = 0; + showFrom = nullptr; } if (!leaveItems) { - setLastMessage(0); + setLastMessage(nullptr); } for (int32 i = 0; i < OverviewCount; ++i) { if (!overview[i].isEmpty() || !overviewIds[i].isEmpty()) { @@ -2802,14 +2685,15 @@ void HistoryBlock::removeItem(HistoryItem *item) { if (history->showFrom == item) { history->getNextShowFrom(this, i); } + if (history->unreadBar == item) { + history->unreadBar = nullptr; + } if (i < 0) { return; } - bool createInitialDate = false; - QDateTime initialDateTime; int32 myIndex = history->blocks.indexOf(this); - if (myIndex >= 0 && item->type() != HistoryItemDate) { // fix message groups and date items + if (myIndex >= 0) { // fix message groups and date items if (item->isImportant()) { // unite message groups around this important message HistoryGroup *nextGroup = 0, *prevGroup = 0; HistoryCollapse *nextCollapse = 0; @@ -2862,72 +2746,20 @@ void HistoryBlock::removeItem(HistoryItem *item) { nextCollapse->destroy(); } } - - // fix date items - HistoryItem *nextItem = (i < items.size() - 1) ? items[i + 1] : ((myIndex < history->blocks.size() - 1) ? history->blocks[myIndex + 1]->items[0] : 0); - if (nextItem && nextItem == history->unreadBar) { // skip unread bar - if (i < items.size() - 2) { - nextItem = items[i + 2]; - } else if (i < items.size() - 1) { - nextItem = ((myIndex < history->blocks.size() - 1) ? history->blocks[myIndex + 1]->items[0] : 0); - } else if (myIndex < history->blocks.size() - 1) { - if (0 < history->blocks[myIndex + 1]->items.size() - 1) { - nextItem = history->blocks[myIndex + 1]->items[1]; - } else if (myIndex < history->blocks.size() - 2) { - nextItem = history->blocks[myIndex + 2]->items[0]; - } else { - nextItem = 0; - } - } else { - nextItem = 0; - } - } - if (!nextItem || nextItem->type() == HistoryItemDate) { // only if there is no next item or it is a date item - HistoryItem *prevItem = (i > 0) ? items[i - 1] : 0; - if (prevItem && prevItem == history->unreadBar) { // skip unread bar - prevItem = (i > 1) ? items[i - 2] : 0; - } - if (prevItem) { - if (prevItem->type() == HistoryItemDate) { - prevItem->destroy(); - --i; - } - } else if (myIndex > 0) { - HistoryBlock *prevBlock = history->blocks[myIndex - 1]; - if (prevBlock->items.isEmpty() || ((myIndex == 1) && (prevBlock->items.size() != 1 || prevBlock->items.front()->type() != HistoryItemDate))) { - LOG(("App Error: Found bad history, with no first date block: %1").arg(history->blocks[0]->items.size())); - } else if (prevBlock->items[prevBlock->items.size() - 1]->type() == HistoryItemDate) { - prevBlock->items[prevBlock->items.size() - 1]->destroy(); - if (nextItem && myIndex == 1) { // destroy next date (for creating initial then) - initialDateTime = nextItem->date; - createInitialDate = true; - nextItem->destroy(); - } - } - } - } } // myIndex can be invalid now, because of destroying previous blocks dh = item->height(); items.remove(i); - int32 l = items.size(); if ((!item->out() || item->isPost()) && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); } - int32 itemType = item->type(); - if (itemType == HistoryItemUnreadBar) { - if (history->unreadBar == item) { - history->unreadBar = 0; - } - } - if (createInitialDate) { - history->createInitialDateBlock(initialDateTime); - } + History *h = history; - if (l) { + if (int32 l = items.size()) { for (; i < l; ++i) { - items[i]->y -= dh; + items.at(i)->y -= dh; + items.at(i)->setIndexInBlock(i); } height -= dh; history->blockResized(this, dh); @@ -2942,16 +2774,38 @@ void HistoryDependentItemCallback::call(ChannelData *channel, MsgId msgId) const } } -HistoryItem::HistoryItem(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime msgDate, int32 from) : y(0) +HistoryMessageUnreadBar::HistoryMessageUnreadBar(Interfaces*) : _width(0), _freezed(false) { +} + +void HistoryMessageUnreadBar::init(int count) { + if (_freezed) return; + _text = lng_unread_bar(lt_count, count); + _width = st::semiboldFont->width(_text); +} + +HistoryMessageDate::HistoryMessageDate(Interfaces*) : _width(0) { +} + +void HistoryMessageDate::init(const QDateTime &date) { + _text = langDayOfMonthFull(date.date()); + _width = st::semiboldFont->width(_text); +} + +HistoryItem::HistoryItem(History *history, MsgId msgId, int32 flags, QDateTime msgDate, int32 from) : HistoryElem() +, y(0) , id(msgId) , date(msgDate) , _from(from ? App::user(from) : history->peer) , _history(history) -, _block(block) , _flags(flags) , _authorNameVersion(author()->nameVersion) { } +void HistoryItem::finishCreate() { + App::historyRegItem(this); + initDimensions(); +} + void HistoryItem::destroy() { bool wasAtBottom = history()->loadedAtBottom(); _history->removeNotification(this); @@ -2990,13 +2844,24 @@ void HistoryItem::detach() { _history->showFrom = 0; } } - if (_history && _history->unreadBar && _history->blocks.back()->items.back() == _history->unreadBar) { - _history->unreadBar->destroy(); - } } void HistoryItem::detachFast() { _block = 0; + _indexInBlock = -1; +} + +void HistoryItem::previousItemChanged() { + if (displayDate()) { + if (!Is()) { + AddInterfaces(HistoryMessageDate::Bit()); + Get()->init(date); + Global::RefPendingInitDimensionsItems().insert(this); + } + } else if (Is()) { + RemoveInterfaces(HistoryMessageDate::Bit()); + Global::RefPendingInitDimensionsItems().insert(this); + } } void HistoryItem::setId(MsgId newId) { @@ -3036,6 +2901,42 @@ bool HistoryItem::canEdit(const QDateTime &cur) const { return false; } +void HistoryItem::destroyUnreadBar() { + if (Is()) { + RemoveInterfaces(HistoryMessageUnreadBar::Bit()); + Global::RefPendingInitDimensionsItems().insert(this); + if (_history->unreadBar == this) { + _history->unreadBar = nullptr; + } + } +} + +void HistoryItem::setUnreadBarCount(int count) { + if (count > 0) { + HistoryMessageUnreadBar *bar; + if (!Is()) { + AddInterfaces(HistoryMessageUnreadBar::Bit()); + Global::RefPendingInitDimensionsItems().insert(this); + bar = Get(); + } else { + bar = Get(); + if (bar->_freezed) { + return; + } + Global::RefPendingRepaintItems().insert(this); + } + bar->init(count); + } else { + destroyUnreadBar(); + } +} + +void HistoryItem::setUnreadBarFreezed() { + if (auto *bar = Get()) { + bar->_freezed = true; + } +} + void HistoryItem::clipCallback(ClipReaderNotification notification) { HistoryMedia *media = getMedia(); if (!media) return; @@ -3079,14 +2980,6 @@ HistoryItem::~HistoryItem() { } } -HistoryItem *regItem(HistoryItem *item) { - if (item) { - App::historyRegItem(item); - item->initDimensions(); - } - return item; -} - RadialAnimation::RadialAnimation(AnimationCreator creator) : _firstStart(0) , _lastStart(0) @@ -3586,11 +3479,11 @@ void HistoryPhoto::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) } } -void HistoryPhoto::regItem(HistoryItem *item) { +void HistoryPhoto::attachToItem(HistoryItem *item) { App::regPhotoItem(_data, item); } -void HistoryPhoto::unregItem(HistoryItem *item) { +void HistoryPhoto::detachFromItem(HistoryItem *item) { App::unregPhotoItem(_data, item); } @@ -3865,11 +3758,11 @@ void HistoryVideo::updateStatusText(const HistoryItem *parent) const { } } -void HistoryVideo::regItem(HistoryItem *item) { +void HistoryVideo::attachToItem(HistoryItem *item) { App::regDocumentItem(_data, item); } -void HistoryVideo::unregItem(HistoryItem *item) { +void HistoryVideo::detachFromItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } @@ -3909,7 +3802,7 @@ void HistoryDocumentVoice::checkPlaybackFinished() const { HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() , _parent(0) , _data(document) { - create(!caption.isEmpty()); + createInterfaces(!caption.isEmpty()); if (HistoryDocumentNamed *named = Get()) { named->_name = documentName(_data); named->_namew = st::semiboldFont->width(named->_name); @@ -3929,7 +3822,7 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi , _parent(0) , _data(other._data) { const HistoryDocumentCaptioned *captioned = other.Get(); - create(captioned != 0); + createInterfaces(captioned != 0); if (HistoryDocumentNamed *named = Get()) { if (const HistoryDocumentNamed *oin = other.Get()) { named->_name = oin->_name; @@ -3949,7 +3842,7 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi } } -void HistoryDocument::create(bool caption) { +void HistoryDocument::createInterfaces(bool caption) { uint64 mask = 0; if (_data->voice()) { mask |= HistoryDocumentVoice::Bit(); @@ -4450,11 +4343,11 @@ void HistoryDocument::step_voiceProgress(float64 ms, bool timer) { } } -void HistoryDocument::regItem(HistoryItem *item) { +void HistoryDocument::attachToItem(HistoryItem *item) { App::regDocumentItem(_data, item); } -void HistoryDocument::unregItem(HistoryItem *item) { +void HistoryDocument::detachFromItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } @@ -4800,11 +4693,11 @@ void HistoryGif::updateStatusText(const HistoryItem *parent) const { } } -void HistoryGif::regItem(HistoryItem *item) { +void HistoryGif::attachToItem(HistoryItem *item) { App::regDocumentItem(_data, item); } -void HistoryGif::unregItem(HistoryItem *item) { +void HistoryGif::detachFromItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } @@ -4992,11 +4885,11 @@ const QString HistorySticker::inHistoryText() const { return qsl("[ ") + inDialogsText() + qsl(" ]"); } -void HistorySticker::regItem(HistoryItem *item) { +void HistorySticker::attachToItem(HistoryItem *item) { App::regDocumentItem(_data, item); } -void HistorySticker::unregItem(HistoryItem *item) { +void HistorySticker::detachFromItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } @@ -5160,13 +5053,13 @@ const QString HistoryContact::inHistoryText() const { return qsl("[ ") + lang(lng_in_dlg_contact) + qsl(" : ") + _name.original() + qsl(", ") + _phone + qsl(" ]"); } -void HistoryContact::regItem(HistoryItem *item) { +void HistoryContact::attachToItem(HistoryItem *item) { if (_userId) { App::regSharedContactItem(_userId, item); } } -void HistoryContact::unregItem(HistoryItem *item) { +void HistoryContact::detachFromItem(HistoryItem *item) { if (_userId) { App::unregSharedContactItem(_userId, item); } @@ -5175,9 +5068,9 @@ void HistoryContact::unregItem(HistoryItem *item) { void HistoryContact::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaContact) { if (_userId != media.c_messageMediaContact().vuser_id.v) { - unregItem(parent); + detachFromItem(parent); _userId = media.c_messageMediaContact().vuser_id.v; - regItem(parent); + attachToItem(parent); } } } @@ -5630,14 +5523,14 @@ void HistoryWebPage::linkOut(HistoryItem *parent, const TextLinkPtr &lnk) { } } -void HistoryWebPage::regItem(HistoryItem *item) { +void HistoryWebPage::attachToItem(HistoryItem *item) { App::regWebPageItem(_data, item); - if (_attach) _attach->regItem(item); + if (_attach) _attach->attachToItem(item); } -void HistoryWebPage::unregItem(HistoryItem *item) { +void HistoryWebPage::detachFromItem(HistoryItem *item) { App::unregWebPageItem(_data, item); - if (_attach) _attach->unregItem(item); + if (_attach) _attach->detachFromItem(item); } const QString HistoryWebPage::inDialogsText() const { @@ -6146,8 +6039,8 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { } } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg) : - HistoryItem(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) +HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) : + HistoryItem(history, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) @@ -6162,15 +6055,15 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPD if (f.has_channel_post()) originalId = f.vchannel_post.v; } } - create(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1, authorOriginalId, fromOriginalId, originalId); + createInterfaces(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1, authorOriginalId, fromOriginalId, originalId); QString text(textClean(qs(msg.vmessage))); initMedia(msg.has_media() ? (&msg.vmedia) : 0, text); setText(text, msg.has_entities() ? entitiesFromMTP(msg.ventities.c_vector().v) : EntitiesInText()); } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd) -: HistoryItem(history, block, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) +HistoryMessage::HistoryMessage(History *history, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd) +: HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) @@ -6178,52 +6071,52 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, UserData *fwdViaBot = fwd->viaBot(); int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0; int32 fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); - create(viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); + createInterfaces(viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); if (HistoryMedia *mediaOriginal = fwd->getMedia()) { _media = mediaOriginal->clone(); - _media->regItem(this); + _media->attachToItem(this); } setText(fwd->originalText(), fwd->originalEntities()); } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) - : HistoryItem(history, block, id, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId id, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) + : HistoryItem(history, id, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); setText(msg, entities); } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : -HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : -HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); - _media->regItem(this); + _media->attachToItem(this); setText(QString(), EntitiesInText()); } -void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { +void HistoryMessage::createInterfaces(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { uint64 mask = 0; if (viaBotId) { mask |= HistoryMessageVia::Bit(); @@ -6332,7 +6225,7 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tTex } } break; }; - if (_media) _media->regItem(this); + if (_media) _media->attachToItem(this); } void HistoryMessage::initMediaFromDocument(DocumentData *doc, const QString &caption) { @@ -6345,7 +6238,7 @@ void HistoryMessage::initMediaFromDocument(DocumentData *doc, const QString &cap } else { _media = new HistoryDocument(doc, caption, this); } - _media->regItem(this); + _media->attachToItem(this); } int32 HistoryMessage::plainMaxWidth() const { @@ -6512,7 +6405,7 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) { if (_media) { mediaWasDisplayed = _media->isDisplayed(); - _media->unregItem(this); + _media->detachFromItem(this); delete _media; _media = nullptr; } @@ -7067,7 +6960,7 @@ QString HistoryMessage::notificationText() const { HistoryMessage::~HistoryMessage() { if (_media) { - _media->unregItem(this); + _media->detachFromItem(this); deleteAndMark(_media); } if (_flags & MTPDmessage::flag_reply_markup) { @@ -7075,7 +6968,7 @@ HistoryMessage::~HistoryMessage() { } } -HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg) +HistoryReply::HistoryReply(History *history, const MTPDmessage &msg) : HistoryMessage(history, msg) , replyToMsgId(msg.vreply_to_msg_id.v) , replyToMsg(0) , replyToVersion(0) @@ -7086,8 +6979,8 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmess } } -HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) -: HistoryMessage(history, block, msgId, flags, viaBotId, date, from, doc, caption) +HistoryReply::HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) +: HistoryMessage(history, msgId, flags, viaBotId, date, from, doc, caption) , replyToMsgId(replyTo) , replyToMsg(0) , replyToVersion(0) @@ -7098,8 +6991,8 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i } } -HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) -: HistoryMessage(history, block, msgId, flags, viaBotId, date, from, photo, caption) +HistoryReply::HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) +: HistoryMessage(history, msgId, flags, viaBotId, date, from, photo, caption) , replyToMsgId(replyTo) , replyToMsg(0) , replyToVersion(0) @@ -7501,7 +7394,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { const MTPDmessageActionChatEditPhoto &d(action.c_messageActionChatEditPhoto()); if (d.vphoto.type() == mtpc_photo) { _media = new HistoryPhoto(history()->peer, d.vphoto.c_photo(), st::msgServicePhotoWidth); - _media->regItem(this); + _media->attachToItem(this); } text = isPost() ? lang(lng_action_changed_photo_channel) : lng_action_changed_photo(lt_from, from); } break; @@ -7666,8 +7559,8 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { return result; } -HistoryServiceMsg::HistoryServiceMsg(History *history, HistoryBlock *block, const MTPDmessageService &msg) : - HistoryItem(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) +HistoryServiceMsg::HistoryServiceMsg(History *history, const MTPDmessageService &msg) : + HistoryItem(history, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) , _text(st::msgMinWidth) , _media(0) { if (msg.has_reply_to_msg_id()) { @@ -7680,8 +7573,8 @@ HistoryServiceMsg::HistoryServiceMsg(History *history, HistoryBlock *block, cons setMessageByAction(msg.vaction); } -HistoryServiceMsg::HistoryServiceMsg(History *history, HistoryBlock *block, MsgId msgId, QDateTime date, const QString &msg, int32 flags, HistoryMedia *media, int32 from) : - HistoryItem(history, block, msgId, flags, date, from) +HistoryServiceMsg::HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags, HistoryMedia *media, int32 from) : + HistoryItem(history, msgId, flags, date, from) , _text(st::msgServiceFont, msg, _historySrvOptions, st::dlgMinWidth) , _media(media) { } @@ -7878,33 +7771,18 @@ HistoryServiceMsg::~HistoryServiceMsg() { } } if (_media) { - _media->unregItem(this); + _media->detachFromItem(this); deleteAndMark(_media); } } -HistoryDateMsg::HistoryDateMsg(History *history, HistoryBlock *block, const QDate &date) : -HistoryServiceMsg(history, block, clientMsgId(), QDateTime(date), langDayOfMonthFull(date)) { -} - -void HistoryDateMsg::setDate(const QDateTime &date) { - if (this->date.date() != date.date()) { - setServiceText(langDayOfMonthFull(date.date())); - } - HistoryServiceMsg::setDate(date); -} - -HistoryItem *createDayServiceMsg(History *history, HistoryBlock *block, QDateTime date) { - return regItem(new HistoryDateMsg(history, block, date.date())); -} - -HistoryGroup::HistoryGroup(History *history, HistoryBlock *block, const MTPDmessageGroup &group, const QDateTime &date) : -HistoryServiceMsg(history, block, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 .. %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/), +HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, const QDateTime &date) : +HistoryServiceMsg(history, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 .. %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/), _minId(group.vmin_id.v), _maxId(group.vmax_id.v), _count(group.vcount.v), _lnk(new CommentsLink(this)) { } -HistoryGroup::HistoryGroup(History *history, HistoryBlock *block, HistoryItem *newItem, const QDateTime &date) : -HistoryServiceMsg(history, block, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 .. %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/), +HistoryGroup::HistoryGroup(History *history, HistoryItem *newItem, const QDateTime &date) : +HistoryServiceMsg(history, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 .. %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/), _minId(newItem->id - 1), _maxId(newItem->id + 1), _count(1), _lnk(new CommentsLink(this)) { } @@ -7970,8 +7848,8 @@ void HistoryGroup::updateText() { setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/); } -HistoryCollapse::HistoryCollapse(History *history, HistoryBlock *block, MsgId wasMinId, const QDateTime &date) : -HistoryServiceMsg(history, block, clientMsgId(), date, qsl("-")), +HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) : +HistoryServiceMsg(history, clientMsgId(), date, qsl("-")), _wasMinId(wasMinId) { } @@ -7983,8 +7861,8 @@ void HistoryCollapse::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 state = HistoryDefaultCursorState; } -HistoryJoined::HistoryJoined(History *history, HistoryBlock *block, const QDateTime &inviteDate, UserData *inviter, int32 flags) : -HistoryServiceMsg(history, block, clientMsgId(), inviteDate, QString(), flags) { +HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, int32 flags) : +HistoryServiceMsg(history, clientMsgId(), inviteDate, QString(), flags) { textstyleSet(&st::serviceTextStyle); if (peerToUser(inviter->id) == MTP::authedId()) { _text.setText(st::msgServiceFont, lang(history->isMegagroup() ? lng_action_you_joined_group : lng_action_you_joined), _historySrvOptions); @@ -7994,40 +7872,3 @@ HistoryServiceMsg(history, block, clientMsgId(), inviteDate, QString(), flags) { } textstyleRestore(); } - -HistoryUnreadBar::HistoryUnreadBar(History *history, HistoryBlock *block, int32 count, const QDateTime &date) : HistoryItem(history, block, clientMsgId(), 0, date, 0), freezed(false) { - setCount(count); - initDimensions(); -} - -void HistoryUnreadBar::initDimensions() { - _maxw = st::msgPadding.left() + st::msgPadding.right() + 1; - _minh = st::unreadBarHeight; -} - -void HistoryUnreadBar::setCount(int32 count) { - if (!count) freezed = true; - if (freezed) return; - text = lng_unread_bar(lt_count, count); -} - -void HistoryUnreadBar::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - p.fillRect(0, st::lineWidth, _history->width, st::unreadBarHeight - 2 * st::lineWidth, st::unreadBarBG->b); - p.fillRect(0, st::unreadBarHeight - st::lineWidth, _history->width, st::lineWidth, st::unreadBarBorder->b); - p.setFont(st::unreadBarFont->f); - p.setPen(st::unreadBarColor->p); - p.drawText(QRect(0, 0, _history->width, st::unreadBarHeight - st::lineWidth), text, style::al_center); -} - -int32 HistoryUnreadBar::resize(int32 width) { - _height = st::unreadBarHeight; - return _height; -} - -void HistoryUnreadBar::drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const { -} - -QString HistoryUnreadBar::notificationText() const { - return QString(); -} - diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index e029752e1..d8697decb 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -56,7 +56,6 @@ public: } HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); - // HistoryItem *addToBack(const MTPgeoChatMessage &msg, bool newMsg = true); typedef QMap TypingHistories; // when typing in this history started TypingHistories typing; @@ -208,7 +207,6 @@ struct HistoryEditDraft : public HistoryDraft { class HistoryMedia; class HistoryMessage; -class HistoryUnreadBar; enum AddToOverviewMethod { AddToOverviewNew, // when new message is added to history @@ -244,9 +242,9 @@ public: virtual ~History(); HistoryItem *createItem(HistoryBlock *block, const MTPMessage &msg, bool applyServiceAction); - HistoryItem *createItemForwarded(HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); - HistoryItem *createItemDocument(HistoryBlock *block, MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *createItemPhoto(HistoryBlock *block, MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *createItemForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); + HistoryItem *createItemDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryItem *createItemPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); HistoryItem *addNewService(MsgId msgId, QDateTime date, const QString &text, int32 flags = 0, HistoryMedia *media = 0, bool newMsg = true); HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); @@ -276,6 +274,7 @@ public: void setMute(bool newMute); void getNextShowFrom(HistoryBlock *block, int32 i); void addUnreadBar(); + void destroyUnreadBar(); void clearNotifications(); bool loadedAtBottom() const; // last message is in the list @@ -347,7 +346,7 @@ public: int32 width, height, msgCount, unreadCount; int32 inboxReadBefore, outboxReadBefore; HistoryItem *showFrom; - HistoryUnreadBar *unreadBar; + HistoryItem *unreadBar; PeerData *peer; bool oldLoaded, newLoaded; @@ -446,7 +445,6 @@ private: friend class HistoryBlock; friend class ChannelHistory; - void createInitialDateBlock(const QDateTime &date); HistoryItem *addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block); HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); HistoryItem *addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg); @@ -809,9 +807,12 @@ struct DialogsIndexed { class HistoryBlock { public: - HistoryBlock(History *hist) : y(0), height(0), history(hist) { + HistoryBlock(History *hist) : y(0), height(0), history(hist), _indexInHistory(-1) { } + HistoryBlock(const HistoryBlock &) = delete; + HistoryBlock &operator=(const HistoryBlock &) = delete; + typedef QVector Items; Items items; @@ -825,8 +826,14 @@ public: int32 y, height; History *history; - HistoryBlock(const HistoryBlock &) = delete; - HistoryBlock &operator=(const HistoryBlock &) = delete; + HistoryBlock *previous() const { + return (_indexInHistory > 0) ? history->blocks.at(_indexInHistory - 1) : nullptr; + } + +protected: + + int _indexInHistory; + }; class HistoryElem { @@ -876,8 +883,6 @@ inline bool isImportantChannelMessage(MsgId id, int32 flags) { // client-side im enum HistoryItemType { HistoryItemMsg = 0, - HistoryItemDate, - HistoryItemUnreadBar, HistoryItemGroup, HistoryItemCollapse, HistoryItemJoined @@ -931,11 +936,40 @@ private: }; +// any HistoryItem can have this Interface for +// displaying the day mark above the message +struct HistoryMessageDate : public BasicInterface { + HistoryMessageDate(Interfaces *); + void init(const QDateTime &date); + + QString _text; + int _width; +}; + +// any HistoryItem can have this Interface for +// displaying the unread messages bar above the message +struct HistoryMessageUnreadBar : public BasicInterface { + HistoryMessageUnreadBar(Interfaces *); + void init(int count); + + QString _text; + int _width; + + // if unread bar is freezed the new messages do not + // increment the counter displayed by this bar + // + // it happens when we've opened the conversation and + // we've seen the bar and new messages are marked as read + // as soon as they are added to the chat history + bool _freezed; +}; + class HistoryMedia; class HistoryItem : public HistoryElem, public Interfaces { public: - HistoryItem(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime msgDate, int32 from); + HistoryItem(const HistoryItem &) = delete; + HistoryItem &operator=(const HistoryItem &) = delete; virtual void initDimensions() = 0; virtual int32 resize(int32 width) = 0; // return new height @@ -975,8 +1009,13 @@ public: bool detached() const { return !_block; } - void attach(HistoryBlock *block) { + void attachToBlock(HistoryBlock *block, int index) { + t_assert(_block == nullptr && _indexInBlock < 0); _block = block; + _indexInBlock = index; + } + void setIndexInBlock(int index) { + _indexInBlock = index; } bool out() const { return _flags & MTPDmessage::flag_out; @@ -1064,6 +1103,7 @@ public: virtual bool hasBubble() const { return false; } + virtual void previousItemChanged(); virtual QString selectedText(uint32 selection) const { return qsl("[-]"); @@ -1204,21 +1244,73 @@ public: return author(); } + // count > 0 - creates the unread bar if necessary and + // sets unread messages count if bar is not freezed yet + // count <= 0 - destroys the unread bar + void setUnreadBarCount(int count); + void destroyUnreadBar(); + + // marks the unread bar as freezed so that unread + // messages count will not change for this bar + // when the new messages arrive in this chat history + void setUnreadBarFreezed(); + void clipCallback(ClipReaderNotification notification); virtual ~HistoryItem(); protected: + HistoryItem(History *history, MsgId msgId, int32 flags, QDateTime msgDate, int32 from); + + // to completely create history item we need to + // call a virtual initDimensions() method, + // that can not be done from constructor + void finishCreate(); + PeerData *_from; History *_history; - HistoryBlock *_block; + HistoryBlock *_block = nullptr; + int _indexInBlock = -1; int32 _flags; mutable int32 _authorNameVersion; - HistoryItem(const HistoryItem &) = delete; - HistoryItem &operator=(const HistoryItem &) = delete; + HistoryItem *previous() const { + if (_block && _indexInBlock >= 0) { + if (_indexInBlock > 0) return _block->items.at(_indexInBlock - 1); + if (HistoryBlock *previousBlock = _block->previous()) { + return previousBlock->items.back(); + } + } + return nullptr; + } + + // this should be used only in initDimensions() + // to add required bits to the Interfaces mask + // after that always use Is() + bool displayDate() const { + if (HistoryItem *prev = previous()) { + return prev->date.date().day() != date.date().day(); + } + return true; + } + +}; + +// make all the constructors in HistoryItem children protected +// and wrapped with a static create() call with the same args +// so that history item can not be created directly, without +// a finishCreate() call, which calls a virtual method initDimensions() +template +class HistoryItemInstantiated { +public: + template + static T *_create(Args ... args) { + T *result = new T(args ...); + result->finishCreate(); + return result; + } }; class MessageLink : public ITextLink { @@ -1254,8 +1346,6 @@ private: HistoryItem *_item; }; -HistoryItem *regItem(HistoryItem *item); - class RadialAnimation { public: @@ -1338,10 +1428,10 @@ public: virtual void stopInline(HistoryItem *item) { } - virtual void regItem(HistoryItem *item) { + virtual void attachToItem(HistoryItem *item) { } - virtual void unregItem(HistoryItem *item) { + virtual void detachFromItem(HistoryItem *item) { } virtual void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { @@ -1495,8 +1585,8 @@ public: void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; bool hasReplyPreview() const { return !_data->thumb->isNull(); @@ -1564,8 +1654,8 @@ public: return _data->uploading(); } - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; bool hasReplyPreview() const { return !_data->thumb->isNull(); @@ -1675,8 +1765,8 @@ public: return _data; } - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); @@ -1720,7 +1810,7 @@ protected: private: - void create(bool caption); + void createInterfaces(bool caption); const HistoryItem *_parent; DocumentData *_data; @@ -1764,8 +1854,8 @@ public: bool playInline(HistoryItem *item); void stopInline(HistoryItem *item); - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); @@ -1839,8 +1929,8 @@ public: return _data; } - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); @@ -1898,8 +1988,8 @@ public: const QString inDialogsText() const; const QString inHistoryText() const; - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); @@ -1974,8 +2064,8 @@ public: if (_attach) _attach->stopInline(item); } - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); + void attachToItem(HistoryItem *item) override; + void detachFromItem(HistoryItem *item) override; bool hasReplyPreview() const { return (_data->photo && !_data->photo->thumb->isNull()) || (_data->doc && !_data->doc->thumb->isNull()); @@ -2113,19 +2203,29 @@ private: }; -class HistoryMessage : public HistoryItem { +class HistoryMessage : public HistoryItem, private HistoryItemInstantiated { public: - HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd); // local forwarded - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo + static HistoryMessage *create(History *history, const MTPDmessage &msg) { + return _create(history, msg); + } + static HistoryMessage *create(History *history, MsgId msgId, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd) { + return _create(history, msgId, flags, date, from, fwd); + } + static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) { + return _create(history, msgId, flags, viaBotId, date, from, msg, entities); + } + static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + return _create(history, msgId, flags, viaBotId, date, from, doc, caption); + } + static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + return _create(history, msgId, flags, viaBotId, date, from, photo, caption); + } void initTime(); void initMedia(const MTPMessageMedia *media, QString ¤tText); void initMediaFromDocument(DocumentData *doc, const QString &caption); - void initDimensions(); + void initDimensions() override; void fromNameUpdated(int32 width) const; virtual UserData *viaBot() const { @@ -2157,7 +2257,7 @@ public: void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const; void setViewsCount(int32 count, bool reinit = true); void setId(MsgId newId); - void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; + void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; virtual void drawMessageText(Painter &p, QRect trect, uint32 selection) const; @@ -2247,7 +2347,14 @@ public: protected: - void create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); + HistoryMessage(History *history, const MTPDmessage &msg); + HistoryMessage(History *history, MsgId msgId, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd); // local forwarded + HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message + HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document + HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo + friend class HistoryItemInstantiated; + + void createInterfaces(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); bool displayForwardedFrom() const { if (const HistoryMessageForwarded *fwd = Get()) { @@ -2267,12 +2374,18 @@ protected: }; -class HistoryReply : public HistoryMessage { +class HistoryReply : public HistoryMessage, private HistoryItemInstantiated { public: - HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryReply(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryReply(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + static HistoryReply *create(History *history, const MTPDmessage &msg) { + return _create(history, msg); + } + static HistoryReply *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + return _create(history, msgId, flags, viaBotId, replyTo, date, from, doc, caption); + } + static HistoryReply *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + return _create(history, msgId, flags, viaBotId, replyTo, date, from, photo, caption); + } void initDimensions() override; @@ -2316,6 +2429,12 @@ public: protected: + HistoryReply(History *history, const MTPDmessage &msg); + HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + using HistoryItemInstantiated::_create; + friend class HistoryItemInstantiated; + bool updateReplyTo(bool force = false); void replyToNameUpdated() const; @@ -2358,11 +2477,15 @@ struct HistoryServicePinned : public BasicInterface { TextLinkPtr lnk; }; -class HistoryServiceMsg : public HistoryItem { +class HistoryServiceMsg : public HistoryItem, private HistoryItemInstantiated { public: - HistoryServiceMsg(History *history, HistoryBlock *block, const MTPDmessageService &msg); - HistoryServiceMsg(History *history, HistoryBlock *block, MsgId msgId, QDateTime date, const QString &msg, int32 flags = 0, HistoryMedia *media = 0, int32 from = 0); + static HistoryServiceMsg *create(History *history, const MTPDmessageService &msg) { + return _create(history, msg); + } + static HistoryServiceMsg *create(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags = 0, HistoryMedia *media = 0, int32 from = 0) { + return _create(history, msgId, date, msg, flags, media, from); + } void initDimensions() override; @@ -2421,6 +2544,10 @@ public: protected: + HistoryServiceMsg(History *history, const MTPDmessageService &msg); + HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags = 0, HistoryMedia *media = 0, int32 from = 0); + friend class HistoryItemInstantiated; + void setMessageByAction(const MTPmessageAction &action); bool updatePinned(bool force = false); bool updatePinnedText(const QString *pfrom = nullptr, QString *ptext = nullptr); @@ -2431,33 +2558,16 @@ protected: int32 _textWidth, _textHeight; }; -class HistoryDateMsg : public HistoryServiceMsg { +class HistoryGroup : public HistoryServiceMsg, private HistoryItemInstantiated { public: - HistoryDateMsg(History *history, HistoryBlock *block, const QDate &date); - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { - lnk = TextLinkPtr(); - state = HistoryDefaultCursorState; + static HistoryGroup *create(History *history, const MTPDmessageGroup &group, const QDateTime &date) { + return _create(history, group, date); } - void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { - symbol = 0xFFFF; - after = false; - upon = false; + static HistoryGroup *create(History *history, HistoryItem *newItem, const QDateTime &date) { + return _create(history, newItem, date); } - void setDate(const QDateTime &date); - QString selectedText(uint32 selection) const { - return QString(); - } - HistoryItemType type() const { - return HistoryItemDate; - } -}; -class HistoryGroup : public HistoryServiceMsg { -public: - - HistoryGroup(History *history, HistoryBlock *block, const MTPDmessageGroup &group, const QDateTime &date); - HistoryGroup(History *history, HistoryBlock *block, HistoryItem *newItem, const QDateTime &date); void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { symbol = 0xFFFF; @@ -2487,6 +2597,13 @@ public: return _maxId; } +protected: + + HistoryGroup(History *history, const MTPDmessageGroup &group, const QDateTime &date); + HistoryGroup(History *history, HistoryItem *newItem, const QDateTime &date); + using HistoryItemInstantiated::_create; + friend class HistoryItemInstantiated; + private: MsgId _minId, _maxId; int32 _count; @@ -2497,10 +2614,13 @@ private: }; -class HistoryCollapse : public HistoryServiceMsg { +class HistoryCollapse : public HistoryServiceMsg, private HistoryItemInstantiated { public: - HistoryCollapse(History *history, HistoryBlock *block, MsgId wasMinId, const QDateTime &date); + static HistoryCollapse *create(History *history, MsgId wasMinId, const QDateTime &date) { + return _create(history, wasMinId, date); + } + void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { @@ -2518,46 +2638,32 @@ public: return _wasMinId; } +protected: + + HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date); + using HistoryItemInstantiated::_create; + friend class HistoryItemInstantiated; + private: MsgId _wasMinId; }; -class HistoryJoined : public HistoryServiceMsg { +class HistoryJoined : public HistoryServiceMsg, private HistoryItemInstantiated { public: - HistoryJoined(History *history, HistoryBlock *block, const QDateTime &date, UserData *from, int32 flags); + static HistoryJoined *create(History *history, const QDateTime &date, UserData *from, int32 flags) { + return _create(history, date, from, flags); + } + HistoryItemType type() const { return HistoryItemJoined; } -}; - -HistoryItem *createDayServiceMsg(History *history, HistoryBlock *block, QDateTime date); - -class HistoryUnreadBar : public HistoryItem { -public: - - HistoryUnreadBar(History *history, HistoryBlock *block, int32 count, const QDateTime &date); - - void initDimensions(); - - void setCount(int32 count); - - void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; - int32 resize(int32 width); - - void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const; - QString notificationText() const; - - QString selectedText(uint32 selection) const { - return QString(); - } - HistoryItemType type() const { - return HistoryItemUnreadBar; - } protected: - QString text; - bool freezed; + HistoryJoined(History *history, const QDateTime &date, UserData *from, int32 flags); + using HistoryItemInstantiated::_create; + friend class HistoryItemInstantiated; + }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index ecbdfcb6a..dfede8936 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3601,16 +3601,9 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _history->lastShowAtMsgId = ShowAtUnreadMsgId; } _history->lastScrollTop = _scroll.scrollTop(); - if (_history->unreadBar) { - _history->unreadBar->destroy(); - } - if (_migrated && _migrated->unreadBar) { - _migrated->unreadBar->destroy(); - } - if (_pinnedBar) { - destroyPinnedBar(); - } - _history = _migrated = 0; + destroyUnreadBar(); + if (_pinnedBar) destroyPinnedBar(); + _history = _migrated = nullptr; updateBotKeyboard(); } @@ -4132,12 +4125,17 @@ void HistoryWidget::updateMouseTracking() { setMouseTracking(trackMouse); } +void HistoryWidget::destroyUnreadBar() { + if (_history) _history->destroyUnreadBar(); + if (_migrated) _migrated->destroyUnreadBar(); +} + void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) { if (App::wnd()->historyIsActive()) { if (_history == history) { historyWasRead(); if (_scroll.scrollTop() + 1 > _scroll.scrollTopMax()) { - if (history->unreadBar) history->unreadBar->destroy(); + destroyUnreadBar(); } } else { App::wnd()->notifySchedule(history, item); @@ -4146,8 +4144,7 @@ void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) { } else { if (_history == history) { if (_scroll.scrollTop() + 1 > _scroll.scrollTopMax()) { - if (history->unreadBar) history->unreadBar->destroy(); - if (_migrated && _migrated->unreadBar) _migrated->unreadBar->destroy(); + destroyUnreadBar(); } } App::wnd()->notifySchedule(history, item); @@ -4332,12 +4329,7 @@ void HistoryWidget::messagesReceived(PeerData *peer, const MTPmessages_Messages void HistoryWidget::historyLoaded() { countHistoryShowFrom(); - if (_history->unreadBar) { - _history->unreadBar->destroy(); - } - if (_migrated && _migrated->unreadBar) { - _migrated->unreadBar->destroy(); - } + destroyUnreadBar(); doneShow(); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 1ee9fc014..cc94d93a3 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -754,6 +754,9 @@ private: void updateMouseTracking(); + // destroys _history and _migrated unread bars + void destroyUnreadBar(); + mtpRequestId _saveEditMsgRequestId; void saveEditMsg(); void saveEditMsgDone(History *history, const MTPUpdates &updates, mtpRequestId req); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 5c02a99e4..5681ca685 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1685,9 +1685,9 @@ void MainWidget::overviewLoaded(History *history, const MTPmessages_Messages &re void MainWidget::sendReadRequest(PeerData *peer, MsgId upTo) { if (!MTP::authedId()) return; if (peer->isChannel()) { - _readRequests.insert(peer, qMakePair(MTP::send(MTPchannels_ReadHistory(peer->asChannel()->inputChannel, MTP_int(upTo)), rpcDone(&MainWidget::channelWasRead, peer), rpcFail(&MainWidget::readRequestFail, peer)), upTo)); +// _readRequests.insert(peer, qMakePair(MTP::send(MTPchannels_ReadHistory(peer->asChannel()->inputChannel, MTP_int(upTo)), rpcDone(&MainWidget::channelWasRead, peer), rpcFail(&MainWidget::readRequestFail, peer)), upTo)); } else { - _readRequests.insert(peer, qMakePair(MTP::send(MTPmessages_ReadHistory(peer->input, MTP_int(upTo)), rpcDone(&MainWidget::historyWasRead, peer), rpcFail(&MainWidget::readRequestFail, peer)), upTo)); +// _readRequests.insert(peer, qMakePair(MTP::send(MTPmessages_ReadHistory(peer->input, MTP_int(upTo)), rpcDone(&MainWidget::historyWasRead, peer), rpcFail(&MainWidget::readRequestFail, peer)), upTo)); } } diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 9adbd6b08..70c9a7558 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -533,21 +533,21 @@ inline void destroyImplementation(I *&ptr) { class Interfaces; typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); typedef void(*InterfaceDestruct)(void *location); -typedef void(*InterfaceAssign)(void *location, void *waslocation); +typedef void(*InterfaceMove)(void *location, void *waslocation); struct InterfaceWrapStruct { InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { } - InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct, InterfaceAssign assign) + InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct, InterfaceMove move) : Size(size) , Construct(construct) , Destruct(destruct) - , Assign(assign) { + , Move(move) { } int Size; InterfaceConstruct Construct; InterfaceDestruct Destruct; - InterfaceAssign Assign; + InterfaceMove Move; }; template @@ -564,8 +564,8 @@ struct InterfaceWrapTemplate { static void Destruct(void *location) { ((Type*)location)->~Type(); } - static void Assign(void *location, void *waslocation) { - *((Type*)location) = *((Type*)waslocation); + static void Move(void *location, void *waslocation) { + *(Type*)location = *(Type*)waslocation; } }; @@ -585,7 +585,7 @@ public: if (InterfaceIndexLast.testAndSetOrdered(last, last + 1)) { t_assert(last < 64); if (_index.testAndSetOrdered(0, last + 1)) { - InterfaceWraps[last] = InterfaceWrapStruct(InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct, InterfaceWrapTemplate::Assign); + InterfaceWraps[last] = InterfaceWrapStruct(InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct, InterfaceWrapTemplate::Move); } break; } @@ -634,9 +634,15 @@ public: int size, last; int offsets[64]; - bool equals(const uint64 &mask) const { + bool equals(uint64 mask) const { return _mask == mask; } + uint64 maskadd(uint64 mask) const { + return _mask | mask; + } + uint64 maskremove(uint64 mask) const { + return _mask & (~mask); + } private: uint64 _mask; @@ -682,18 +688,23 @@ public: if (!_meta()->equals(mask)) { Interfaces tmp(mask); tmp.swap(*this); - if (_data != zerodata() && tmp._data != zerodata()) { const InterfacesMetadata *meta = _meta(), *wasmeta = tmp._meta(); for (int i = 0; i < meta->last; ++i) { int offset = meta->offsets[i], wasoffset = wasmeta->offsets[i]; if (offset >= 0 && wasoffset >= 0) { - InterfaceWraps[i].Assign(_dataptrunsafe(offset), tmp._dataptrunsafe(wasoffset)); + InterfaceWraps[i].Move(_dataptrunsafe(offset), tmp._dataptrunsafe(wasoffset)); } } } } } + void AddInterfaces(uint64 mask = 0) { + UpdateInterfaces(_meta()->maskadd(mask)); + } + void RemoveInterfaces(uint64 mask = 0) { + UpdateInterfaces(_meta()->maskremove(mask)); + } ~Interfaces() { if (_data != zerodata()) { const InterfacesMetadata *meta = _meta(); From 2ef8c4444534c32100c9e2c02860da74c1fb9c24 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 19 Mar 2016 19:55:15 +0300 Subject: [PATCH 04/10] all MTP flags made strictly typed by scoped enums, in-message date display added for non-service messages --- Telegram/SourceFiles/apiwrap.cpp | 21 +- Telegram/SourceFiles/app.cpp | 52 +- Telegram/SourceFiles/app.h | 4 +- Telegram/SourceFiles/application.cpp | 4 + Telegram/SourceFiles/application.h | 2 + Telegram/SourceFiles/audio.cpp | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 8 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 8 +- Telegram/SourceFiles/boxes/passcodebox.cpp | 6 +- Telegram/SourceFiles/boxes/photosendbox.cpp | 8 +- Telegram/SourceFiles/boxes/stickersetbox.cpp | 78 +- Telegram/SourceFiles/boxes/stickersetbox.h | 3 +- Telegram/SourceFiles/dialogswidget.cpp | 21 +- Telegram/SourceFiles/dropdown.cpp | 106 +- Telegram/SourceFiles/dropdown.h | 6 +- Telegram/SourceFiles/facades.cpp | 37 +- Telegram/SourceFiles/facades.h | 34 +- Telegram/SourceFiles/history.cpp | 297 +- Telegram/SourceFiles/history.h | 221 +- Telegram/SourceFiles/historywidget.cpp | 243 +- Telegram/SourceFiles/historywidget.h | 8 +- Telegram/SourceFiles/intro/introphone.cpp | 8 +- Telegram/SourceFiles/localimageloader.cpp | 2 +- Telegram/SourceFiles/localstorage.cpp | 126 +- Telegram/SourceFiles/mainwidget.cpp | 144 +- Telegram/SourceFiles/mainwidget.h | 3 +- Telegram/SourceFiles/mtproto/generate.py | 150 +- Telegram/SourceFiles/mtproto/mtp.h | 11 + .../SourceFiles/mtproto/mtpConnection.cpp | 66 +- Telegram/SourceFiles/mtproto/mtpConnection.h | 62 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp | 6 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 128 +- Telegram/SourceFiles/mtproto/mtpDC.cpp | 14 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 3510 ++++++------ Telegram/SourceFiles/mtproto/mtpScheme.h | 4757 +++++++++++------ Telegram/SourceFiles/overviewwidget.cpp | 23 +- Telegram/SourceFiles/settings.cpp | 5 - Telegram/SourceFiles/settings.h | 30 - Telegram/SourceFiles/settingswidget.cpp | 4 +- Telegram/SourceFiles/structs.cpp | 12 +- Telegram/SourceFiles/structs.h | 68 +- Telegram/SourceFiles/types.h | 5 + Telegram/SourceFiles/window.cpp | 5 +- 43 files changed, 6141 insertions(+), 4167 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 4632b36f1..720e37ccc 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -230,7 +230,7 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt } if (f.has_migrated_from_chat_id()) { if (!channel->mgInfo) { - channel->flags |= MTPDchannel::flag_megagroup; + channel->flags |= MTPDchannel::Flag::f_megagroup; channel->flagsUpdated(); } ChatData *cfrom = App::chat(peerFromChat(f.vmigrated_from_chat_id)); @@ -685,8 +685,8 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) if (d.vset.type() != mtpc_stickerSet) return; const MTPDstickerSet &s(d.vset.c_stickerSet()); - StickerSets &sets(cRefStickerSets()); - StickerSets::iterator it = sets.find(setId); + Stickers::Sets &sets(Global::RefStickerSets()); + auto it = sets.find(setId); if (it == sets.cend()) return; it->access = s.vaccess_hash.v; @@ -696,7 +696,7 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) it->flags = s.vflags.v; const QVector &d_docs(d.vdocuments.c_vector().v); - StickerSets::iterator custom = sets.find(CustomStickerSetId); + auto custom = sets.find(Stickers::CustomSetId); StickerPack pack; pack.reserve(d_docs.size()); @@ -729,8 +729,8 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) } if (pack.isEmpty()) { - int32 removeIndex = cStickerSetsOrder().indexOf(setId); - if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); + int removeIndex = Global::StickerSetsOrder().indexOf(setId); + if (removeIndex >= 0) Global::RefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } else { it->stickers = pack; @@ -903,10 +903,8 @@ void ApiWrap::gotWebPages(ChannelData *channel, const MTPmessages_Messages &msgs } for (QMap::const_iterator i = msgsIds.cbegin(), e = msgsIds.cend(); i != e; ++i) { - HistoryItem *item = App::histories().addNewMessage(v->at(i.value()), NewMessageExisting); - if (item) { - item->initDimensions(); - Notify::historyItemResized(item); + if (HistoryItem *item = App::histories().addNewMessage(v->at(i.value()), NewMessageExisting)) { + item->setPendingInitDimensions(); } } @@ -918,8 +916,7 @@ void ApiWrap::gotWebPages(ChannelData *channel, const MTPmessages_Messages &msgs WebPageItems::const_iterator j = items.constFind(i.key()); if (j != items.cend()) { for (HistoryItemsMap::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { - k.key()->initDimensions(); - Notify::historyItemResized(k.key()); + k.key()->setPendingInitDimensions(); } } } diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 61e44eef0..39956672a 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -57,7 +57,7 @@ namespace { typedef QMap ReplyMarkups; ReplyMarkups replyMarkups; - ReplyMarkup zeroMarkup(MTPDreplyKeyboardMarkup_flag_ZERO); + ReplyMarkup zeroMarkup(qFlags(MTPDreplyKeyboardMarkup_ClientFlag::f_zero)); typedef QMap ChannelReplyMarkups; ChannelReplyMarkups channelReplyMarkups; @@ -507,7 +507,7 @@ namespace App { const MTPDinputChannel &c(d.vmigrated_to.c_inputChannel()); ChannelData *channel = App::channel(peerFromChannel(c.vchannel_id)); if (!channel->mgInfo) { - channel->flags |= MTPDchannel::flag_megagroup; + channel->flags |= MTPDchannel::Flag::f_megagroup; channel->flagsUpdated(); } if (!channel->access) { @@ -538,7 +538,7 @@ namespace App { } } - if (!(cdata->flags & MTPDchat::flag_admins_enabled) && (d.vflags.v & MTPDchat::flag_admins_enabled)) { + if (!(cdata->flags & MTPDchat::Flag::f_admins_enabled) && (d.vflags.v & MTPDchat::Flag::f_admins_enabled)) { cdata->invalidateParticipants(); } cdata->flags = d.vflags.v; @@ -583,7 +583,7 @@ namespace App { ChannelData *cdata = data->asChannel(); if (minimal) { - int32 mask = MTPDchannel::flag_broadcast | MTPDchannel::flag_verified | MTPDchannel::flag_megagroup | MTPDchannel::flag_democracy; + int32 mask = MTPDchannel::Flag::f_broadcast | MTPDchannel::Flag::f_verified | MTPDchannel::Flag::f_megagroup | MTPDchannel::Flag::f_democracy; cdata->flags = (cdata->flags & ~mask) | (d.vflags.v & mask); } else { cdata->inputChannel = MTP_inputChannel(d.vid, d.vaccess_hash); @@ -654,7 +654,7 @@ namespace App { int32 pversion = chat->participants.isEmpty() ? 1 : (chat->participants.begin().value() + 1); chat->invitedByMe = ChatData::InvitedByMe(); chat->admins = ChatData::Admins(); - chat->flags &= ~MTPDchat::flag_admin; + chat->flags &= ~MTPDchat::Flag::f_admin; for (QVector::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) { int32 uid = 0, inviter = 0; switch (i->type()) { @@ -685,7 +685,7 @@ namespace App { if (i->type() == mtpc_chatParticipantAdmin) { chat->admins.insert(user); if (user->isSelf()) { - chat->flags |= MTPDchat::flag_admin; + chat->flags |= MTPDchat::Flag::f_admin; } } } else { @@ -805,7 +805,7 @@ namespace App { chat->invitedByMe.remove(user); chat->admins.remove(user); if (user->isSelf()) { - chat->flags &= ~MTPDchat::flag_admin; + chat->flags &= ~MTPDchat::Flag::f_admin; } History *h = App::historyLoaded(chat->id); @@ -852,13 +852,13 @@ namespace App { } chat->version = d.vversion.v; if (mtpIsTrue(d.venabled)) { - chat->flags |= MTPDchat::flag_admins_enabled; + chat->flags |= MTPDchat::Flag::f_admins_enabled; if (!badVersion) { chat->invalidateParticipants(); } } else { - chat->flags &= ~MTPDchat::flag_admins_enabled; - chat->flags &= ~MTPDchat::flag_admin; + chat->flags &= ~MTPDchat::Flag::f_admins_enabled; + chat->flags &= ~MTPDchat::Flag::f_admin; } if (emitPeerUpdated) { App::main()->peerUpdated(chat); @@ -887,7 +887,7 @@ namespace App { if (user) { if (mtpIsTrue(d.vis_admin)) { if (user->isSelf()) { - chat->flags |= MTPDchat::flag_admin; + chat->flags |= MTPDchat::Flag::f_admin; } if (chat->noParticipantInfo()) { App::api()->requestFullPeer(chat); @@ -896,7 +896,7 @@ namespace App { } } else { if (user->isSelf()) { - chat->flags &= ~MTPDchat::flag_admin; + chat->flags &= ~MTPDchat::Flag::f_admin; } chat->admins.remove(user); } @@ -921,10 +921,7 @@ namespace App { if (HistoryItem *existing = App::histItemById(peerToChannel(peerId), m.vid.v)) { existing->setText(qs(m.vmessage), m.has_entities() ? entitiesFromMTP(m.ventities.c_vector().v) : EntitiesInText()); existing->updateMedia(m.has_media() ? (&m.vmedia) : 0); - existing->setViewsCount(m.has_views() ? m.vviews.v : -1, false); - existing->initDimensions(); - Notify::historyItemResized(existing); - + existing->setViewsCount(m.has_views() ? m.vviews.v : -1); existing->addToOverview(AddToOverviewNew); if (!existing->detached()) { @@ -945,16 +942,13 @@ namespace App { if (HistoryItem *existing = App::histItemById(peerToChannel(peerId), m.vid.v)) { existing->setText(qs(m.vmessage), m.has_entities() ? entitiesFromMTP(m.ventities.c_vector().v) : EntitiesInText()); existing->updateMedia(m.has_media() ? (&m.vmedia) : 0, true); - existing->setViewsCount(m.has_views() ? m.vviews.v : -1, false); - existing->initDimensions(); + existing->setViewsCount(m.has_views() ? m.vviews.v : -1); if (existing->history()->textCachedFor == existing) { existing->history()->textCachedFor = 0; } if (App::main()) { App::main()->dlgUpdated(existing->history(), existing->id); } - App::historyUpdateDependent(existing); - Notify::historyItemResized(existing); } } @@ -1095,7 +1089,6 @@ namespace App { } void feedWereDeleted(ChannelId channelId, const QVector &msgsIds) { - bool resized = false; MsgsData *data = fetchMsgsData(channelId, false); if (!data) return; @@ -1106,9 +1099,6 @@ namespace App { MsgsData::const_iterator j = data->constFind(i->v); if (j != data->cend()) { History *h = (*j)->history(); - if (App::main() && (h->peer == App::main()->peer() || (App::main()->peer() && h->peer->migrateTo() == App::main()->peer())) && !(*j)->detached()) { - resized = true; - } (*j)->destroy(); if (!h->lastMsg) historiesToCheck.insert(h, true); } else { @@ -1120,9 +1110,6 @@ namespace App { } } } - if (resized) { - Notify::historyItemsResized(); - } if (main()) { for (QMap::const_iterator i = historiesToCheck.cbegin(), e = historiesToCheck.cend(); i != e; ++i) { main()->checkPeerHistory(i.key()->peer); @@ -1788,6 +1775,7 @@ namespace App { if (App::wnd()) { App::wnd()->notifyItemRemoved(item); } + item->history()->setPendingResize(); } void historyUnregItem(HistoryItem *item) { @@ -1878,9 +1866,9 @@ namespace App { webPagesData.clear(); if (api()) api()->clearWebPageRequests(); cSetRecentStickers(RecentStickerPack()); - cSetStickerSets(StickerSets()); - cSetStickerSetsOrder(StickerSetsOrder()); - cSetLastStickersUpdate(0); + Global::SetStickerSets(Stickers::Sets()); + Global::SetStickerSetsOrder(Stickers::Order()); + Global::SetLastStickersUpdate(0); cSetSavedGifs(SavedGifs()); cSetLastSavedGifsUpdate(0); cSetReportSpamStatuses(ReportSpamStatuses()); @@ -2446,13 +2434,13 @@ namespace App { case mtpc_replyKeyboardHide: { const MTPDreplyKeyboardHide &d(markup.c_replyKeyboardHide()); if (d.vflags.v) { - insertReplyMarkup(channelId, msgId, ReplyMarkup(d.vflags.v | MTPDreplyKeyboardMarkup_flag_ZERO)); + insertReplyMarkup(channelId, msgId, ReplyMarkup(mtpCastFlags(d.vflags.v) | MTPDreplyKeyboardMarkup_ClientFlag::f_zero)); } } break; case mtpc_replyKeyboardForceReply: { const MTPDreplyKeyboardForceReply &d(markup.c_replyKeyboardForceReply()); - insertReplyMarkup(channelId, msgId, ReplyMarkup(d.vflags.v | MTPDreplyKeyboardMarkup_flag_FORCE_REPLY)); + insertReplyMarkup(channelId, msgId, ReplyMarkup(mtpCastFlags(d.vflags.v) | MTPDreplyKeyboardMarkup_ClientFlag::f_force_reply)); } break; } } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index aeaaf5c87..36ea5d791 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -45,11 +45,11 @@ typedef QHash PhotosData; typedef QHash DocumentsData; struct ReplyMarkup { - ReplyMarkup(int32 flags = 0) : flags(flags) { + ReplyMarkup(MTPDreplyKeyboardMarkup::Flags flags = 0) : flags(flags) { } typedef QList > Commands; Commands commands; - int32 flags; + MTPDreplyKeyboardMarkup::Flags flags; }; class LayeredWidget; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 610f6a26a..23809f40c 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -899,6 +899,10 @@ void AppClass::onAppStateChanged(Qt::ApplicationState state) { } } +void AppClass::call_handleHistoryUpdate() { + Notify::handlePendingHistoryUpdate(); +} + void AppClass::killDownloadSessions() { uint64 ms = getms(), left = MTPAckSendWaiting + MTPKillFileSessionTimeout; for (QMap::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) { diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 1f69aaaa4..3e0a37e56 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -200,6 +200,8 @@ public slots: void killDownloadSessions(); void onAppStateChanged(Qt::ApplicationState state); + void call_handleHistoryUpdate(); + private: QMap photoUpdates; diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 6393fc3dd..48a5834cc 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -2505,7 +2505,7 @@ MTPDocumentAttribute audioReadSongAttributes(const QString &fname, const QByteAr cover = reader.cover(); coverBytes = reader.coverBytes(); coverFormat = reader.coverFormat(); - return MTP_documentAttributeAudio(MTP_int(MTPDdocumentAttributeAudio::flag_title | MTPDdocumentAttributeAudio::flag_performer), MTP_int(duration), MTP_string(reader.title()), MTP_string(reader.performer()), MTPstring()); + return MTP_documentAttributeAudio(MTP_flags(MTPDdocumentAttributeAudio::Flag::f_title | MTPDdocumentAttributeAudio::Flag::f_performer), MTP_int(duration), MTP_string(reader.title()), MTP_string(reader.performer()), MTPstring()); } } return MTP_documentAttributeFilename(MTP_string(fname)); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index c70c7caf0..8a39799e0 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -499,8 +499,8 @@ void GroupInfoBox::onNext() { Ui::showLayer(new ContactsBox(title, _photoBig), KeepOtherLayers); } else { bool mega = false; - int32 flags = mega ? MTPchannels_CreateChannel::flag_megagroup : MTPchannels_CreateChannel::flag_broadcast; - _creationRequestId = MTP::send(MTPchannels_CreateChannel(MTP_int(flags), MTP_string(title), MTP_string(description)), rpcDone(&GroupInfoBox::creationDone), rpcFail(&GroupInfoBox::creationFail)); + MTPchannels_CreateChannel::Flags flags = mega ? MTPchannels_CreateChannel::Flag::f_megagroup : MTPchannels_CreateChannel::Flag::f_broadcast; + _creationRequestId = MTP::send(MTPchannels_CreateChannel(MTP_flags(flags), MTP_string(title), MTP_string(description)), rpcDone(&GroupInfoBox::creationDone), rpcFail(&GroupInfoBox::creationFail)); } } @@ -1115,8 +1115,8 @@ void EditNameTitleBox::onSave() { } _sentName = first; if (_peer == App::self()) { - int32 flags = MTPaccount_UpdateProfile::flag_first_name | MTPaccount_UpdateProfile::flag_last_name; - _requestId = MTP::send(MTPaccount_UpdateProfile(MTP_int(flags), MTP_string(first), MTP_string(last), MTPstring()), rpcDone(&EditNameTitleBox::onSaveSelfDone), rpcFail(&EditNameTitleBox::onSaveSelfFail)); + MTPaccount_UpdateProfile::Flags flags = MTPaccount_UpdateProfile::Flag::f_first_name | MTPaccount_UpdateProfile::Flag::f_last_name; + _requestId = MTP::send(MTPaccount_UpdateProfile(MTP_flags(flags), MTP_string(first), MTP_string(last), MTPstring()), rpcDone(&EditNameTitleBox::onSaveSelfDone), rpcFail(&EditNameTitleBox::onSaveSelfFail)); } else if (_peer->isChat()) { _requestId = MTP::send(MTPmessages_EditChatTitle(_peer->asChat()->inputChat, MTP_string(first)), rpcDone(&EditNameTitleBox::onSaveChatDone), rpcFail(&EditNameTitleBox::onSaveChatFail)); } diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index 9de665253..3e379aae0 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -404,8 +404,11 @@ void PinMessageBox::resizeEvent(QResizeEvent *e) { void PinMessageBox::onPin() { if (_requestId) return; - int32 flags = _notify.checked() ? 0 : MTPchannels_UpdatePinnedMessage::flag_silent; - _requestId = MTP::send(MTPchannels_UpdatePinnedMessage(MTP_int(flags), _channel->inputChannel, MTP_int(_msgId)), rpcDone(&PinMessageBox::pinDone), rpcFail(&PinMessageBox::pinFail)); + MTPchannels_UpdatePinnedMessage::Flags flags = 0; + if (_notify.checked()) { + flags |= MTPchannels_UpdatePinnedMessage::Flag::f_silent; + } + _requestId = MTP::send(MTPchannels_UpdatePinnedMessage(MTP_flags(flags), _channel->inputChannel, MTP_int(_msgId)), rpcDone(&PinMessageBox::pinDone), rpcFail(&PinMessageBox::pinFail)); } void PinMessageBox::showAll() { @@ -482,7 +485,6 @@ void RichDeleteMessageBox::onDelete() { App::main()->checkPeerHistory(_channel); } } - Notify::historyItemsResized(); Ui::hideLayer(); } diff --git a/Telegram/SourceFiles/boxes/passcodebox.cpp b/Telegram/SourceFiles/boxes/passcodebox.cpp index b0815abb2..c90e4c0b4 100644 --- a/Telegram/SourceFiles/boxes/passcodebox.cpp +++ b/Telegram/SourceFiles/boxes/passcodebox.cpp @@ -400,11 +400,11 @@ void PasscodeBox::onSave(bool force) { if (!_oldPasscode.isHidden()) { hashSha256(oldPasswordData.constData(), oldPasswordData.size(), oldPasswordHash.data()); } - int32 flags = MTPDaccount_passwordInputSettings::flag_new_salt | MTPDaccount_passwordInputSettings::flag_new_password_hash | MTPDaccount_passwordInputSettings::flag_hint; + MTPDaccount_passwordInputSettings::Flags flags = MTPDaccount_passwordInputSettings::Flag::f_new_salt | MTPDaccount_passwordInputSettings::Flag::f_new_password_hash | MTPDaccount_passwordInputSettings::Flag::f_hint; if (_oldPasscode.isHidden() || _newPasscode.isHidden()) { - flags |= MTPDaccount_passwordInputSettings::flag_email; + flags |= MTPDaccount_passwordInputSettings::Flag::f_email; } - MTPaccount_PasswordInputSettings settings(MTP_account_passwordInputSettings(MTP_int(flags), MTP_string(_newSalt), MTP_string(newPasswordHash), MTP_string(hint), MTP_string(email))); + MTPaccount_PasswordInputSettings settings(MTP_account_passwordInputSettings(MTP_flags(flags), MTP_string(_newSalt), MTP_string(newPasswordHash), MTP_string(hint), MTP_string(email))); _setRequest = MTP::send(MTPaccount_UpdatePasswordSettings(MTP_string(oldPasswordHash), settings), rpcDone(&PasscodeBox::setPasswordDone), rpcFail(&PasscodeBox::setPasswordFail)); } } else { diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index cfe7664f3..f3a202ccc 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -648,15 +648,15 @@ void EditCaptionBox::onSave(bool ctrlShiftEnter) { return; } - int32 flags = 0; + MTPchannels_EditMessage::Flags flags = 0; if (_previewCancelled) { - flags |= MTPchannels_EditMessage::flag_no_webpage; + flags |= MTPchannels_EditMessage::Flag::f_no_webpage; } MTPVector sentEntities; if (!sentEntities.c_vector().v.isEmpty()) { - flags |= MTPmessages_SendMessage::flag_entities; + flags |= MTPchannels_EditMessage::Flag::f_entities; } - _saveRequestId = MTP::send(MTPchannels_EditMessage(MTP_int(flags), item->history()->peer->asChannel()->inputChannel, MTP_int(item->id), MTP_string(_field->getLastText()), sentEntities), rpcDone(&EditCaptionBox::saveDone), rpcFail(&EditCaptionBox::saveFail)); + _saveRequestId = MTP::send(MTPchannels_EditMessage(MTP_flags(flags), item->history()->peer->asChannel()->inputChannel, MTP_int(item->id), MTP_string(_field->getLastText()), sentEntities), rpcDone(&EditCaptionBox::saveDone), rpcFail(&EditCaptionBox::saveFail)); } void EditCaptionBox::saveDone(const MTPUpdates &updates) { diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index b9632b4f8..fd0d70e0a 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -117,17 +117,17 @@ bool StickerSetInner::failedSet(const RPCError &error) { } void StickerSetInner::installDone(const MTPBool &result) { - StickerSets &sets(cRefStickerSets()); + Stickers::Sets &sets(Global::RefStickerSets()); - _setFlags &= ~MTPDstickerSet::flag_disabled; - StickerSets::iterator it = sets.find(_setId); + _setFlags &= ~MTPDstickerSet::Flag::f_disabled; + auto it = sets.find(_setId); if (it == sets.cend()) { - it = sets.insert(_setId, StickerSet(_setId, _setAccess, _setTitle, _setShortName, _setCount, _setHash, _setFlags)); + it = sets.insert(_setId, Stickers::Set(_setId, _setAccess, _setTitle, _setShortName, _setCount, _setHash, _setFlags)); } it.value().stickers = _pack; it.value().emoji = _emoji; - StickerSetsOrder &order(cRefStickerSetsOrder()); + Stickers::Order &order(Global::RefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(_setId); if (currentIndex != insertAtIndex) { if (currentIndex > 0) { @@ -136,7 +136,7 @@ void StickerSetInner::installDone(const MTPBool &result) { order.insert(insertAtIndex, _setId); } - StickerSets::iterator custom = sets.find(CustomStickerSetId); + auto custom = sets.find(Stickers::CustomSetId); if (custom != sets.cend()) { for (int32 i = 0, l = _pack.size(); i < l; ++i) { int32 removeIndex = custom->stickers.indexOf(_pack.at(i)); @@ -256,8 +256,8 @@ bool StickerSetInner::loaded() const { int32 StickerSetInner::notInstalled() const { if (!_loaded) return 0; - StickerSets::const_iterator it = cStickerSets().constFind(_setId); - if (it == cStickerSets().cend() || (it->flags & MTPDstickerSet::flag_disabled)) return _pack.size(); + auto it = Global::StickerSets().constFind(_setId); + if (it == Global::StickerSets().cend() || (it->flags & MTPDstickerSet::Flag::f_disabled)) return _pack.size(); return 0; } @@ -682,14 +682,14 @@ void StickersInner::rebuild() { int32 namew = st::boxWideWidth - namex - st::contactsPadding.right() - st::contactsCheckPosition.x() - qMax(qMax(_returnWidth, _removeWidth), _restoreWidth); clear(); - const StickerSetsOrder &order(cStickerSetsOrder()); + const Stickers::Order &order(Global::StickerSetsOrder()); _animStartTimes.reserve(order.size()); - const StickerSets &sets(cStickerSets()); - for (int32 i = 0, l = order.size(); i < l; ++i) { - StickerSets::const_iterator it = sets.constFind(order.at(i)); + const Stickers::Sets &sets(Global::StickerSets()); + for (int i = 0, l = order.size(); i < l; ++i) { + auto it = sets.constFind(order.at(i)); if (it != sets.cend()) { - bool disabled = (it->flags & MTPDstickerSet::flag_disabled); + bool disabled = (it->flags & MTPDstickerSet::Flag::f_disabled); DocumentData *sticker = it->stickers.isEmpty() ? 0 : it->stickers.at(0); int32 pixw = 0, pixh = 0; @@ -714,10 +714,10 @@ void StickersInner::rebuild() { if (titleWidth > namew) { title = st::contactsNameFont->elided(title, namew); } - bool official = (it->flags & MTPDstickerSet::flag_official); + bool official = (it->flags & MTPDstickerSet::Flag::f_official); (disabled ? rowsDisabled : rows).push_back(new StickerSetRow(it->id, sticker, it->stickers.size(), title, official, disabled, pixw, pixh)); _animStartTimes.push_back(0); - if (it->stickers.isEmpty() || (it->flags & MTPDstickerSet_flag_NOT_LOADED)) { + if (it->stickers.isEmpty() || (it->flags & MTPDstickerSet_ClientFlag::f_not_loaded)) { App::api()->scheduleStickerSetRequest(it->id, it->access); } } @@ -732,8 +732,8 @@ QVector StickersInner::getOrder() const { result.reserve(_rows.size()); for (int32 i = 0, l = _rows.size(); i < l; ++i) { if (_rows.at(i)->disabled) { - StickerSets::const_iterator it = cStickerSets().constFind(_rows.at(i)->id); - if (it == cStickerSets().cend() || !(it->flags & MTPDstickerSet::flag_official)) { + auto it = Global::StickerSets().constFind(_rows.at(i)->id); + if (it == Global::StickerSets().cend() || !(it->flags & MTPDstickerSet::Flag::f_official)) { continue; } } @@ -833,7 +833,7 @@ void StickersBox::reorderDone(const MTPBool &result) { bool StickersBox::reorderFail(const RPCError &result) { if (mtpIsFlood(result)) return false; _reorderRequest = 0; - cSetLastStickersUpdate(0); + Global::SetLastStickersUpdate(0); App::main()->updateStickers(); onClose(); return true; @@ -857,12 +857,12 @@ void StickersBox::closePressed() { MTP::cancel(i.key()); } _disenableRequests.clear(); - cSetLastStickersUpdate(0); + Global::SetLastStickersUpdate(0); App::main()->updateStickers(); } else if (_reorderRequest) { MTP::cancel(_reorderRequest); _reorderRequest = 0; - cSetLastStickersUpdate(0); + Global::SetLastStickersUpdate(0); App::main()->updateStickers(); } } @@ -914,11 +914,11 @@ void StickersBox::onSave() { bool writeRecent = false; RecentStickerPack &recent(cGetRecentStickers()); - StickerSets &sets(cRefStickerSets()); + Stickers::Sets &sets(Global::RefStickerSets()); QVector reorder = _inner.getOrder(), disabled = _inner.getDisabledSets(); for (int32 i = 0, l = disabled.size(); i < l; ++i) { - StickerSets::iterator it = sets.find(disabled.at(i)); + auto it = sets.find(disabled.at(i)); if (it != sets.cend()) { for (RecentStickerPack::iterator i = recent.begin(); i != recent.cend();) { if (it->stickers.indexOf(i->first) >= 0) { @@ -928,35 +928,35 @@ void StickersBox::onSave() { ++i; } } - if (!(it->flags & MTPDstickerSet::flag_disabled)) { + if (!(it->flags & MTPDstickerSet::Flag::f_disabled)) { MTPInputStickerSet setId = (it->id && it->access) ? MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access)) : MTP_inputStickerSetShortName(MTP_string(it->shortName)); - if (it->flags & MTPDstickerSet::flag_official) { + if (it->flags & MTPDstickerSet::Flag::f_official) { _disenableRequests.insert(MTP::send(MTPmessages_InstallStickerSet(setId, MTP_boolTrue()), rpcDone(&StickersBox::disenableDone), rpcFail(&StickersBox::disenableFail), 0, 5), NullType()); - it->flags |= MTPDstickerSet::flag_disabled; + it->flags |= MTPDstickerSet::Flag::f_disabled; } else { _disenableRequests.insert(MTP::send(MTPmessages_UninstallStickerSet(setId), rpcDone(&StickersBox::disenableDone), rpcFail(&StickersBox::disenableFail), 0, 5), NullType()); - int32 removeIndex = cStickerSetsOrder().indexOf(it->id); - if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); + int removeIndex = Global::StickerSetsOrder().indexOf(it->id); + if (removeIndex >= 0) Global::RefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } } } } - StickerSetsOrder &order(cRefStickerSetsOrder()); + Stickers::Order &order(Global::RefStickerSetsOrder()); order.clear(); - for (int32 i = 0, l = reorder.size(); i < l; ++i) { - StickerSets::iterator it = sets.find(reorder.at(i)); + for (int i = 0, l = reorder.size(); i < l; ++i) { + auto it = sets.find(reorder.at(i)); if (it != sets.cend()) { - if ((it->flags & MTPDstickerSet::flag_disabled) && !disabled.contains(it->id)) { + if ((it->flags & MTPDstickerSet::Flag::f_disabled) && !disabled.contains(it->id)) { MTPInputStickerSet setId = (it->id && it->access) ? MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access)) : MTP_inputStickerSetShortName(MTP_string(it->shortName)); _disenableRequests.insert(MTP::send(MTPmessages_InstallStickerSet(setId, MTP_boolFalse()), rpcDone(&StickersBox::disenableDone), rpcFail(&StickersBox::disenableFail), 0, 5), NullType()); - it->flags &= ~MTPDstickerSet::flag_disabled; + it->flags &= ~MTPDstickerSet::Flag::f_disabled; } order.push_back(reorder.at(i)); } } - for (StickerSets::iterator it = sets.begin(); it != sets.cend();) { - if (it->id == CustomStickerSetId || it->id == RecentStickerSetId || order.contains(it->id)) { + for (auto it = sets.begin(); it != sets.cend();) { + if (it->id == Stickers::CustomSetId || it->id == Stickers::RecentSetId || order.contains(it->id)) { ++it; } else { it = sets.erase(it); @@ -992,12 +992,12 @@ void StickersBox::showAll() { int32 stickerPacksCount(bool includeDisabledOfficial) { int32 result = 0; - const StickerSetsOrder &order(cStickerSetsOrder()); - const StickerSets &sets(cStickerSets()); - for (int32 i = 0, l = order.size(); i < l; ++i) { - StickerSets::const_iterator it = sets.constFind(order.at(i)); + const Stickers::Order &order(Global::StickerSetsOrder()); + const Stickers::Sets &sets(Global::StickerSets()); + for (int i = 0, l = order.size(); i < l; ++i) { + auto it = sets.constFind(order.at(i)); if (it != sets.cend()) { - if (!(it->flags & MTPDstickerSet::flag_disabled) || ((it->flags & MTPDstickerSet::flag_official) && includeDisabledOfficial)) { + if (!(it->flags & MTPDstickerSet::Flag::f_disabled) || ((it->flags & MTPDstickerSet::Flag::f_official) && includeDisabledOfficial)) { ++result; } } diff --git a/Telegram/SourceFiles/boxes/stickersetbox.h b/Telegram/SourceFiles/boxes/stickersetbox.h index 356fd4b60..fc2c9a513 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.h +++ b/Telegram/SourceFiles/boxes/stickersetbox.h @@ -70,7 +70,8 @@ private: bool _loaded; uint64 _setId, _setAccess; QString _title, _setTitle, _setShortName; - int32 _setCount, _setHash, _setFlags; + int32 _setCount, _setHash; + MTPDstickerSet::Flags _setFlags; int32 _bottom; MTPInputStickerSet _input; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 0b7aa9d19..15c6d61b4 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -2052,8 +2052,11 @@ bool DialogsWidget::onSearchMessages(bool searchCache) { MTP::cancel(_searchRequest); } if (_searchInPeer) { - int32 flags = (_searchInPeer->isChannel() && !_searchInPeer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _searchInPeer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, DialogsSearchPeerFromStart), rpcFail(&DialogsWidget::searchFailed, DialogsSearchPeerFromStart)); + MTPmessages_Search::Flags flags = 0; + if (_searchInPeer->isChannel() && !_searchInPeer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _searchInPeer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, DialogsSearchPeerFromStart), rpcFail(&DialogsWidget::searchFailed, DialogsSearchPeerFromStart)); } else { _searchRequest = MTP::send(MTPmessages_SearchGlobal(MTP_string(_searchQuery), MTP_int(0), MTP_inputPeerEmpty(), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, DialogsSearchFromStart), rpcFail(&DialogsWidget::searchFailed, DialogsSearchFromStart)); } @@ -2113,8 +2116,11 @@ void DialogsWidget::onSearchMore() { PeerData *offsetPeer = _inner.lastSearchPeer(); MsgId offsetId = _inner.lastSearchId(); if (_searchInPeer) { - int32 flags = (_searchInPeer->isChannel() && !_searchInPeer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _searchInPeer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(offsetId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, offsetId ? DialogsSearchPeerFromOffset : DialogsSearchPeerFromStart), rpcFail(&DialogsWidget::searchFailed, offsetId ? DialogsSearchPeerFromOffset : DialogsSearchPeerFromStart)); + MTPmessages_Search::Flags flags = 0; + if (_searchInPeer->isChannel() && !_searchInPeer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _searchInPeer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(offsetId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, offsetId ? DialogsSearchPeerFromOffset : DialogsSearchPeerFromStart), rpcFail(&DialogsWidget::searchFailed, offsetId ? DialogsSearchPeerFromOffset : DialogsSearchPeerFromStart)); } else { _searchRequest = MTP::send(MTPmessages_SearchGlobal(MTP_string(_searchQuery), MTP_int(offsetDate), offsetPeer ? offsetPeer->input : MTP_inputPeerEmpty(), MTP_int(offsetId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, offsetId ? DialogsSearchFromOffset : DialogsSearchFromStart), rpcFail(&DialogsWidget::searchFailed, offsetId ? DialogsSearchFromOffset : DialogsSearchFromStart)); } @@ -2123,8 +2129,11 @@ void DialogsWidget::onSearchMore() { } } else if (_searchInMigrated && !_searchFullMigrated) { MsgId offsetMigratedId = _inner.lastSearchMigratedId(); - int32 flags = (_searchInMigrated->isChannel() && !_searchInMigrated->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _searchInMigrated->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(offsetMigratedId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, offsetMigratedId ? DialogsSearchMigratedFromOffset : DialogsSearchMigratedFromStart), rpcFail(&DialogsWidget::searchFailed, offsetMigratedId ? DialogsSearchMigratedFromOffset : DialogsSearchMigratedFromStart)); + MTPmessages_Search::Flags flags = 0; + if (_searchInMigrated->isChannel() && !_searchInMigrated->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _searchInMigrated->input, MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(offsetMigratedId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, offsetMigratedId ? DialogsSearchMigratedFromOffset : DialogsSearchMigratedFromStart), rpcFail(&DialogsWidget::searchFailed, offsetMigratedId ? DialogsSearchMigratedFromOffset : DialogsSearchMigratedFromStart)); } } } diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 02b8e4f5e..a2fe08399 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1097,7 +1097,7 @@ void EmojiPanInner::fillPanels(QVector &panels) { int y = 0; panels.reserve(emojiTabCount); for (int c = 0; c < emojiTabCount; ++c) { - panels.push_back(new EmojiPanel(parentWidget(), lang(LangKey(lng_emoji_category0 + c)), NoneStickerSetId, true, y)); + panels.push_back(new EmojiPanel(parentWidget(), lang(LangKey(lng_emoji_category0 + c)), Stickers::NoneSetId, true, y)); connect(panels.back(), SIGNAL(mousePressed()), this, SLOT(checkPickerHide())); int cnt = _counts[c], rows = (cnt / EmojiPanPerRow) + ((cnt % EmojiPanPerRow) ? 1 : 0); panels.back()->show(); @@ -1352,7 +1352,7 @@ void StickerPanInner::paintStickers(Painter &p, const QRect &r) { tilly = y + st::emojiPanHeader + (rows * st::stickerPanSize.height()); if (r.top() >= tilly) continue; - bool special = (_sets[c].flags & MTPDstickerSet::flag_official); + bool special = (_sets[c].flags & MTPDstickerSet::Flag::f_official); y += st::emojiPanHeader; int32 fromrow = floorclamp(r.y() - y, st::stickerPanSize.height(), 0, rows); @@ -1395,7 +1395,7 @@ void StickerPanInner::paintStickers(Painter &p, const QRect &r) { p.drawPixmapLeft(ppos, width(), sticker->sticker()->img->pix(w, h)); } - if (hover > 0 && _sets[c].id == RecentStickerSetId && _custom.at(index)) { + if (hover > 0 && _sets[c].id == Stickers::RecentSetId && _custom.at(index)) { float64 xHover = _sets[c].hovers[_sets[c].pack.size() + index]; QPoint xPos = pos + QPoint(st::stickerPanSize.width() - st::stickerPanDelete.pxWidth(), 0); @@ -1509,7 +1509,7 @@ void StickerPanInner::mouseReleaseEvent(QMouseEvent *e) { } int tab = (_selected / MatrixRowShift), sel = _selected % MatrixRowShift; - if (_sets[tab].id == RecentStickerSetId && sel >= _sets[tab].pack.size() && sel < _sets[tab].pack.size() * 2 && _custom.at(sel - _sets[tab].pack.size())) { + if (_sets[tab].id == Stickers::RecentSetId && sel >= _sets[tab].pack.size() && sel < _sets[tab].pack.size() * 2 && _custom.at(sel - _sets[tab].pack.size())) { clearSelection(true); bool refresh = false; DocumentData *sticker = _sets[tab].pack.at(sel - _sets[tab].pack.size()); @@ -1522,8 +1522,8 @@ void StickerPanInner::mouseReleaseEvent(QMouseEvent *e) { break; } } - StickerSets &sets(cRefStickerSets()); - StickerSets::iterator it = sets.find(CustomStickerSetId); + Stickers::Sets &sets(Global::RefStickerSets()); + auto it = sets.find(Stickers::CustomSetId); if (it != sets.cend()) { for (int32 i = 0, l = it->stickers.size(); i < l; ++i) { if (it->stickers.at(i) == sticker) { @@ -1595,7 +1595,7 @@ void StickerPanInner::clearSelection(bool fast) { _animations.clear(); if (_selected >= 0) { int index = qAbs(_selected), tab = (index / MatrixRowShift), sel = index % MatrixRowShift; - if (index >= 0 && tab < _sets.size() && _sets[tab].id == RecentStickerSetId && sel >= tab * MatrixRowShift + _sets[tab].pack.size()) { + if (index >= 0 && tab < _sets.size() && _sets[tab].id == Stickers::RecentSetId && sel >= tab * MatrixRowShift + _sets[tab].pack.size()) { _sets[tab].hovers[sel] = 0; sel -= _sets[tab].pack.size(); } @@ -1603,7 +1603,7 @@ void StickerPanInner::clearSelection(bool fast) { } if (_pressedSel >= 0) { int index = qAbs(_pressedSel), tab = (index / MatrixRowShift), sel = index % MatrixRowShift; - if (index >= 0 && tab < _sets.size() && _sets[tab].id == RecentStickerSetId && sel >= tab * MatrixRowShift + _sets[tab].pack.size()) { + if (index >= 0 && tab < _sets.size() && _sets[tab].id == Stickers::RecentSetId && sel >= tab * MatrixRowShift + _sets[tab].pack.size()) { _sets[tab].hovers[sel] = 0; sel -= _sets[tab].pack.size(); } @@ -1640,11 +1640,11 @@ void StickerPanInner::hideFinish(bool completely) { void StickerPanInner::refreshStickers() { clearSelection(true); - const StickerSets &sets(cStickerSets()); + const Stickers::Sets &sets(Global::StickerSets()); _sets.clear(); _sets.reserve(sets.size() + 1); refreshRecentStickers(false); - for (StickerSetsOrder::const_iterator i = cStickerSetsOrder().cbegin(), e = cStickerSetsOrder().cend(); i != e; ++i) { + for (auto i = Global::StickerSetsOrder().cbegin(), e = Global::StickerSetsOrder().cend(); i != e; ++i) { appendSet(*i); } @@ -1703,7 +1703,7 @@ void StickerPanInner::refreshSavedGifs() { if (_showingInlineItems) { const SavedGifs &saved(cSavedGifs()); if (saved.isEmpty()) { - showStickerSet(RecentStickerSetId); + showStickerSet(Stickers::RecentSetId); return; } else { _inlineRows.reserve(saved.size()); @@ -1871,7 +1871,7 @@ void StickerPanInner::preloadImages() { } uint64 StickerPanInner::currentSet(int yOffset) const { - if (_showingInlineItems) return NoneStickerSetId; + if (_showingInlineItems) return Stickers::NoneSetId; int y, ytill = 0; for (int i = 0, l = _sets.size(); i < l; ++i) { @@ -1882,7 +1882,7 @@ uint64 StickerPanInner::currentSet(int yOffset) const { return _sets.at(i).id; } } - return _sets.isEmpty() ? RecentStickerSetId : _sets.back().id; + return _sets.isEmpty() ? Stickers::RecentSetId : _sets.back().id; } void StickerPanInner::hideInlineRowsPanel() { @@ -1894,7 +1894,7 @@ void StickerPanInner::hideInlineRowsPanel() { emit scrollToY(0); emit scrollUpdated(); } else { - showStickerSet(RecentStickerSetId); + showStickerSet(Stickers::RecentSetId); } } } @@ -2039,9 +2039,9 @@ bool StickerPanInner::ui_isInlineItemBeingChosen() { } void StickerPanInner::appendSet(uint64 setId) { - const StickerSets &sets(cStickerSets()); - StickerSets::const_iterator it = sets.constFind(setId); - if (it == sets.cend() || (it->flags & MTPDstickerSet::flag_disabled) || it->stickers.isEmpty()) return; + const Stickers::Sets &sets(Global::StickerSets()); + auto it = sets.constFind(setId); + if (it == sets.cend() || (it->flags & MTPDstickerSet::Flag::f_disabled) || it->stickers.isEmpty()) return; StickerPack pack; pack.reserve(it->stickers.size()); @@ -2064,14 +2064,14 @@ void StickerPanInner::refreshRecent() { void StickerPanInner::refreshRecentStickers(bool performResize) { _custom.clear(); clearSelection(true); - StickerSets::const_iterator customIt = cStickerSets().constFind(CustomStickerSetId); - if (cGetRecentStickers().isEmpty() && (customIt == cStickerSets().cend() || customIt->stickers.isEmpty())) { - if (!_sets.isEmpty() && _sets.at(0).id == RecentStickerSetId) { + auto customIt = Global::StickerSets().constFind(Stickers::CustomSetId); + if (cGetRecentStickers().isEmpty() && (customIt == Global::StickerSets().cend() || customIt->stickers.isEmpty())) { + if (!_sets.isEmpty() && _sets.at(0).id == Stickers::RecentSetId) { _sets.pop_front(); } } else { StickerPack recent; - int32 customCnt = (customIt == cStickerSets().cend() ? 0 : customIt->stickers.size()); + int32 customCnt = (customIt == Global::StickerSets().cend() ? 0 : customIt->stickers.size()); QMap recentOnly; recent.reserve(cGetRecentStickers().size() + customCnt); _custom.reserve(cGetRecentStickers().size() + customCnt); @@ -2090,8 +2090,8 @@ void StickerPanInner::refreshRecentStickers(bool performResize) { _custom.push_back(true); } } - if (_sets.isEmpty() || _sets.at(0).id != RecentStickerSetId) { - _sets.push_back(DisplayedSet(RecentStickerSetId, MTPDstickerSet::flag_official, lang(lng_emoji_category0), recent.size() * 2, recent)); + if (_sets.isEmpty() || _sets.at(0).id != Stickers::RecentSetId) { + _sets.push_back(DisplayedSet(Stickers::RecentSetId, MTPDstickerSet::Flag::f_official, lang(lng_emoji_category0), recent.size() * 2, recent)); } else { _sets[0].pack = recent; _sets[0].hovers.resize(recent.size() * 2); @@ -2112,12 +2112,12 @@ void StickerPanInner::refreshRecentStickers(bool performResize) { void StickerPanInner::fillIcons(QList &icons) { icons.clear(); icons.reserve(_sets.size() + 1); - if (!cSavedGifs().isEmpty()) icons.push_back(StickerIcon(NoneStickerSetId)); + if (!cSavedGifs().isEmpty()) icons.push_back(StickerIcon(Stickers::NoneSetId)); if (_sets.isEmpty()) return; int32 i = 0; - if (_sets.at(0).id == RecentStickerSetId) ++i; - if (i > 0) icons.push_back(StickerIcon(RecentStickerSetId)); + if (_sets.at(0).id == Stickers::RecentSetId) ++i; + if (i > 0) icons.push_back(StickerIcon(Stickers::RecentSetId)); for (int32 l = _sets.size(); i < l; ++i) { DocumentData *s = _sets.at(i).pack.at(0); int32 availw = st::rbEmoji.width - 2 * st::stickerIconPadding, availh = st::rbEmoji.height - 2 * st::stickerIconPadding; @@ -2143,7 +2143,7 @@ void StickerPanInner::fillPanels(QVector &panels) { panels.clear(); if (_showingInlineItems) { - panels.push_back(new EmojiPanel(parentWidget(), _showingSavedGifs ? lang(lng_saved_gifs) : _inlineBotTitle, NoneStickerSetId, true, 0)); + panels.push_back(new EmojiPanel(parentWidget(), _showingSavedGifs ? lang(lng_saved_gifs) : _inlineBotTitle, Stickers::NoneSetId, true, 0)); panels.back()->show(); return; } @@ -2153,7 +2153,7 @@ void StickerPanInner::fillPanels(QVector &panels) { int y = 0; panels.reserve(_sets.size()); for (int32 i = 0, l = _sets.size(); i < l; ++i) { - bool special = (_sets.at(i).flags & MTPDstickerSet::flag_official); + bool special = (_sets.at(i).flags & MTPDstickerSet::Flag::f_official); panels.push_back(new EmojiPanel(parentWidget(), _sets.at(i).title, _sets.at(i).id, special, y)); panels.back()->show(); connect(panels.back(), SIGNAL(deleteClicked(quint64)), this, SIGNAL(removing(quint64))); @@ -2260,7 +2260,7 @@ void StickerPanInner::updateSelected() { for (int c = 0, l = _sets.size(); c < l; ++c) { const DisplayedSet &set(_sets.at(c)); int cnt = set.pack.size(); - bool special = (set.flags & MTPDstickerSet::flag_official); + bool special = (set.flags & MTPDstickerSet::Flag::f_official); y = ytill; ytill = y + st::emojiPanHeader + ((cnt / StickerPanPerRow) + ((cnt % StickerPanPerRow) ? 1 : 0)) * st::stickerPanSize.height(); @@ -2271,7 +2271,7 @@ void StickerPanInner::updateSelected() { if (selIndex >= set.pack.size()) { selIndex = -1; } else { - if (set.id == RecentStickerSetId && _custom[selIndex]) { + if (set.id == Stickers::RecentSetId && _custom[selIndex]) { int32 inx = sx - (selIndex % StickerPanPerRow) * st::stickerPanSize.width(), iny = p.y() - y - ((selIndex / StickerPanPerRow) * st::stickerPanSize.height()); if (inx >= st::stickerPanSize.width() - st::stickerPanDelete.pxWidth() && iny < st::stickerPanDelete.pxHeight()) { selIndex += set.pack.size(); @@ -2286,11 +2286,11 @@ void StickerPanInner::updateSelected() { bool startanim = false; int oldSel = _selected, oldSelTab = oldSel / MatrixRowShift, xOldSel = -1, newSel = selIndex, newSelTab = newSel / MatrixRowShift, xNewSel = -1; - if (oldSel >= 0 && oldSelTab < _sets.size() && _sets[oldSelTab].id == RecentStickerSetId && oldSel >= oldSelTab * MatrixRowShift + _sets[oldSelTab].pack.size()) { + if (oldSel >= 0 && oldSelTab < _sets.size() && _sets[oldSelTab].id == Stickers::RecentSetId && oldSel >= oldSelTab * MatrixRowShift + _sets[oldSelTab].pack.size()) { xOldSel = oldSel; oldSel -= _sets[oldSelTab].pack.size(); } - if (newSel >= 0 && newSelTab < _sets.size() && _sets[newSelTab].id == RecentStickerSetId && newSel >= newSelTab * MatrixRowShift + _sets[newSelTab].pack.size()) { + if (newSel >= 0 && newSelTab < _sets.size() && _sets[newSelTab].id == Stickers::RecentSetId && newSel >= newSelTab * MatrixRowShift + _sets[newSelTab].pack.size()) { xNewSel = newSel; newSel -= _sets[newSelTab].pack.size(); } @@ -2390,7 +2390,7 @@ void StickerPanInner::step_selected(uint64 ms, bool timer) { void StickerPanInner::showStickerSet(uint64 setId) { clearSelection(true); - if (setId == NoneStickerSetId) { + if (setId == Stickers::NoneSetId) { bool wasNotShowingGifs = !_showingInlineItems; if (wasNotShowingGifs) { _showingInlineItems = true; @@ -2460,7 +2460,7 @@ EmojiPanel::EmojiPanel(QWidget *parent, const QString &text, uint64 setId, bool , _setId(setId) , _special(special) , _deleteVisible(false) -, _delete(special ? 0 : new IconedButton(this, st::notifyClose)) { // NoneStickerSetId if in emoji +, _delete(special ? 0 : new IconedButton(this, st::notifyClose)) { // Stickers::NoneSetId if in emoji resize(st::emojiPanWidth, st::emojiPanHeader); setMouseTracking(true); setFocusPolicy(Qt::NoFocus); @@ -2484,11 +2484,11 @@ void EmojiPanel::setText(const QString &text) { void EmojiPanel::updateText() { int32 availw = st::emojiPanWidth - st::emojiPanHeaderLeft * 2; if (_deleteVisible) { - if (!_special && _setId != NoneStickerSetId) { + if (!_special && _setId != Stickers::NoneSetId) { availw -= st::notifyClose.icon.pxWidth() + st::emojiPanHeaderLeft; } } else { - QString switchText = lang((_setId != NoneStickerSetId) ? lng_switch_emoji : (cSavedGifs().isEmpty() ? lng_switch_stickers : lng_switch_stickers_gifs)); + QString switchText = lang((_setId != Stickers::NoneSetId) ? lng_switch_emoji : (cSavedGifs().isEmpty() ? lng_switch_stickers : lng_switch_stickers_gifs)); availw -= st::emojiSwitchSkip + st::emojiPanHeaderFont->width(switchText); } _text = st::emojiPanHeaderFont->elided(_fullText, availw); @@ -2781,7 +2781,7 @@ void EmojiPan::paintEvent(QPaintEvent *e) { if (!_icons.isEmpty()) { int32 x = _iconsLeft, i = 0, selxrel = _iconsLeft + _iconSelX.current(), selx = selxrel - _iconsX.current(); for (int32 l = _icons.size(); i < l && !_icons.at(i).sticker; ++i) { - bool gifs = (_icons.at(i).setId == NoneStickerSetId); + bool gifs = (_icons.at(i).setId == Stickers::NoneSetId); if (selxrel != x) { p.drawSpriteLeft(x + st::rbEmojiRecent.imagePos.x(), _iconsTop + st::rbEmojiRecent.imagePos.y(), width(), gifs ? st::savedGifsOver : st::rbEmojiRecent.imageRect); } @@ -3512,9 +3512,9 @@ void EmojiPan::onSwitch() { Notify::clipStopperHidden(ClipStopperSavedGifsPanel); } else { if (cShowingSavedGifs() && cSavedGifs().isEmpty()) { - s_inner.showStickerSet(DefaultStickerSetId); - } else if (!cShowingSavedGifs() && !cSavedGifs().isEmpty() && cStickerSets().isEmpty()) { - s_inner.showStickerSet(NoneStickerSetId); + s_inner.showStickerSet(Stickers::DefaultSetId); + } else if (!cShowingSavedGifs() && !cSavedGifs().isEmpty() && Global::StickerSets().isEmpty()) { + s_inner.showStickerSet(Stickers::NoneSetId); } else { s_inner.updateShowingSavedGifs(); } @@ -3552,8 +3552,8 @@ void EmojiPan::onSwitch() { } void EmojiPan::onRemoveSet(quint64 setId) { - StickerSets::const_iterator it = cStickerSets().constFind(setId); - if (it != cStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) { + auto it = Global::StickerSets().constFind(setId); + if (it != Global::StickerSets().cend() && !(it->flags & MTPDstickerSet::Flag::f_official)) { _removingSetId = it->id; ConfirmBox *box = new ConfirmBox(lng_stickers_remove_pack(lt_sticker_pack, it->title), lang(lng_box_remove)); connect(box, SIGNAL(confirmed()), this, SLOT(onRemoveSetSure())); @@ -3564,8 +3564,8 @@ void EmojiPan::onRemoveSet(quint64 setId) { void EmojiPan::onRemoveSetSure() { Ui::hideLayer(); - StickerSets::iterator it = cRefStickerSets().find(_removingSetId); - if (it != cRefStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) { + auto it = Global::RefStickerSets().find(_removingSetId); + if (it != Global::RefStickerSets().cend() && !(it->flags & MTPDstickerSet::Flag::f_official)) { if (it->id && it->access) { MTP::send(MTPmessages_UninstallStickerSet(MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access)))); } else if (!it->shortName.isEmpty()) { @@ -3581,9 +3581,9 @@ void EmojiPan::onRemoveSetSure() { ++i; } } - cRefStickerSets().erase(it); - int32 removeIndex = cStickerSetsOrder().indexOf(_removingSetId); - if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); + Global::RefStickerSets().erase(it); + int removeIndex = Global::StickerSetsOrder().indexOf(_removingSetId); + if (removeIndex >= 0) Global::RefStickerSetsOrder().removeAt(removeIndex); refreshStickers(); Local::writeStickers(); if (writeRecent) Local::writeUserSettings(); @@ -4371,15 +4371,15 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { StickerPack srows; if (_emoji) { QMap setsToRequest; - StickerSets &sets(cRefStickerSets()); - const StickerSetsOrder &order(cStickerSetsOrder()); - for (int32 i = 0, l = order.size(); i < l; ++i) { - StickerSets::iterator it = sets.find(order.at(i)); + Stickers::Sets &sets(Global::RefStickerSets()); + const Stickers::Order &order(Global::StickerSetsOrder()); + for (int i = 0, l = order.size(); i < l; ++i) { + auto it = sets.find(order.at(i)); if (it != sets.cend()) { if (it->emoji.isEmpty()) { setsToRequest.insert(it->id, it->access); - it->flags |= MTPDstickerSet_flag_NOT_LOADED; - } else if (!(it->flags & MTPDstickerSet::flag_disabled)) { + it->flags |= MTPDstickerSet_ClientFlag::f_not_loaded; + } else if (!(it->flags & MTPDstickerSet::Flag::f_disabled)) { StickersByEmojiMap::const_iterator i = it->emoji.constFind(emojiGetNoColor(_emoji)); if (i != it->emoji.cend()) { srows += *i; diff --git a/Telegram/SourceFiles/dropdown.h b/Telegram/SourceFiles/dropdown.h index bacf6149c..f4d18ae30 100644 --- a/Telegram/SourceFiles/dropdown.h +++ b/Telegram/SourceFiles/dropdown.h @@ -420,10 +420,10 @@ private: int32 _top; struct DisplayedSet { - DisplayedSet(uint64 id, int32 flags, const QString &title, int32 hoversSize, const StickerPack &pack = StickerPack()) : id(id), flags(flags), title(title), hovers(hoversSize, 0), pack(pack) { + DisplayedSet(uint64 id, MTPDstickerSet::Flags flags, const QString &title, int32 hoversSize, const StickerPack &pack = StickerPack()) : id(id), flags(flags), title(title), hovers(hoversSize, 0), pack(pack) { } uint64 id; - int32 flags; + MTPDstickerSet::Flags flags; QString title; QVector hovers; StickerPack pack; @@ -482,7 +482,7 @@ class EmojiPanel : public TWidget { public: - EmojiPanel(QWidget *parent, const QString &text, uint64 setId, bool special, int32 wantedY); // NoneStickerSetId if in emoji + EmojiPanel(QWidget *parent, const QString &text, uint64 setId, bool special, int32 wantedY); // Stickers::NoneSetId if in emoji void setText(const QString &text); void setDeleteVisible(bool isVisible); diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index f928fe630..378d807f9 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -22,6 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "window.h" #include "mainwidget.h" +#include "application.h" #include "layerwidget.h" #include "lang.h" @@ -143,6 +144,12 @@ namespace Ui { return false; } + void autoplayMediaInlineAsync(const FullMsgId &msgId) { + if (MainWidget *m = App::main()) { + QMetaObject::invokeMethod(m, "ui_autoplayMediaInlineAsync", Qt::QueuedConnection, Q_ARG(qint32, msgId.channel), Q_ARG(qint32, msgId.msg)); + } + } + void showPeerHistory(const PeerId &peer, MsgId msgId, bool back) { if (MainWidget *m = App::main()) m->ui_showPeerHistory(peer, msgId, back); } @@ -197,10 +204,6 @@ namespace Notify { if (MainWidget *m = App::main()) m->notify_clipStopperHidden(type); } - void historyItemResized(const HistoryItem *item, bool scrollToIt) { - if (MainWidget *m = App::main()) m->notify_historyItemResized(item, scrollToIt); - } - void historyItemLayoutChanged(const HistoryItem *item) { if (MainWidget *m = App::main()) m->notify_historyItemLayoutChanged(item); } @@ -209,6 +212,16 @@ namespace Notify { if (MainWidget *m = App::main()) m->notify_automaticLoadSettingsChangedGif(); } + void handlePendingHistoryUpdate() { + if (MainWidget *m = App::main()) { + m->notify_handlePendingHistoryUpdate(); + } + for (auto i = Global::PendingRepaintItems().cbegin(), e = Global::PendingRepaintItems().cend(); i != e; ++i) { + Ui::repaintHistoryItem(i.key()); + } + Global::RefPendingRepaintItems().clear(); + } + } #define DefineReadOnlyVar(Namespace, Type, Name) const Type &Name() { \ @@ -362,6 +375,7 @@ namespace Global { struct Data { uint64 LaunchId = 0; + SingleDelayedCall HandleHistoryUpdate = { App::app(), "call_handleHistoryUpdate" }; Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; bool AdaptiveForWide = true; @@ -387,9 +401,14 @@ namespace Global { HiddenPinnedMessagesMap HiddenPinnedMessages; - PendingItemsMap PendingInitDimensionsItems; PendingItemsMap PendingRepaintItems; + Stickers::Sets StickerSets; + Stickers::Order StickerSetsOrder; + uint64 LastStickersUpdate = 0; + + MTP::DcOptions DcOptions; + CircleMasksMap CircleMasks; }; @@ -416,6 +435,7 @@ namespace Global { } DefineReadOnlyVar(Global, uint64, LaunchId); + DefineRefVar(Global, SingleDelayedCall, HandleHistoryUpdate); DefineVar(Global, Adaptive::Layout, AdaptiveLayout); DefineVar(Global, bool, AdaptiveForWide); @@ -441,9 +461,14 @@ namespace Global { DefineVar(Global, HiddenPinnedMessagesMap, HiddenPinnedMessages); - DefineRefVar(Global, PendingItemsMap, PendingInitDimensionsItems); DefineRefVar(Global, PendingItemsMap, PendingRepaintItems); + DefineVar(Global, Stickers::Sets, StickerSets); + DefineVar(Global, Stickers::Order, StickerSetsOrder); + DefineVar(Global, uint64, LastStickersUpdate); + + DefineVar(Global, MTP::DcOptions, DcOptions); + DefineRefVar(Global, CircleMasksMap, CircleMasks); }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 37139dfa3..09f71b91f 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -53,6 +53,7 @@ namespace Ui { void repaintHistoryItem(const HistoryItem *item); void repaintInlineItem(const LayoutInlineItem *layout); bool isInlineItemVisible(const LayoutInlineItem *reader); + void autoplayMediaInlineAsync(const FullMsgId &msgId); void showPeerHistory(const PeerId &peer, MsgId msgId, bool back = false); inline void showPeerHistory(const PeerData *peer, MsgId msgId, bool back = false) { @@ -90,14 +91,13 @@ namespace Notify { void clipStopperHidden(ClipStopperType type); - void historyItemResized(const HistoryItem *item, bool scrollToIt = false); - inline void historyItemsResized() { - historyItemResized(0); - } void historyItemLayoutChanged(const HistoryItem *item); void automaticLoadSettingsChangedGif(); + // handle pending resize() / paint() on history items + void handlePendingHistoryUpdate(); + }; #define DeclareReadOnlyVar(Type, Name) const Type &Name(); @@ -137,6 +137,24 @@ namespace DebugLogging { }; } +namespace Stickers { + static const uint64 DefaultSetId = 0; // for backward compatibility + static const uint64 CustomSetId = 0xFFFFFFFFFFFFFFFFULL, RecentSetId = 0xFFFFFFFFFFFFFFFEULL; + static const uint64 NoneSetId = 0xFFFFFFFFFFFFFFFDULL; // for emoji/stickers panel + struct Set { + Set(uint64 id, uint64 access, const QString &title, const QString &shortName, int32 count, int32 hash, MTPDstickerSet::Flags flags) : id(id), access(access), title(title), shortName(shortName), count(count), hash(hash), flags(flags) { + } + uint64 id, access; + QString title, shortName; + int32 count, hash; + MTPDstickerSet::Flags flags; + StickerPack stickers; + StickersByEmojiMap emoji; + }; + typedef QMap Sets; + typedef QList Order; +} + namespace Global { bool started(); @@ -144,6 +162,7 @@ namespace Global { void finish(); DeclareReadOnlyVar(uint64, LaunchId); + DeclareRefVar(SingleDelayedCall, HandleHistoryUpdate); DeclareVar(Adaptive::Layout, AdaptiveLayout); DeclareVar(bool, AdaptiveForWide); @@ -171,9 +190,14 @@ namespace Global { DeclareVar(HiddenPinnedMessagesMap, HiddenPinnedMessages); typedef OrderedSet PendingItemsMap; - DeclareRefVar(PendingItemsMap, PendingInitDimensionsItems); DeclareRefVar(PendingItemsMap, PendingRepaintItems); + DeclareVar(Stickers::Sets, StickerSets); + DeclareVar(Stickers::Order, StickerSetsOrder); + DeclareVar(uint64, LastStickersUpdate); + + DeclareVar(MTP::DcOptions, DcOptions); + typedef QMap CircleMasksMap; DeclareRefVar(CircleMasksMap, CircleMasks); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index df3f9790d..356719060 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -309,6 +309,11 @@ void History::clearLastKeyboard() { lastKeyboardFrom = 0; } +void History::setHasPendingResizedItems() { + _flags |= Flag::f_has_pending_resized_items; + Global::RefHandleHistoryUpdate().call(); +} + bool History::updateTyping(uint64 ms, bool force) { bool changed = force; for (TypingUsers::iterator i = typing.begin(), e = typing.end(); i != e;) { @@ -552,7 +557,7 @@ void ChannelHistory::getRangeDifferenceNext(int32 pts) { if (!App::main() || _rangeDifferenceToId < _rangeDifferenceFromId) return; int32 limit = _rangeDifferenceToId + 1 - _rangeDifferenceFromId; - _rangeDifferenceRequestId = MTP::send(MTPupdates_GetChannelDifference(peer->asChannel()->inputChannel, MTP_channelMessagesFilter(MTP_int(0), MTP_vector(1, MTP_messageRange(MTP_int(_rangeDifferenceFromId), MTP_int(_rangeDifferenceToId)))), MTP_int(pts), MTP_int(limit)), App::main()->rpcDone(&MainWidget::gotRangeDifference, peer->asChannel())); + _rangeDifferenceRequestId = MTP::send(MTPupdates_GetChannelDifference(peer->asChannel()->inputChannel, MTP_channelMessagesFilter(MTP_flags(MTPDchannelMessagesFilter::Flags(0)), MTP_vector(1, MTP_messageRange(MTP_int(_rangeDifferenceFromId), MTP_int(_rangeDifferenceToId)))), MTP_int(pts), MTP_int(limit)), App::main()->rpcDone(&MainWidget::gotRangeDifference, peer->asChannel())); } void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { @@ -598,7 +603,10 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { if (!inviter) return 0; if (peerToUser(inviter->id) == MTP::authedId()) unread = false; - int32 flags = (unread ? MTPDmessage::flag_unread : 0); + MTPDmessage::Flags flags = 0; + if (unread) { + flags |= MTPDmessage::Flag::f_unread; + } QDateTime inviteDate = peer->asChannel()->inviteDate; if (unread) _maxReadMessageDate = inviteDate; if (isEmpty()) { @@ -1254,10 +1262,6 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo } if (msg.type() == mtpc_message) { result->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0); - result->initDimensions(); - if (!block) { - Notify::historyItemResized(result); - } if (applyServiceAction) { App::checkSavedGif(result); } @@ -1453,7 +1457,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo } break; case mtpc_messageActionChatMigrateTo: { - peer->asChat()->flags |= MTPDchat::flag_deactivated; + peer->asChat()->flags |= MTPDchat::Flag::f_deactivated; //const MTPDmessageActionChatMigrateTo &d(action.c_messageActionChatMigrateTo()); //PeerData *channel = App::peerLoaded(peerFromChannel(d.vchannel_id)); @@ -1482,25 +1486,25 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo return result; } -HistoryItem *History::createItemForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) { +HistoryItem *History::createItemForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *msg) { return HistoryMessage::create(this, id, flags, date, from, msg); } -HistoryItem *History::createItemDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - if ((flags & MTPDmessage::flag_reply_to_msg_id) && replyTo > 0) { +HistoryItem *History::createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + if ((flags & MTPDmessage::Flag::f_reply_to_msg_id) && replyTo > 0) { return HistoryReply::create(this, id, flags, viaBotId, replyTo, date, from, doc, caption); } return HistoryMessage::create(this, id, flags, viaBotId, date, from, doc, caption); } -HistoryItem *History::createItemPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - if ((flags & MTPDmessage::flag_reply_to_msg_id) && replyTo > 0) { +HistoryItem *History::createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + if ((flags & MTPDmessage::Flag::f_reply_to_msg_id) && replyTo > 0) { return HistoryReply::create(this, id, flags, viaBotId, replyTo, date, from, photo, caption); } return HistoryMessage::create(this, id, flags, viaBotId, date, from, photo, caption); } -HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, int32 flags, HistoryMedia *media, bool newMsg) { +HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags, HistoryMedia *media, bool newMsg) { HistoryBlock *to = 0; bool newBlock = blocks.isEmpty(); if (newBlock) { @@ -1553,7 +1557,7 @@ HistoryItem *History::addToHistory(const MTPMessage &msg) { return createItem(nullptr, msg, false); } -HistoryItem *History::addNewForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *item) { +HistoryItem *History::addNewForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *item) { HistoryBlock *to = nullptr; bool newBlock = blocks.isEmpty(); if (newBlock) { @@ -1566,7 +1570,7 @@ HistoryItem *History::addNewForwarded(MsgId id, int32 flags, QDateTime date, int return addNewItem(to, newBlock, createItemForwarded(id, flags, date, from, item), true); } -HistoryItem *History::addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { +HistoryItem *History::addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { HistoryBlock *to = 0; bool newBlock = blocks.isEmpty(); if (newBlock) { @@ -1579,7 +1583,7 @@ HistoryItem *History::addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgI return addNewItem(to, newBlock, createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption), true); } -HistoryItem *History::addNewPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { +HistoryItem *History::addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { HistoryBlock *to = 0; bool newBlock = blocks.isEmpty(); if (newBlock) { @@ -1647,6 +1651,7 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a } adding->attachToBlock(to, to->items.size()); to->items.push_back(adding); + adding->previousItemChanged(); setLastMessage(adding); adding->y = to->height; @@ -1687,8 +1692,8 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a } } if (adding->hasReplyMarkup()) { - int32 markupFlags = App::replyMarkup(channelId(), adding->id).flags; - if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || adding->mentionsMe()) { + MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), adding->id).flags; + if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || adding->mentionsMe()) { OrderedSet *markupSenders = 0; if (peer->isChat()) { markupSenders = &peer->asChat()->markupSenders; @@ -1698,7 +1703,7 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a if (markupSenders) { markupSenders->insert(adding->from()); } - if (markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO) { // zero markup means replyKeyboardHide + if (markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero) { // zero markup means replyKeyboardHide if (lastKeyboardFrom == adding->from()->id || (!lastKeyboardInited && !peer->isChat() && !peer->isMegagroup() && !adding->out())) { clearLastKeyboard(); } @@ -1769,6 +1774,7 @@ void History::newItemAdded(HistoryItem *item) { HistoryItem *History::addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block) { item->attachToBlock(block, block->items.size()); block->items.push_back(item); + item->previousItemChanged(); if (width) { item->y = block->height; block->height += item->resize(width); @@ -1902,13 +1908,13 @@ void History::addOlderSlice(const QVector &slice, const QVectorauthor()->id) { if (markupSenders) { // chats with bots if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { - int32 markupFlags = App::replyMarkup(channelId(), item->id).flags; - if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || item->mentionsMe()) { + MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { bool wasKeyboardHide = markupSenders->contains(item->author()); if (!wasKeyboardHide) { markupSenders->insert(item->author()); } - if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO)) { + if (!(markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero)) { if (!lastKeyboardInited) { bool botNotInChat = false; if (peer->isChat()) { @@ -1929,9 +1935,9 @@ void History::addOlderSlice(const QVector &slice, const QVectorhasReplyMarkup() && !item->out()) { // conversations with bots - int32 markupFlags = App::replyMarkup(channelId(), item->id).flags; - if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || item->mentionsMe()) { - if (markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO) { + MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { + if (markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero) { clearLastKeyboard(); } else { lastKeyboardInited = true; @@ -2219,6 +2225,7 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, newItem->attachToBlock(block, itemIndex); block->items.insert(itemIndex, newItem); + newItem->previousItemChanged(); for (int i = itemIndex + 1, l = block->items.size(); i < l; ++i) { block->items.at(i)->setIndexInBlock(i); } @@ -2389,9 +2396,12 @@ MsgId History::msgIdForRead() const { return result; } -int32 History::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem) { - if (width != newWidth) resizedItem = 0; // recount all items - if (width != newWidth || resizedItem) { +int32 History::resize(int32 newWidth, int32 *ytransform) { + if (width != newWidth) _flags |= Flag::f_pending_resize; + bool force = (_flags | Flag::f_pending_resize); + _flags &= ~(Flag::f_pending_resize | Flag::f_has_pending_resized_items); + + if (force || hasPendingResizedItems()) { width = newWidth; int32 y = 0; for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { @@ -2401,7 +2411,7 @@ int32 History::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem * if (block->y != y) { block->y = y; } - y += block->geomResize(newWidth, ytransform, resizedItem); + y += block->resize(newWidth, ytransform, force); if (updTransform) { *ytransform += block->y; ytransform = 0; @@ -2645,13 +2655,13 @@ History::~History() { deleteAndMark(editDraft); } -int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem) { +int32 HistoryBlock::resize(int32 newWidth, int32 *ytransform, bool force) { int32 y = 0; for_const (HistoryItem *item , items) { bool updTransform = ytransform && (*ytransform >= item->y) && (*ytransform < item->y + item->height()); if (updTransform) *ytransform -= item->y; item->y = y; - if (!resizedItem || resizedItem == item) { + if (force || item->pendingResize()) { y += item->resize(newWidth); } else { y += item->height(); @@ -2783,27 +2793,52 @@ void HistoryMessageUnreadBar::init(int count) { _width = st::semiboldFont->width(_text); } +int HistoryMessageUnreadBar::height() const { + return st::unreadBarHeight; +} + +void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const { + p.fillRect(0, y + st::lineWidth, w, st::unreadBarHeight - 2 * st::lineWidth, st::unreadBarBG); + p.fillRect(0, y + st::unreadBarHeight - st::lineWidth, w, st::lineWidth, st::unreadBarBorder); + p.setFont(st::unreadBarFont); + p.setPen(st::unreadBarColor); + p.drawText((w - _width) / 2, y + (st::unreadBarHeight - st::lineWidth - st::unreadBarFont->height) / 2 + st::unreadBarFont->ascent, _text); +} + HistoryMessageDate::HistoryMessageDate(Interfaces*) : _width(0) { } void HistoryMessageDate::init(const QDateTime &date) { _text = langDayOfMonthFull(date.date()); - _width = st::semiboldFont->width(_text); + _width = st::msgServiceFont->width(_text); } -HistoryItem::HistoryItem(History *history, MsgId msgId, int32 flags, QDateTime msgDate, int32 from) : HistoryElem() +int HistoryMessageDate::height() const { + return st::msgServiceMargin.top() + st::msgServicePadding.top() + st::msgServiceFont->height + st::msgServicePadding.bottom() + st::msgServiceMargin.bottom(); +} + +void HistoryMessageDate::paint(Painter &p, int y, int w) const { + int left = (w - _width - st::msgServicePadding.left() - st::msgServicePadding.right()) / 2; + int height = st::msgServicePadding.top() + st::msgServiceFont->height + st::msgServicePadding.bottom(); + App::roundRect(p, left, y + st::msgServiceMargin.top(), _width + st::msgServicePadding.left() + st::msgServicePadding.left(), height, App::msgServiceBg(), ServiceCorners); + + p.setFont(st::msgServiceFont); + p.setPen(st::msgServiceColor); + p.drawText(left + st::msgServicePadding.left(), y + st::msgServiceMargin.top() + st::msgServicePadding.top() + st::msgServiceFont->ascent, _text); +} + +HistoryItem::HistoryItem(History *history, MsgId msgId, MTPDmessage::Flags flags, QDateTime msgDate, int32 from) : HistoryElem() , y(0) , id(msgId) , date(msgDate) , _from(from ? App::user(from) : history->peer) , _history(history) -, _flags(flags) +, _flags(flags | MTPDmessage_ClientFlag::f_pending_init_dimensions | MTPDmessage_ClientFlag::f_pending_resize) , _authorNameVersion(author()->nameVersion) { } void HistoryItem::finishCreate() { App::historyRegItem(this); - initDimensions(); } void HistoryItem::destroy() { @@ -2827,18 +2862,18 @@ void HistoryItem::destroy() { } void HistoryItem::detach() { - if (_history) { - if (_history->unreadBar == this) { - _history->unreadBar = 0; - } - if (_history->isChannel()) { - _history->asChannelHistory()->messageDetached(this); - } + if (_history->unreadBar == this) { + _history->unreadBar = 0; + } + if (_history->isChannel()) { + _history->asChannelHistory()->messageDetached(this); } if (_block) { _block->removeItem(this); detachFast(); App::historyItemDetached(this); + + _history->setPendingResize(); } else { if (_history->showFrom == this) { _history->showFrom = 0; @@ -2856,11 +2891,11 @@ void HistoryItem::previousItemChanged() { if (!Is()) { AddInterfaces(HistoryMessageDate::Bit()); Get()->init(date); - Global::RefPendingInitDimensionsItems().insert(this); + setPendingInitDimensions(); } } else if (Is()) { RemoveInterfaces(HistoryMessageDate::Bit()); - Global::RefPendingInitDimensionsItems().insert(this); + setPendingInitDimensions(); } } @@ -2904,7 +2939,7 @@ bool HistoryItem::canEdit(const QDateTime &cur) const { void HistoryItem::destroyUnreadBar() { if (Is()) { RemoveInterfaces(HistoryMessageUnreadBar::Bit()); - Global::RefPendingInitDimensionsItems().insert(this); + setPendingInitDimensions(); if (_history->unreadBar == this) { _history->unreadBar = nullptr; } @@ -2916,7 +2951,7 @@ void HistoryItem::setUnreadBarCount(int count) { HistoryMessageUnreadBar *bar; if (!Is()) { AddInterfaces(HistoryMessageUnreadBar::Bit()); - Global::RefPendingInitDimensionsItems().insert(this); + setPendingInitDimensions(); bar = Get(); } else { bar = Get(); @@ -2959,8 +2994,7 @@ void HistoryItem::clipCallback(ClipReaderNotification notification) { } } if (!stopped) { - initDimensions(); - Notify::historyItemResized(this); + setPendingInitDimensions(); Notify::historyItemLayoutChanged(this); } } break; @@ -4516,8 +4550,7 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo _data->automaticLoad(parent); bool loaded = _data->loaded(), displayLoading = (parent->id < 0) || _data->displayLoading(); if (loaded && !gif() && _gif != BadClipReader && cAutoPlayGif()) { - const_cast(this)->playInline(const_cast(parent)); - if (gif()) _gif->setAutoplay(); + Ui::autoplayMediaInlineAsync(parent->fullId()); } int32 skipx = 0, skipy = 0, width = _width, height = _height; @@ -4711,7 +4744,7 @@ ImagePtr HistoryGif::replyPreview() { return _data->makeReplyPreview(); } -bool HistoryGif::playInline(HistoryItem *parent) { +bool HistoryGif::playInline(HistoryItem *parent, bool autoplay) { if (gif()) { stopInline(parent); } else { @@ -4720,6 +4753,7 @@ bool HistoryGif::playInline(HistoryItem *parent) { } _gif = new ClipReader(_data->location(), _data->data(), func(parent, &HistoryItem::clipCallback)); App::regGifItem(_gif, parent); + if (gif()) _gif->setAutoplay(); } return true; } @@ -4731,8 +4765,7 @@ void HistoryGif::stopInline(HistoryItem *parent) { _gif = 0; } - parent->initDimensions(); - Notify::historyItemResized(parent); + parent->setPendingInitDimensions(); Notify::historyItemLayoutChanged(parent); } @@ -6062,7 +6095,7 @@ HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) : setText(text, msg.has_entities() ? entitiesFromMTP(msg.ventities.c_vector().v) : EntitiesInText()); } -HistoryMessage::HistoryMessage(History *history, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd) +HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *fwd) : HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) , _text(st::msgMinWidth) , _textWidth(0) @@ -6080,36 +6113,36 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, int32 flags, QDateTim setText(fwd->originalText(), fwd->originalEntities()); } -HistoryMessage::HistoryMessage(History *history, MsgId id, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) - : HistoryItem(history, id, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) + : HistoryItem(history, id, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); setText(msg, entities); } -HistoryMessage::HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : -HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } -HistoryMessage::HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : -HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(nullptr) { - createInterfaces((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); _media->attachToItem(this); @@ -6433,7 +6466,7 @@ void HistoryMessage::setText(const QString &text, const EntitiesInText &entities for (int32 i = 0, l = entities.size(); i != l; ++i) { if (entities.at(i).type == EntityInTextUrl || entities.at(i).type == EntityInTextCustomUrl || entities.at(i).type == EntityInTextEmail) { - _flags |= MTPDmessage_flag_HAS_TEXT_LINKS; + _flags |= MTPDmessage_ClientFlag::f_has_text_links; break; } } @@ -6528,7 +6561,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } } -void HistoryMessage::setViewsCount(int32 count, bool reinit) { +void HistoryMessage::setViewsCount(int32 count) { HistoryMessageViews *views = Get(); if (!views || views->_views == count || (count >= 0 && views->_views > count)) return; @@ -6544,10 +6577,7 @@ void HistoryMessage::setViewsCount(int32 count, bool reinit) { _textWidth = 0; _textHeight = 0; } - if (reinit) { - initDimensions(); - Notify::historyItemResized(this); - } + setPendingInitDimensions(); } } @@ -6562,8 +6592,7 @@ void HistoryMessage::setId(MsgId newId) { _textWidth = 0; _textHeight = 0; } - initDimensions(); - Notify::historyItemResized(this); + setPendingInitDimensions(); } } @@ -6572,6 +6601,24 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); + int left = 0, width = 0, height = _height; + countPositionAndSize(left, width); + if (width < 1) return; + + int dateh = 0, unreadbarh = 0; + if (auto *date = Get()) { + dateh = date->height(); + date->paint(p, 0, _history->width); + p.translate(0, dateh); + height -= dateh; + } + if (auto *unreadbar = Get()) { + unreadbarh = unreadbar->height(); + unreadbar->paint(p, 0, _history->width); + p.translate(0, unreadbarh); + height -= unreadbarh; + } + uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0; if (animms > 0 && animms <= ms) { animms = ms - animms; @@ -6581,19 +6628,15 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m float64 dt = (animms > st::activeFadeInDuration) ? (1 - (animms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (animms / float64(st::activeFadeInDuration)); float64 o = p.opacity(); p.setOpacity(o * dt); - p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b); + p.fillRect(0, 0, _history->width, height, textstyleCurrent()->selectOverlay->b); p.setOpacity(o); } } - int32 left = 0, width = 0; - countPositionAndSize(left, width); - if (displayFromPhoto()) { int32 photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - author()->paintUserpic(p, st::msgPhotoSize, photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize); + author()->paintUserpic(p, st::msgPhotoSize, photoleft, height - st::msgMargin.bottom() - st::msgPhotoSize); } - if (width < 1) return; if (bubble) { const HistoryMessageForwarded *fwd = Get(); @@ -6602,7 +6645,7 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m fromNameUpdated(width); } - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); style::color bg(selected ? (outbg ? st::msgOutBgSelected : st::msgInBgSelected) : (outbg ? st::msgOutBg : st::msgInBg)); style::color sh(selected ? (outbg ? st::msgOutShadowSelected : st::msgInShadowSelected) : (outbg ? st::msgOutShadow : st::msgInShadow)); @@ -6628,11 +6671,10 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m drawMessageText(p, trect, selection); if (_media && _media->isDisplayed()) { - p.save(); - int32 top = _height - st::msgMargin.bottom() - _media->height(); + int32 top = height - st::msgMargin.bottom() - _media->height(); p.translate(left, top); _media->draw(p, this, r.translated(-left, -top), selected, ms); - p.restore(); + p.translate(-left, -top); if (!_media->customInfoLayout()) { HistoryMessage::drawInfo(p, r.x() + r.width(), r.y() + r.height(), 2 * r.x() + r.width(), selected, InfoDisplayDefault); } @@ -6640,11 +6682,13 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m HistoryMessage::drawInfo(p, r.x() + r.width(), r.y() + r.height(), 2 * r.x() + r.width(), selected, InfoDisplayDefault); } } else { - p.save(); int32 top = st::msgMargin.top(); p.translate(left, top); _media->draw(p, this, r.translated(-left, -top), selected, ms); - p.restore(); + p.translate(-left, -top); + } + if (int skiph = dateh + unreadbarh) { + p.translate(0, -skiph); } textstyleRestore(); @@ -6689,7 +6733,7 @@ void HistoryMessage::destroy() { HistoryItem::destroy(); } -int32 HistoryMessage::resize(int32 width) { +int HistoryMessage::resizeImpl(int width) { if (width < st::msgMinWidth) return _height; width -= st::msgMargin.left() + st::msgMargin.right(); @@ -6757,16 +6801,33 @@ int32 HistoryMessage::resize(int32 width) { _height = _media->resize(width, this); } _height += st::msgMargin.top() + st::msgMargin.bottom(); + if (auto *date = Get()) { + _height += date->height(); + } + if (auto *unreadbar = Get()) { + _height += unreadbar->height(); + } return _height; } bool HistoryMessage::hasPoint(int32 x, int32 y) const { - int32 left = 0, width = 0; + int left = 0, width = 0, height = _height; countPositionAndSize(left, width); if (width < 1) return false; + if (auto *date = Get()) { + int dateh = date->height(); + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + if (drawBubble()) { - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); return r.contains(x, y); } else { return _media->hasPoint(x - left, y - st::msgMargin.top(), this); @@ -6794,12 +6855,23 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 lnk = TextLinkPtr(); state = HistoryDefaultCursorState; - int32 left = 0, width = 0; + int left = 0, width = 0, height = _height; countPositionAndSize(left, width); + if (auto *date = Get()) { + int dateh = date->height(); + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + if (displayFromPhoto()) { int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= _height - st::msgMargin.bottom() - st::msgPhotoSize && y < _height - st::msgMargin.bottom()) { + if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= height - st::msgMargin.bottom() - st::msgPhotoSize && y < height - st::msgMargin.bottom()) { lnk = author()->lnk; return; } @@ -6810,7 +6882,7 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 const HistoryMessageForwarded *fwd = Get(); const HistoryMessageVia *via = Get(); - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); if (displayFromName()) { // from user left name if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + st::msgNameFont->height) { if (x >= r.left() + st::msgPadding.left() && x < r.left() + r.width() - st::msgPadding.right() && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth()) { @@ -6897,14 +6969,25 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, after = false; upon = false; if (drawBubble()) { - int32 left = 0, width = 0; + int left = 0, width = 0, height = _height; countPositionAndSize(left, width); if (width < 1) return; + if (auto *date = Get()) { + int dateh = date->height(); + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + const HistoryMessageForwarded *fwd = Get(); const HistoryMessageVia *via = Get(); - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); if (displayFromName()) { // from user left name r.setTop(r.top() + st::msgNameFont->height); } else if (via && !fwd) { @@ -6963,7 +7046,7 @@ HistoryMessage::~HistoryMessage() { _media->detachFromItem(this); deleteAndMark(_media); } - if (_flags & MTPDmessage::flag_reply_markup) { + if (_flags & MTPDmessage::Flag::f_reply_markup) { App::clearReplyMarkup(channelId(), id); } } @@ -6979,7 +7062,7 @@ HistoryReply::HistoryReply(History *history, const MTPDmessage &msg) : HistoryMe } } -HistoryReply::HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) +HistoryReply::HistoryReply(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : HistoryMessage(history, msgId, flags, viaBotId, date, from, doc, caption) , replyToMsgId(replyTo) , replyToMsg(0) @@ -6991,7 +7074,7 @@ HistoryReply::HistoryReply(History *history, MsgId msgId, int32 flags, int32 via } } -HistoryReply::HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) +HistoryReply::HistoryReply(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : HistoryMessage(history, msgId, flags, viaBotId, date, from, photo, caption) , replyToMsgId(replyTo) , replyToMsg(0) @@ -7053,8 +7136,7 @@ bool HistoryReply::updateReplyTo(bool force) { replyToMsgId = 0; } if (force) { - initDimensions(); - Notify::historyItemResized(this); + setPendingInitDimensions(); } return (replyToMsg || !replyToMsgId); } @@ -7178,8 +7260,8 @@ void HistoryReply::drawMessageText(Painter &p, QRect trect, uint32 selection) co HistoryMessage::drawMessageText(p, trect, selection); } -int32 HistoryReply::resize(int32 width) { - HistoryMessage::resize(width); +int32 HistoryReply::resizeImpl(int32 width) { + HistoryMessage::resizeImpl(width); if (drawBubble()) { if (emptyText() && !displayFromName() && !Is()) { @@ -7405,7 +7487,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } break; case mtpc_messageActionChatMigrateTo: { - _flags |= MTPDmessage_flag_IS_GROUP_MIGRATE; + _flags |= MTPDmessage_ClientFlag::f_is_group_migrate; const MTPDmessageActionChatMigrateTo &d(action.c_messageActionChatMigrateTo()); if (true/*PeerData *channel = App::peerLoaded(peerFromChannel(d.vchannel_id))*/) { text = lang(lng_action_group_migrate); @@ -7415,7 +7497,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } break; case mtpc_messageActionChannelMigrateFrom: { - _flags |= MTPDmessage_flag_IS_GROUP_MIGRATE; + _flags |= MTPDmessage_ClientFlag::f_is_group_migrate; const MTPDmessageActionChannelMigrateFrom &d(action.c_messageActionChannelMigrateFrom()); if (true/*PeerData *chat = App::peerLoaded(peerFromChannel(d.vchat_id))*/) { text = lang(lng_action_group_migrate); @@ -7478,8 +7560,7 @@ bool HistoryServiceMsg::updatePinned(bool force) { updatePinnedText(); } if (force) { - initDimensions(); - Notify::historyItemResized(this); + setPendingInitDimensions(); if (gotDependencyItem && App::wnd()) { App::wnd()->notifySettingGot(); } @@ -7560,7 +7641,7 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { } HistoryServiceMsg::HistoryServiceMsg(History *history, const MTPDmessageService &msg) : - HistoryItem(history, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) + HistoryItem(history, msg.vid.v, mtpCastFlags(msg.vflags.v), ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) , _text(st::msgMinWidth) , _media(0) { if (msg.has_reply_to_msg_id()) { @@ -7573,7 +7654,7 @@ HistoryServiceMsg::HistoryServiceMsg(History *history, const MTPDmessageService setMessageByAction(msg.vaction); } -HistoryServiceMsg::HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags, HistoryMedia *media, int32 from) : +HistoryServiceMsg::HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags, HistoryMedia *media, int32 from) : HistoryItem(history, msgId, flags, date, from) , _text(st::msgServiceFont, msg, _historySrvOptions, st::dlgMinWidth) , _media(media) { @@ -7656,15 +7737,15 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 App::roundRect(p, left, st::msgServiceMargin.top(), width, height, App::msgServiceBg(), (selection == FullSelection) ? ServiceSelectedCorners : ServiceCorners); p.setBrush(Qt::NoBrush); - p.setPen(st::msgServiceColor->p); - p.setFont(st::msgServiceFont->f); + p.setPen(st::msgServiceColor); + p.setFont(st::msgServiceFont); uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; uint16 selectedTo = (selection == FullSelection) ? 0 : selection & 0xFFFF; _text.draw(p, trect.x(), trect.y(), trect.width(), Qt::AlignCenter, 0, -1, selectedFrom, selectedTo); textstyleRestore(); } -int32 HistoryServiceMsg::resize(int32 width) { +int32 HistoryServiceMsg::resizeImpl(int32 width) { int32 maxwidth = _history->width; if (Adaptive::Wide()) { maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip)); @@ -7861,7 +7942,7 @@ void HistoryCollapse::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 state = HistoryDefaultCursorState; } -HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, int32 flags) : +HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, MTPDmessage::Flags flags) : HistoryServiceMsg(history, clientMsgId(), inviteDate, QString(), flags) { textstyleSet(&st::serviceTextStyle); if (peerToUser(inviter->id) == MTP::authedId()) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index d8697decb..379752697 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -242,16 +242,16 @@ public: virtual ~History(); HistoryItem *createItem(HistoryBlock *block, const MTPMessage &msg, bool applyServiceAction); - HistoryItem *createItemForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); - HistoryItem *createItemDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *createItemPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *createItemForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *msg); + HistoryItem *createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); - HistoryItem *addNewService(MsgId msgId, QDateTime date, const QString &text, int32 flags = 0, HistoryMedia *media = 0, bool newMsg = true); + HistoryItem *addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, bool newMsg = true); HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); HistoryItem *addToHistory(const MTPMessage &msg); - HistoryItem *addNewForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *item); - HistoryItem *addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *addNewPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *addNewForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *item); + HistoryItem *addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryItem *addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); void addOlderSlice(const QVector &slice, const QVector *collapsed); void addNewerSlice(const QVector &slice, const QVector *collapsed); @@ -309,7 +309,7 @@ public: MsgId maxMsgId() const; MsgId msgIdForRead() const; - int32 geomResize(int32 newWidth, int32 *ytransform = 0, const HistoryItem *resizedItem = 0); // return new size + int resize(int newWidth, int32 *ytransform = nullptr); // return new size void removeNotification(HistoryItem *item) { if (!notifies.isEmpty()) { @@ -336,6 +336,15 @@ public: if (!notifies.isEmpty() && notifies.back() == item) notifies.pop_back(); } + bool hasPendingResizedItems() const { + return _flags & Flag::f_has_pending_resized_items; + } + void setHasPendingResizedItems(); + void setPendingResize() { + _flags |= Flag::f_pending_resize; + setHasPendingResizedItems(); + } + void paintDialog(Painter &p, int32 w, bool sel) const; bool updateTyping(uint64 ms, bool force = false); void clearLastKeyboard(); @@ -433,6 +442,19 @@ protected: private: + enum Flag { + f_has_pending_resized_items = (1 << 0), + f_pending_resize = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + Q_DECL_CONSTEXPR friend inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) Q_DECL_NOTHROW { + return QFlags(f1) | f2; + } + Q_DECL_CONSTEXPR friend inline QFlags operator|(Flags::enum_type f1, QFlags f2) Q_DECL_NOTHROW { + return f2 | f1; + } + Flags _flags; + ChatListLinksMap _chatListLinks; uint64 _sortKeyInChatList; // like ((unixtime) << 32) | (incremented counter) @@ -822,7 +844,7 @@ public: } void removeItem(HistoryItem *item); - int32 geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem); // return new size + int resize(int newWidth, int *ytransform, bool force); // return new size int32 y, height; History *history; @@ -877,8 +899,8 @@ enum InfoDisplayType { InfoDisplayOverImage, }; -inline bool isImportantChannelMessage(MsgId id, int32 flags) { // client-side important msgs always has_views or has_from_id - return (flags & MTPDmessage::flag_out) || (flags & MTPDmessage::flag_mentioned) || (flags & MTPDmessage::flag_post); +inline bool isImportantChannelMessage(MsgId id, MTPDmessage::Flags flags) { // client-side important msgs always has_views or has_from_id + return (flags & MTPDmessage::Flag::f_out) || (flags & MTPDmessage::Flag::f_mentioned) || (flags & MTPDmessage::Flag::f_post); } enum HistoryItemType { @@ -942,6 +964,9 @@ struct HistoryMessageDate : public BasicInterface { HistoryMessageDate(Interfaces *); void init(const QDateTime &date); + int height() const; + void paint(Painter &p, int y, int w) const; + QString _text; int _width; }; @@ -952,6 +977,9 @@ struct HistoryMessageUnreadBar : public BasicInterface HistoryMessageUnreadBar(Interfaces *); void init(int count); + int height() const; + void paint(Painter &p, int y, int w) const; + QString _text; int _width; @@ -971,8 +999,16 @@ public: HistoryItem(const HistoryItem &) = delete; HistoryItem &operator=(const HistoryItem &) = delete; - virtual void initDimensions() = 0; - virtual int32 resize(int32 width) = 0; // return new height + int resize(int width) { + if (_flags & MTPDmessage_ClientFlag::f_pending_init_dimensions) { + _flags &= ~MTPDmessage_ClientFlag::f_pending_init_dimensions; + initDimensions(); + } + if (_flags & MTPDmessage_ClientFlag::f_pending_resize) { + _flags &= ~MTPDmessage_ClientFlag::f_pending_resize; + } + return resizeImpl(width); + } virtual void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const = 0; virtual void dependencyItemRemoved(HistoryItem *dependency) { @@ -1011,14 +1047,18 @@ public: } void attachToBlock(HistoryBlock *block, int index) { t_assert(_block == nullptr && _indexInBlock < 0); + _block = block; _indexInBlock = index; + if (pendingResize()) { + _history->setHasPendingResizedItems(); + } } void setIndexInBlock(int index) { _indexInBlock = index; } bool out() const { - return _flags & MTPDmessage::flag_out; + return _flags & MTPDmessage::Flag::f_out; } bool unread() const { if (out() && id > 0 && id < _history->outboxReadBefore) return false; @@ -1028,31 +1068,31 @@ public: } if (history()->peer->isSelf()) return false; // messages from myself are always read if (out() && history()->peer->migrateTo()) return false; // outgoing messages in converted chats are always read - return (_flags & MTPDmessage::flag_unread); + return (_flags & MTPDmessage::Flag::f_unread); } bool mentionsMe() const { - return _flags & MTPDmessage::flag_mentioned; + return _flags & MTPDmessage::Flag::f_mentioned; } bool isMediaUnread() const { - return (_flags & MTPDmessage::flag_media_unread) && (channelId() == NoChannel); + return (_flags & MTPDmessage::Flag::f_media_unread) && (channelId() == NoChannel); } void markMediaRead() { - _flags &= ~MTPDmessage::flag_media_unread; + _flags &= ~MTPDmessage::Flag::f_media_unread; } bool hasReplyMarkup() const { - return _flags & MTPDmessage::flag_reply_markup; + return _flags & MTPDmessage::Flag::f_reply_markup; } bool hasTextLinks() const { - return _flags & MTPDmessage_flag_HAS_TEXT_LINKS; + return _flags & MTPDmessage_ClientFlag::f_has_text_links; } bool isGroupMigrate() const { - return _flags & MTPDmessage_flag_IS_GROUP_MIGRATE; + return _flags & MTPDmessage_ClientFlag::f_is_group_migrate; } bool hasViews() const { - return _flags & MTPDmessage::flag_views; + return _flags & MTPDmessage::Flag::f_views; } bool isPost() const { - return _flags & MTPDmessage::flag_post; + return _flags & MTPDmessage::Flag::f_post; } bool isImportant() const { return _history->isChannel() && isImportantChannelMessage(id, _flags); @@ -1061,7 +1101,7 @@ public: return (id > 0) && (!history()->isChannel() || history()->isMegagroup() || isPost()); } bool isSilent() const { - return _flags & MTPDmessage::flag_silent; + return _flags & MTPDmessage::Flag::f_silent; } virtual int32 viewsCount() const { return hasViews() ? 1 : -1; @@ -1117,7 +1157,7 @@ public: virtual void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const { } - virtual void setViewsCount(int32 count, bool reinit = true) { + virtual void setViewsCount(int32 count) { } virtual void setId(MsgId newId); virtual void setDate(const QDateTime &date) { // for date items @@ -1131,7 +1171,7 @@ public: bool canDelete() const { ChannelData *channel = _history->peer->asChannel(); - if (!channel) return !(_flags & MTPDmessage_flag_IS_GROUP_MIGRATE); + if (!channel) return !(_flags & MTPDmessage_ClientFlag::f_is_group_migrate); if (id == 1) return false; if (channel->amCreator()) return true; @@ -1255,24 +1295,44 @@ public: // when the new messages arrive in this chat history void setUnreadBarFreezed(); + bool pendingResize() const { + return _flags & MTPDmessage_ClientFlag::f_pending_resize; + } + void setPendingResize() { + _flags |= MTPDmessage_ClientFlag::f_pending_resize; + if (!detached()) { + _history->setHasPendingResizedItems(); + } + } + bool pendingInitDimensions() const { + return _flags & MTPDmessage_ClientFlag::f_pending_init_dimensions; + } + void setPendingInitDimensions() { + _flags |= MTPDmessage_ClientFlag::f_pending_init_dimensions; + setPendingResize(); + } + void clipCallback(ClipReaderNotification notification); virtual ~HistoryItem(); protected: - HistoryItem(History *history, MsgId msgId, int32 flags, QDateTime msgDate, int32 from); + HistoryItem(History *history, MsgId msgId, MTPDmessage::Flags flags, QDateTime msgDate, int32 from); - // to completely create history item we need to - // call a virtual initDimensions() method, - // that can not be done from constructor - void finishCreate(); + // to completely create history item we need to call + // a virtual method, it can not be done from constructor + virtual void finishCreate(); + + // called from resize() when MTPDmessage_ClientFlag::f_pending_init_dimensions is set + virtual void initDimensions() = 0; + virtual int resizeImpl(int width) = 0; PeerData *_from; History *_history; HistoryBlock *_block = nullptr; int _indexInBlock = -1; - int32 _flags; + MTPDmessage::Flags _flags; mutable int32 _authorNameVersion; @@ -1301,7 +1361,7 @@ protected: // make all the constructors in HistoryItem children protected // and wrapped with a static create() call with the same args // so that history item can not be created directly, without -// a finishCreate() call, which calls a virtual method initDimensions() +// calling a virtual finishCreate() method template class HistoryItemInstantiated { public: @@ -1422,7 +1482,10 @@ public: return 0; } - virtual bool playInline(HistoryItem *item) { + bool playInline(HistoryItem *item/*, bool autoplay = false*/) { + return playInline(item, false); + } + virtual bool playInline(HistoryItem *item, bool autoplay) { return false; } virtual void stopInline(HistoryItem *item) { @@ -1851,8 +1914,8 @@ public: return gif(); } - bool playInline(HistoryItem *item); - void stopInline(HistoryItem *item); + bool playInline(HistoryItem *item, bool autoplay) override; + void stopInline(HistoryItem *item) override; void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; @@ -1894,10 +1957,10 @@ private: ClipReader *_gif; ClipReader *gif() { - return (_gif == BadClipReader) ? 0 : _gif; + return (_gif == BadClipReader) ? nullptr : _gif; } const ClipReader *gif() const { - return (_gif == BadClipReader) ? 0 : _gif; + return (_gif == BadClipReader) ? nullptr : _gif; } void setStatusSize(int32 newSize) const; @@ -2057,10 +2120,10 @@ public: ClipReader *getClipReader() { return _attach ? _attach->getClipReader() : 0; } - bool playInline(HistoryItem *item) { - return _attach ? _attach->playInline(item) : false; + bool playInline(HistoryItem *item, bool autoplay) override { + return _attach ? _attach->playInline(item, autoplay) : false; } - void stopInline(HistoryItem *item) { + void stopInline(HistoryItem *item) override { if (_attach) _attach->stopInline(item); } @@ -2209,23 +2272,22 @@ public: static HistoryMessage *create(History *history, const MTPDmessage &msg) { return _create(history, msg); } - static HistoryMessage *create(History *history, MsgId msgId, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd) { + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *fwd) { return _create(history, msgId, flags, date, from, fwd); } - static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) { + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) { return _create(history, msgId, flags, viaBotId, date, from, msg, entities); } - static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { return _create(history, msgId, flags, viaBotId, date, from, doc, caption); } - static HistoryMessage *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { return _create(history, msgId, flags, viaBotId, date, from, photo, caption); } void initTime(); void initMedia(const MTPMessageMedia *media, QString ¤tText); void initMediaFromDocument(DocumentData *doc, const QString &caption); - void initDimensions() override; void fromNameUpdated(int32 width) const; virtual UserData *viaBot() const { @@ -2255,7 +2317,7 @@ public: } void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const; - void setViewsCount(int32 count, bool reinit = true); + void setViewsCount(int32 count); void setId(MsgId newId); void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; @@ -2263,7 +2325,6 @@ public: void destroy(); - int32 resize(int32 width); bool hasPoint(int32 x, int32 y) const; bool pointInTime(int32 right, int32 bottom, int32 x, int32 y, InfoDisplayType type) const; @@ -2285,12 +2346,13 @@ public: QString notificationHeader() const; QString notificationText() const; - void updateMedia(const MTPMessageMedia *media, bool edited = false) { + void updateMedia(const MTPMessageMedia *media, bool edited = false) override { if (!edited && media && _media && _media->type() != MediaTypeWebPage) { _media->updateFrom(*media, this); } else { setMedia(media); } + setPendingInitDimensions(); } int32 addToOverview(AddToOverviewMethod method); void eraseFromOverview(); @@ -2348,12 +2410,15 @@ public: protected: HistoryMessage(History *history, const MTPDmessage &msg); - HistoryMessage(History *history, MsgId msgId, int32 flags, QDateTime date, int32 from, HistoryMessage *fwd); // local forwarded - HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message - HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document - HistoryMessage(History *history, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *fwd); // local forwarded + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo friend class HistoryItemInstantiated; + void initDimensions() override; + int resizeImpl(int width) override; + void createInterfaces(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); bool displayForwardedFrom() const { @@ -2380,15 +2445,13 @@ public: static HistoryReply *create(History *history, const MTPDmessage &msg) { return _create(history, msg); } - static HistoryReply *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + static HistoryReply *create(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { return _create(history, msgId, flags, viaBotId, replyTo, date, from, doc, caption); } - static HistoryReply *create(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + static HistoryReply *create(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { return _create(history, msgId, flags, viaBotId, replyTo, date, from, photo, caption); } - void initDimensions() override; - bool updateDependencyItem() override { return updateReplyTo(true); } @@ -2406,7 +2469,6 @@ public: void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; void drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selected, bool likeService = false) const; void drawMessageText(Painter &p, QRect trect, uint32 selection) const override; - int32 resize(int32 width) override; void resizeVia(int32 w) const; bool hasPoint(int32 x, int32 y) const override; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const override; @@ -2430,11 +2492,14 @@ public: protected: HistoryReply(History *history, const MTPDmessage &msg); - HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryReply(History *history, MsgId msgId, int32 flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryReply(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryReply(History *history, MsgId msgId, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); using HistoryItemInstantiated::_create; friend class HistoryItemInstantiated; + void initDimensions() override; + int resizeImpl(int width) override; + bool updateReplyTo(bool force = false); void replyToNameUpdated() const; @@ -2449,18 +2514,28 @@ protected: }; -inline int32 newMessageFlags(PeerData *p) { - return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage::flag_unread : 0) | MTPDmessage::flag_out); +inline MTPDmessage::Flags newMessageFlags(PeerData *p) { + MTPDmessage::Flags result = 0; + if (!p->isSelf()) { + result |= MTPDmessage::Flag::f_out; + if (p->isChat() || (p->isUser() && !p->asUser()->botInfo)) { + result |= MTPDmessage::Flag::f_unread; + } + } + return result; } -inline int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { - int32 result = newMessageFlags(p) | (from ? MTPDmessage::flag_from_id : 0); +inline MTPDmessage::Flags newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { + MTPDmessage::Flags result = newMessageFlags(p); + if (from) { + result |= MTPDmessage::Flag::f_from_id; + } if (fwd->Is()) { - result |= MTPDmessage::flag_via_bot_id; + result |= MTPDmessage::Flag::f_via_bot_id; } if (!p->isChannel()) { if (HistoryMedia *media = fwd->getMedia()) { if (media->type() == MediaTypeVoiceFile) { - result |= MTPDmessage::flag_media_unread; + result |= MTPDmessage::Flag::f_media_unread; // } else if (media->type() == MediaTypeVideo) { // result |= MTPDmessage::flag_media_unread; } @@ -2483,12 +2558,10 @@ public: static HistoryServiceMsg *create(History *history, const MTPDmessageService &msg) { return _create(history, msg); } - static HistoryServiceMsg *create(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags = 0, HistoryMedia *media = 0, int32 from = 0) { + static HistoryServiceMsg *create(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0) { return _create(history, msgId, date, msg, flags, media, from); } - void initDimensions() override; - bool updateDependencyItem() override { return updatePinned(true); } @@ -2508,7 +2581,6 @@ public: void countPositionAndSize(int32 &left, int32 &width) const; void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; - int32 resize(int32 width) override; bool hasPoint(int32 x, int32 y) const override; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const override; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const override; @@ -2545,9 +2617,12 @@ public: protected: HistoryServiceMsg(History *history, const MTPDmessageService &msg); - HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, int32 flags = 0, HistoryMedia *media = 0, int32 from = 0); + HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0); friend class HistoryItemInstantiated; + void initDimensions() override; + int resizeImpl(int width) override; + void setMessageByAction(const MTPmessageAction &action); bool updatePinned(bool force = false); bool updatePinnedText(const QString *pfrom = nullptr, QString *ptext = nullptr); @@ -2652,7 +2727,7 @@ private: class HistoryJoined : public HistoryServiceMsg, private HistoryItemInstantiated { public: - static HistoryJoined *create(History *history, const QDateTime &date, UserData *from, int32 flags) { + static HistoryJoined *create(History *history, const QDateTime &date, UserData *from, MTPDmessage::Flags flags) { return _create(history, date, from, flags); } @@ -2662,7 +2737,7 @@ public: protected: - HistoryJoined(History *history, const QDateTime &date, UserData *from, int32 flags); + HistoryJoined(History *history, const QDateTime &date, UserData *from, MTPDmessage::Flags flags); using HistoryItemInstantiated::_create; friend class HistoryItemInstantiated; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index dfede8936..0ebf050ae 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1211,7 +1211,7 @@ void HistoryInner::keyPressEvent(QKeyEvent *e) { } } -int32 HistoryInner::recountHeight(const HistoryItem *resizedItem) { +int32 HistoryInner::recountHeight() { int32 htop = historyTop(), mtop = migratedTop(); int32 st1 = (htop >= 0) ? (_history->lastScrollTop - htop) : -1, st2 = (_migrated && mtop >= 0) ? (_history->lastScrollTop - mtop) : -1; @@ -1222,18 +1222,11 @@ int32 HistoryInner::recountHeight(const HistoryItem *resizedItem) { } if (wasYSkip < minadd) wasYSkip = minadd; - if (resizedItem) { - if (resizedItem->history() == _history) { - _history->geomResize(_scroll->width(), &st1, resizedItem); - } else if (_migrated && resizedItem->history() == _migrated) { - _migrated->geomResize(_scroll->width(), &st2, resizedItem); - } - } else { - _history->geomResize(_scroll->width(), &st1, resizedItem); - if (_migrated) { - _migrated->geomResize(_scroll->width(), &st2, resizedItem); - } + _history->resize(_scroll->width(), &st1); + if (_migrated) { + _migrated->resize(_scroll->width(), &st2); } + int32 skip = 0; if (_migrated) { // check first messages of _history - maybe no need to display them if (!_migrated->isEmpty() && !_history->isEmpty() && _migrated->loadedAtBottom() && _history->loadedAtTop()) { @@ -2147,9 +2140,9 @@ bool BotKeyboard::updateMarkup(HistoryItem *to) { clearSelection(); _btns.clear(); const ReplyMarkup &markup(App::replyMarkup(to->channelId(), to->id)); - _forceReply = markup.flags & MTPDreplyKeyboardMarkup_flag_FORCE_REPLY; - _maximizeSize = !(markup.flags & MTPDreplyKeyboardMarkup::flag_resize); - _singleUse = _forceReply || (markup.flags & MTPDreplyKeyboardMarkup::flag_single_use); + _forceReply = markup.flags & MTPDreplyKeyboardMarkup_ClientFlag::f_force_reply; + _maximizeSize = !(markup.flags & MTPDreplyKeyboardMarkup::Flag::f_resize); + _singleUse = _forceReply || (markup.flags & MTPDreplyKeyboardMarkup::Flag::f_single_use); const ReplyMarkup::Commands &commands(markup.commands); if (!commands.isEmpty()) { @@ -3182,7 +3175,7 @@ void HistoryWidget::onRecordUpdate(quint16 level, qint32 samples) { } void HistoryWidget::updateStickers() { - if (!cLastStickersUpdate() || getms(true) >= cLastStickersUpdate() + StickersUpdateTimeout) { + if (!Global::LastStickersUpdate() || getms(true) >= Global::LastStickersUpdate() + StickersUpdateTimeout) { if (!_stickersUpdateRequest) { _stickersUpdateRequest = MTP::send(MTPmessages_GetAllStickers(MTP_int(Local::countStickersHash(true))), rpcDone(&HistoryWidget::stickersGot), rpcFail(&HistoryWidget::stickersFailed)); } @@ -3240,10 +3233,6 @@ void HistoryWidget::notify_clipStopperHidden(ClipStopperType type) { if (_list) _list->update(); } -void HistoryWidget::notify_historyItemResized(const HistoryItem *row, bool scrollToIt) { - updateListSize(false, false, { ScrollChangeNone, 0 }, row, scrollToIt); -} - void HistoryWidget::cmd_search() { if (!inFocusChain() || !_peer) return; @@ -3265,7 +3254,7 @@ void HistoryWidget::cmd_previous_chat() { } void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { - cSetLastStickersUpdate(getms(true)); + Global::SetLastStickersUpdate(getms(true)); _stickersUpdateRequest = 0; if (stickers.type() != mtpc_messages_allStickers) return; @@ -3273,21 +3262,21 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { const QVector &d_sets(d.vsets.c_vector().v); - StickerSetsOrder &setsOrder(cRefStickerSetsOrder()); + Stickers::Order &setsOrder(Global::RefStickerSetsOrder()); setsOrder.clear(); - StickerSets &sets(cRefStickerSets()); + Stickers::Sets &sets(Global::RefStickerSets()); QMap setsToRequest; - for (StickerSets::iterator i = sets.begin(), e = sets.end(); i != e; ++i) { + for (auto i = sets.begin(), e = sets.end(); i != e; ++i) { i->access = 0; // mark for removing } - for (int32 i = 0, l = d_sets.size(); i != l; ++i) { + for (int i = 0, l = d_sets.size(); i != l; ++i) { if (d_sets.at(i).type() == mtpc_stickerSet) { const MTPDstickerSet &set(d_sets.at(i).c_stickerSet()); - StickerSets::iterator it = sets.find(set.vid.v); + auto it = sets.find(set.vid.v); QString title = stickerSetTitle(set); if (it == sets.cend()) { - it = sets.insert(set.vid.v, StickerSet(set.vid.v, set.vaccess_hash.v, title, qs(set.vshort_name), set.vcount.v, set.vhash.v, set.vflags.v | MTPDstickerSet_flag_NOT_LOADED)); + it = sets.insert(set.vid.v, Stickers::Set(set.vid.v, set.vaccess_hash.v, title, qs(set.vshort_name), set.vcount.v, set.vhash.v, set.vflags.v | MTPDstickerSet_ClientFlag::f_not_loaded)); } else { it->access = set.vaccess_hash.v; it->title = title; @@ -3296,12 +3285,12 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { if (it->count != set.vcount.v || it->hash != set.vhash.v || it->emoji.isEmpty()) { it->count = set.vcount.v; it->hash = set.vhash.v; - it->flags |= MTPDstickerSet_flag_NOT_LOADED; // need to request this set + it->flags |= MTPDstickerSet_ClientFlag::f_not_loaded; // need to request this set } } - if (!(it->flags & MTPDstickerSet::flag_disabled) || (it->flags & MTPDstickerSet::flag_official)) { + if (!(it->flags & MTPDstickerSet::Flag::f_disabled) || (it->flags & MTPDstickerSet::Flag::f_official)) { setsOrder.push_back(set.vid.v); - if (it->stickers.isEmpty() || (it->flags & MTPDstickerSet_flag_NOT_LOADED)) { + if (it->stickers.isEmpty() || (it->flags & MTPDstickerSet_ClientFlag::f_not_loaded)) { setsToRequest.insert(set.vid.v, set.vaccess_hash.v); } } @@ -3309,8 +3298,8 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { } bool writeRecent = false; RecentStickerPack &recent(cGetRecentStickers()); - for (StickerSets::iterator it = sets.begin(), e = sets.end(); it != e;) { - if (it->id == CustomStickerSetId || it->access != 0) { + for (Stickers::Sets::iterator it = sets.begin(), e = sets.end(); it != e;) { + if (it->id == Stickers::CustomSetId || it->access != 0) { ++it; } else { for (RecentStickerPack::iterator i = recent.begin(); i != recent.cend();) { @@ -3347,7 +3336,7 @@ bool HistoryWidget::stickersFailed(const RPCError &error) { LOG(("App Fail: Failed to get stickers!")); - cSetLastStickersUpdate(getms(true)); + Global::SetLastStickersUpdate(getms(true)); _stickersUpdateRequest = 0; return true; } @@ -3770,7 +3759,7 @@ void HistoryWidget::updateNotifySettings() { _muteUnmute.setText(lang(_history->mute ? lng_channel_unmute : lng_channel_mute)); if (_peer->notify != UnknownNotifySettings) { - _silent.setChecked(_peer->notify != EmptyNotifySettings && (_peer->notify->flags & MTPDpeerNotifySettings::flag_silent)); + _silent.setChecked(_peer->notify != EmptyNotifySettings && (_peer->notify->flags & MTPDpeerNotifySettings::Flag::f_silent)); if (_silent.isHidden() && hasSilentToggle()) { updateControlsVisibility(); } @@ -4610,15 +4599,15 @@ void HistoryWidget::saveEditMsg() { return; } - int32 sendFlags = 0; + MTPchannels_EditMessage::Flags sendFlags = 0; if (webPageId == CancelledWebPageId) { - sendFlags |= MTPmessages_SendMessage::flag_no_webpage; + sendFlags |= MTPchannels_EditMessage::Flag::f_no_webpage; } MTPVector localEntities = linksToMTP(sendingEntities), sentEntities = linksToMTP(sendingEntities, true); if (!sentEntities.c_vector().v.isEmpty()) { - sendFlags |= MTPmessages_SendMessage::flag_entities; + sendFlags |= MTPchannels_EditMessage::Flag::f_entities; } - _saveEditMsgRequestId = MTP::send(MTPchannels_EditMessage(MTP_int(sendFlags), _history->peer->asChannel()->inputChannel, MTP_int(_editMsgId), MTP_string(sendingText), sentEntities), rpcDone(&HistoryWidget::saveEditMsgDone, _history), rpcFail(&HistoryWidget::saveEditMsgFail, _history)); + _saveEditMsgRequestId = MTP::send(MTPchannels_EditMessage(MTP_flags(sendFlags), _history->peer->asChannel()->inputChannel, MTP_int(_editMsgId), MTP_string(sendingText), sentEntities), rpcDone(&HistoryWidget::saveEditMsgDone, _history), rpcFail(&HistoryWidget::saveEditMsgFail, _history)); } void HistoryWidget::saveEditMsgDone(History *history, const MTPUpdates &updates, mtpRequestId req) { @@ -4798,32 +4787,32 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const fastShowAtEnd(h); PeerData *p = App::peer(peer); - int32 flags = newMessageFlags(p) | MTPDmessage::flag_media; // unread, out + MTPDmessage::Flags flags = newMessageFlags(p) | MTPDmessage::Flag::f_media; // unread, out bool lastKeyboardUsed = lastForceReplyReplied(FullMsgId(peerToChannel(peer), replyTo)); - int32 sendFlags = 0; + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { - flags |= MTPDmessage::flag_reply_to_msg_id; - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + flags |= MTPDmessage::Flag::f_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = p->isChannel() && !p->isMegagroup() && p->asChannel()->canPublish() && (p->asChannel()->isBroadcast() || _broadcast.checked()); bool showFromName = !channelPost || p->asChannel()->addsSignature(); bool silentPost = channelPost && _silent.checked(); if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(peer), MTPnullFwdHeader, MTPint(), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname), MTP_int(userId)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); - h->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), p->input, MTP_int(replyTo), MTP_inputMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, h->sendRequestId); + h->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(peer), MTPnullFwdHeader, MTPint(), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname), MTP_int(userId)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + h->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), p->input, MTP_int(replyTo), MTP_inputMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, h->sendRequestId); App::historyRegRandom(randomId, newId); @@ -5822,30 +5811,30 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif fastShowAtEnd(h); - int32 flags = newMessageFlags(h->peer) | MTPDmessage::flag_media; // unread, out - if (file->to.replyTo) flags |= MTPDmessage::flag_reply_to_msg_id; + MTPDmessage::Flags flags = newMessageFlags(h->peer) | MTPDmessage::Flag::f_media; // unread, out + if (file->to.replyTo) flags |= MTPDmessage::Flag::f_reply_to_msg_id; bool channelPost = h->peer->isChannel() && !h->peer->isMegagroup() && h->peer->asChannel()->canPublish() && (h->peer->asChannel()->isBroadcast() || file->to.broadcast); bool showFromName = !channelPost || h->peer->asChannel()->addsSignature(); bool silentPost = channelPost && file->to.silent; if (channelPost) { - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - flags |= MTPDmessage::flag_silent; + flags |= MTPDmessage::Flag::f_silent; } if (file->type == PreparePhoto) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(file->photo, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(file->photo, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); } else if (file->type == PrepareDocument) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); } else if (file->type == PrepareAudio) { if (!h->peer->isChannel()) { - flags |= MTPDmessage::flag_media_unread; + flags |= MTPDmessage::Flag::f_media_unread; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(file->to.peer), MTPnullFwdHeader, MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); } if (_peer && file->to.peer == _peer->id) { @@ -5891,21 +5880,21 @@ void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, bool silent, const M App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; - int32 sendFlags = 0; + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); bool silentPost = channelPost && silent; if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); - hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } } @@ -5925,9 +5914,9 @@ namespace { } else if (document->type == StickerDocument && document->sticker()) { attributes.push_back(MTP_documentAttributeSticker(MTP_string(document->sticker()->alt), document->sticker()->set)); } else if (document->type == SongDocument && document->song()) { - attributes.push_back(MTP_documentAttributeAudio(MTP_int(MTPDdocumentAttributeAudio::flag_title | MTPDdocumentAttributeAudio::flag_performer), MTP_int(document->song()->duration), MTP_string(document->song()->title), MTP_string(document->song()->performer), MTPstring())); + attributes.push_back(MTP_documentAttributeAudio(MTP_flags(MTPDdocumentAttributeAudio::Flag::f_title | MTPDdocumentAttributeAudio::Flag::f_performer), MTP_int(document->song()->duration), MTP_string(document->song()->title), MTP_string(document->song()->performer), MTPstring())); } else if (document->type == VoiceDocument && document->voice()) { - attributes.push_back(MTP_documentAttributeAudio(MTP_int(MTPDdocumentAttributeAudio::flag_voice | MTPDdocumentAttributeAudio::flag_waveform), MTP_int(document->voice()->duration), MTPstring(), MTPstring(), MTP_string(documentWaveformEncode5bit(document->voice()->waveform)))); + attributes.push_back(MTP_documentAttributeAudio(MTP_flags(MTPDdocumentAttributeAudio::Flag::f_voice | MTPDdocumentAttributeAudio::Flag::f_waveform), MTP_int(document->voice()->duration), MTPstring(), MTPstring(), MTP_string(documentWaveformEncode5bit(document->voice()->waveform)))); } return MTP_vector(attributes); } @@ -5943,21 +5932,21 @@ void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, bool silent, cons App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; - int32 sendFlags = 0; + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); bool silentPost = channelPost && silent; if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); - hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedDocument(file, MTP_string(document->mime), _composeDocumentAttributes(document), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedDocument(file, MTP_string(document->mime), _composeDocumentAttributes(document), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } } } @@ -5972,21 +5961,21 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, bool silent, App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; - int32 sendFlags = 0; + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); bool silentPost = channelPost && silent; if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); - hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedThumbDocument(file, thumb, MTP_string(document->mime), _composeDocumentAttributes(document), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedThumbDocument(file, thumb, MTP_string(document->mime), _composeDocumentAttributes(document), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } } } @@ -6178,6 +6167,13 @@ void HistoryWidget::notify_automaticLoadSettingsChangedGif() { _emojiPan.notify_automaticLoadSettingsChangedGif(); } +void HistoryWidget::notify_handlePendingHistoryUpdate() { + if (_history && _history->hasPendingResizedItems()) { + updateListSize(); + _list->update(); + } +} + void HistoryWidget::resizeEvent(QResizeEvent *e) { _reportSpamPanel.resize(width(), _reportSpamPanel.height()); @@ -6295,10 +6291,9 @@ MsgId HistoryWidget::replyToId() const { return _replyToId ? _replyToId : (_kbReplyTo ? _kbReplyTo->id : 0); } -void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change, const HistoryItem *resizedItem, bool scrollToIt) { +void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change) { if (!_history || (initial && _histInited) || (!initial && !_histInited)) return; if (_firstLoadRequest) { - if (resizedItem) _list->recountHeight(resizedItem); return; // scrollTopMax etc are not working after recountHeight() } @@ -6330,25 +6325,13 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh if (!initial) { _history->lastScrollTop = _scroll.scrollTop(); } - int32 newSt = _list->recountHeight(resizedItem); + int32 newSt = _list->recountHeight(); bool washidden = _scroll.isHidden(); if (washidden) { _scroll.show(); } _list->updateSize(); int32 historyTop = _list->historyTop(), migratedTop = _list->migratedTop(); - if (resizedItem && !resizedItem->detached() && scrollToIt) { - int32 resizedTop = _list->itemTop(resizedItem); - if (resizedTop >= 0) { - if (newSt + _scroll.height() < resizedTop + resizedItem->height()) { - newSt = resizedTop + resizedItem->height() - _scroll.height(); - } - if (newSt > resizedTop) { - newSt = resizedTop; - } - wasAtBottom = false; - } - } if (washidden) { _scroll.hide(); } @@ -6692,28 +6675,28 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { bool lastKeyboardUsed = lastForceReplyReplied(); bool out = !_peer->isSelf(), unread = !_peer->isSelf(); - int32 flags = newMessageFlags(_peer) | MTPDmessage::flag_media; // unread, out - int32 sendFlags = 0; + MTPDmessage::Flags flags = newMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out + MTPmessages_SendInlineBotResult::Flags sendFlags = 0; if (replyToId()) { - flags |= MTPDmessage::flag_reply_to_msg_id; - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + flags |= MTPDmessage::Flag::f_reply_to_msg_id; + sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_reply_to_msg_id; } bool channelPost = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); bool showFromName = !channelPost || _peer->asChannel()->addsSignature(); bool silentPost = channelPost && _silent.checked(); if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_silent; } if (bot) { - flags |= MTPDmessage::flag_via_bot_id; + flags |= MTPDmessage::Flag::f_via_bot_id; } if (result->message.isEmpty()) { @@ -6750,7 +6733,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { App::feedDocument(document, thumb); } Local::writeStickerImage(mediaKey(DocumentFileLocation, MTP::maindc(), docId), result->data()); - _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(document, MTP_string(result->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + _history->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(document, MTP_string(result->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); } else if (result->type == qstr("photo")) { QImage fileThumb(result->thumb->pix().toImage()); @@ -6769,16 +6752,13 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { PhotoData *ph = App::photoSet(photoId, 0, 0, unixtime(), thumbPtr, ImagePtr(medium.width(), medium.height()), ImagePtr(result->width, result->height)); MTPPhoto photo = MTP_photo(MTP_long(photoId), MTP_long(0), MTP_int(ph->date), MTP_vector(photoSizes)); - _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(photo, MTP_string(result->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); + _history->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(photo, MTP_string(result->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1), MTPint()), NewMessageUnread); } } else { - flags |= MTPDmessage::flag_entities; - if (result->noWebPage) { - sendFlags |= MTPmessages_SendMessage::flag_no_webpage; - } - _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(result->message), MTP_messageMediaEmpty(), MTPnullMarkup, linksToMTP(result->entities), MTP_int(1), MTPint()), NewMessageUnread); + flags |= MTPDmessage::Flag::f_entities; + _history->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPnullFwdHeader, MTP_int(bot ? peerToUser(bot->id) : 0), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(result->message), MTP_messageMediaEmpty(), MTPnullMarkup, linksToMTP(result->entities), MTP_int(1), MTPint()), NewMessageUnread); } - _history->sendRequestId = MTP::send(MTPmessages_SendInlineBotResult(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_long(randomId), MTP_long(result->queryId), MTP_string(result->id)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); + _history->sendRequestId = MTP::send(MTPmessages_SendInlineBotResult(MTP_flags(sendFlags), _peer->input, MTP_int(replyToId()), MTP_long(randomId), MTP_long(result->queryId), MTP_string(result->id)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); @@ -6916,29 +6896,29 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti bool lastKeyboardUsed = lastForceReplyReplied(); bool out = !_peer->isSelf(), unread = !_peer->isSelf(); - int32 flags = newMessageFlags(_peer) | MTPDmessage::flag_media; // unread, out - int32 sendFlags = 0; + MTPDmessage::Flags flags = newMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyToId()) { - flags |= MTPDmessage::flag_reply_to_msg_id; - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + flags |= MTPDmessage::Flag::f_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); bool showFromName = !channelPost || _peer->asChannel()->addsSignature(); bool silentPost = channelPost && _silent.checked(); if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } _history->addNewDocument(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, doc, caption); - _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(doc->id), MTP_long(doc->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); + _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(doc->id), MTP_long(doc->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); @@ -6972,29 +6952,29 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption) bool lastKeyboardUsed = lastForceReplyReplied(); bool out = !_peer->isSelf(), unread = !_peer->isSelf(); - int32 flags = newMessageFlags(_peer) | MTPDmessage::flag_media; // unread, out - int32 sendFlags = 0; + MTPDmessage::Flags flags = newMessageFlags(_peer) | MTPDmessage::Flag::f_media; // unread, out + MTPmessages_SendMedia::Flags sendFlags = 0; if (replyToId()) { - flags |= MTPDmessage::flag_reply_to_msg_id; - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; + flags |= MTPDmessage::Flag::f_reply_to_msg_id; + sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; } bool channelPost = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); bool showFromName = !channelPost || _peer->asChannel()->addsSignature(); bool silentPost = channelPost && _silent.checked(); if (channelPost) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_SendMedia::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_SendMedia::flag_silent; + sendFlags |= MTPmessages_SendMedia::Flag::f_silent; } _history->addNewPhoto(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, photo, caption); - _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaPhoto(MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); + _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_flags(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaPhoto(MTP_inputPhoto(MTP_long(photo->id), MTP_long(photo->access)), MTP_string(caption)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId); App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); @@ -7145,7 +7125,8 @@ void HistoryWidget::onUnpinMessageSure() { } Ui::hideLayer(); - MTP::send(MTPchannels_UpdatePinnedMessage(MTP_int(0), _peer->asChannel()->inputChannel, MTP_int(0)), rpcDone(&HistoryWidget::unpinDone)); + MTPchannels_UpdatePinnedMessage::Flags flags = 0; + MTP::send(MTPchannels_UpdatePinnedMessage(MTP_flags(flags), _peer->asChannel()->inputChannel, MTP_int(0)), rpcDone(&HistoryWidget::unpinDone)); } void HistoryWidget::unpinDone(const MTPUpdates &updates) { @@ -7535,7 +7516,6 @@ void HistoryWidget::onDeleteSelectedSure() { for (SelectedItemSet::const_iterator i = sel.cbegin(), e = sel.cend(); i != e; ++i) { i.value()->destroy(); } - Notify::historyItemsResized(); Ui::hideLayer(); for (QMap >::const_iterator i = ids.cbegin(), e = ids.cend(); i != e; ++i) { @@ -7557,7 +7537,6 @@ void HistoryWidget::onDeleteContextSure() { App::main()->checkPeerHistory(h->peer); } - Notify::historyItemsResized(); Ui::hideLayer(); if (wasOnServer) { diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index cc94d93a3..c9b38f485 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -66,7 +66,7 @@ public: void touchScrollUpdated(const QPoint &screenPos); QPoint mapMouseToItem(QPoint p, HistoryItem *item); - int32 recountHeight(const HistoryItem *resizedItem); + int32 recountHeight(); void updateSize(); void repaintItem(const HistoryItem *item); @@ -589,13 +589,13 @@ public: bool ui_isInlineItemBeingChosen(); void notify_historyItemLayoutChanged(const HistoryItem *item); - void notify_automaticLoadSettingsChangedGif(); void notify_botCommandsChanged(UserData *user); void notify_inlineBotRequesting(bool requesting); void notify_userIsBotChanged(UserData *user); void notify_migrateUpdated(PeerData *peer); void notify_clipStopperHidden(ClipStopperType type); - void notify_historyItemResized(const HistoryItem *item, bool scrollToIt); + void notify_automaticLoadSettingsChangedGif(); + void notify_handlePendingHistoryUpdate(); void cmd_search(); void cmd_next_chat(); @@ -798,7 +798,7 @@ private: ScrollChangeType type; int value; }; - void updateListSize(bool initial = false, bool loadedDown = false, const ScrollChange &change = { ScrollChangeNone, 0 }, const HistoryItem *resizedItem = 0, bool scrollToIt = false); + void updateListSize(bool initial = false, bool loadedDown = false, const ScrollChange &change = { ScrollChangeNone, 0 }); void saveGifDone(DocumentData *doc, const MTPBool &result); diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 810f3fb53..f915ab3a7 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -230,8 +230,8 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { checkRequest.start(1000); - int32 flags = 0; - sentRequest = MTP::send(MTPauth_SendCode(MTP_int(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + MTPauth_SendCode::Flags flags = 0; + sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); } else { showError(lang(lng_bad_phone_noreg), true); enableAll(true); @@ -271,8 +271,8 @@ void IntroPhone::toSignUp() { checkRequest.start(1000); - int32 flags = 0; - sentRequest = MTP::send(MTPauth_SendCode(MTP_int(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + MTPauth_SendCode::Flags flags = 0; + sentRequest = MTP::send(MTPauth_SendCode(MTP_flags(flags), MTP_string(sentPhone), MTPBool(), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); } bool IntroPhone::phoneSubmitFail(const RPCError &error) { diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index 4ce85fa75..498d43831 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -411,7 +411,7 @@ void FileLoadTask::process() { } if (voice) { - attributes[0] = MTP_documentAttributeAudio(MTP_int(MTPDdocumentAttributeAudio::flag_voice | MTPDdocumentAttributeAudio::flag_waveform), MTP_int(_duration), MTPstring(), MTPstring(), MTP_string(documentWaveformEncode5bit(_waveform))); + attributes[0] = MTP_documentAttributeAudio(MTP_flags(MTPDdocumentAttributeAudio::Flag::f_voice | MTPDdocumentAttributeAudio::Flag::f_waveform), MTP_int(_duration), MTPstring(), MTPstring(), MTP_string(documentWaveformEncode5bit(_waveform))); attributes.resize(1); document = MTP_document(MTP_long(_id), MTP_long(0), MTP_int(unixtime()), MTP_string(filemime), MTP_int(filesize), thumbSize, MTP_int(MTP::maindc()), MTP_vector(attributes)); } else { diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 4eba35bfe..d0959f05e 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -864,7 +864,7 @@ namespace { } } - mtpDcOptions *_dcOpts = 0; + MTP::DcOptions *_dcOpts = 0; bool _readSetting(quint32 blockId, QDataStream &stream, int version) { switch (blockId) { case dbiDcOptionOld: { @@ -873,16 +873,17 @@ namespace { stream >> dcId >> host >> ip >> port; if (!_checkStreamStatus(stream)) return false; - if (_dcOpts) _dcOpts->insert(dcId, mtpDcOption(dcId, 0, ip.toUtf8().constData(), port)); + if (_dcOpts) _dcOpts->insert(dcId, MTP::DcOption(dcId, 0, ip.toUtf8().constData(), port)); } break; case dbiDcOption: { - quint32 dcIdWithShift, flags, port; + quint32 dcIdWithShift, port; + qint32 flags; QString ip; stream >> dcIdWithShift >> flags >> ip >> port; if (!_checkStreamStatus(stream)) return false; - if (_dcOpts) _dcOpts->insert(dcIdWithShift, mtpDcOption(dcIdWithShift % _mtp_internal::dcShift, flags, ip.toUtf8().constData(), port)); + if (_dcOpts) _dcOpts->insert(dcIdWithShift, MTP::DcOption(dcIdWithShift % _mtp_internal::dcShift, MTPDdcOption::Flags(flags), ip.toUtf8().constData(), port)); } break; case dbiChatSizeMax: { @@ -1462,16 +1463,16 @@ namespace { LOG(("App Info: reading old user config..")); qint32 version = 0; - mtpDcOptions dcOpts; + MTP::DcOptions dcOpts; { QReadLocker lock(MTP::dcOptionsMutex()); - dcOpts = cDcOptions(); + dcOpts = Global::DcOptions(); } _dcOpts = &dcOpts; _readOldUserSettingsFields(&file, version); { QWriteLocker lock(MTP::dcOptionsMutex()); - cSetDcOptions(dcOpts); + Global::SetDcOptions(dcOpts); } file.close(); @@ -1549,16 +1550,16 @@ namespace { LOG(("App Info: reading old keys..")); qint32 version = 0; - mtpDcOptions dcOpts; + MTP::DcOptions dcOpts; { QReadLocker lock(MTP::dcOptionsMutex()); - dcOpts = cDcOptions(); + dcOpts = Global::DcOptions(); } _dcOpts = &dcOpts; _readOldMtpDataFields(&file, version); { QWriteLocker lock(MTP::dcOptionsMutex()); - cSetDcOptions(dcOpts); + Global::SetDcOptions(dcOpts); } file.close(); @@ -2116,10 +2117,10 @@ namespace Local { LOG(("App Error: could not decrypt settings from settings file, maybe bad passcode..")); return writeSettings(); } - mtpDcOptions dcOpts; + MTP::DcOptions dcOpts; { QReadLocker lock(MTP::dcOptionsMutex()); - dcOpts = cDcOptions(); + dcOpts = Global::DcOptions(); } _dcOpts = &dcOpts; LOG(("App Info: reading encrypted settings..")); @@ -2137,20 +2138,23 @@ namespace Local { if (dcOpts.isEmpty()) { const BuiltInDc *bdcs = builtInDcs(); for (int i = 0, l = builtInDcsCount(); i < l; ++i) { - dcOpts.insert(bdcs[i].id, mtpDcOption(bdcs[i].id, 0, bdcs[i].ip, bdcs[i].port)); + MTPDdcOption::Flags flags = 0; + int idWithShift = bdcs[i].id + (flags * _mtp_internal::dcShift); + dcOpts.insert(idWithShift, MTP::DcOption(bdcs[i].id, flags, bdcs[i].ip, bdcs[i].port)); DEBUG_LOG(("MTP Info: adding built in DC %1 connect option: %2:%3").arg(bdcs[i].id).arg(bdcs[i].ip).arg(bdcs[i].port)); } const BuiltInDc *bdcsipv6 = builtInDcsIPv6(); for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) { - int32 flags = MTPDdcOption::flag_ipv6, idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift); - dcOpts.insert(idWithShift, mtpDcOption(bdcsipv6[i].id, flags, bdcsipv6[i].ip, bdcsipv6[i].port)); + MTPDdcOption::Flags flags = MTPDdcOption::Flag::f_ipv6; + int idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift); + dcOpts.insert(idWithShift, MTP::DcOption(bdcsipv6[i].id, flags, bdcsipv6[i].ip, bdcsipv6[i].port)); DEBUG_LOG(("MTP Info: adding built in DC %1 IPv6 connect option: %2:%3").arg(bdcsipv6[i].id).arg(bdcsipv6[i].ip).arg(bdcsipv6[i].port)); } } { QWriteLocker lock(MTP::dcOptionsMutex()); - cSetDcOptions(dcOpts); + Global::SetDcOptions(dcOpts); } _oldSettingsVersion = settingsData.version; @@ -2173,30 +2177,34 @@ namespace Local { } settings.writeData(_settingsSalt); - mtpDcOptions dcOpts; + MTP::DcOptions dcOpts; { QReadLocker lock(MTP::dcOptionsMutex()); - dcOpts = cDcOptions(); + dcOpts = Global::DcOptions(); } if (dcOpts.isEmpty()) { const BuiltInDc *bdcs = builtInDcs(); for (int i = 0, l = builtInDcsCount(); i < l; ++i) { - dcOpts.insert(bdcs[i].id, mtpDcOption(bdcs[i].id, 0, bdcs[i].ip, bdcs[i].port)); + MTPDdcOption::Flags flags = 0; + int idWithShift = bdcs[i].id + (flags * _mtp_internal::dcShift); + dcOpts.insert(idWithShift, MTP::DcOption(bdcs[i].id, flags, bdcs[i].ip, bdcs[i].port)); DEBUG_LOG(("MTP Info: adding built in DC %1 connect option: %2:%3").arg(bdcs[i].id).arg(bdcs[i].ip).arg(bdcs[i].port)); } const BuiltInDc *bdcsipv6 = builtInDcsIPv6(); for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) { - dcOpts.insert(bdcsipv6[i].id + (MTPDdcOption::flag_ipv6 * _mtp_internal::dcShift), mtpDcOption(bdcsipv6[i].id, MTPDdcOption::flag_ipv6, bdcsipv6[i].ip, bdcsipv6[i].port)); + MTPDdcOption::Flags flags = MTPDdcOption::Flag::f_ipv6; + int idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift); + dcOpts.insert(idWithShift, MTP::DcOption(bdcsipv6[i].id, flags, bdcsipv6[i].ip, bdcsipv6[i].port)); DEBUG_LOG(("MTP Info: adding built in DC %1 IPv6 connect option: %2:%3").arg(bdcsipv6[i].id).arg(bdcsipv6[i].ip).arg(bdcsipv6[i].port)); } QWriteLocker lock(MTP::dcOptionsMutex()); - cSetDcOptions(dcOpts); + Global::SetDcOptions(dcOpts); } quint32 size = 12 * (sizeof(quint32) + sizeof(qint32)); - for (mtpDcOptions::const_iterator i = dcOpts.cbegin(), e = dcOpts.cend(); i != e; ++i) { + for (auto i = dcOpts.cbegin(), e = dcOpts.cend(); i != e; ++i) { size += sizeof(quint32) + sizeof(quint32) + sizeof(quint32); size += sizeof(quint32) + _stringSize(QString::fromUtf8(i->ip.data(), i->ip.size())); } @@ -2223,9 +2231,9 @@ namespace Local { data.stream << quint32(dbiLastUpdateCheck) << qint32(cLastUpdateCheck()); data.stream << quint32(dbiScale) << qint32(cConfigScale()); data.stream << quint32(dbiLang) << qint32(cLang()); - for (mtpDcOptions::const_iterator i = dcOpts.cbegin(), e = dcOpts.cend(); i != e; ++i) { + for (auto i = dcOpts.cbegin(), e = dcOpts.cend(); i != e; ++i) { data.stream << quint32(dbiDcOption) << quint32(i.key()); - data.stream << quint32(i->flags) << QString::fromUtf8(i->ip.data(), i->ip.size()); + data.stream << qint32(i->flags) << QString::fromUtf8(i->ip.data(), i->ip.size()); data.stream << quint32(i->port); } data.stream << quint32(dbiLangFile) << cLangFile(); @@ -3019,10 +3027,10 @@ namespace Local { } void _writeStickerSet(QDataStream &stream, uint64 setId) { - StickerSets::const_iterator it = cStickerSets().constFind(setId); - if (it == cStickerSets().cend()) return; + auto it = Global::StickerSets().constFind(setId); + if (it == Global::StickerSets().cend()) return; - bool notLoaded = (it->flags & MTPDstickerSet_flag_NOT_LOADED); + bool notLoaded = (it->flags & MTPDstickerSet_ClientFlag::f_not_loaded); if (notLoaded) { stream << quint64(it->id) << quint64(it->access) << it->title << it->shortName << qint32(-it->count) << qint32(it->hash) << qint32(it->flags); return; @@ -3063,7 +3071,7 @@ namespace Local { void writeStickers() { if (!_working()) return; - const StickerSets &sets(cStickerSets()); + const Stickers::Sets &sets(Global::StickerSets()); if (sets.isEmpty()) { if (_stickersKey) { clearKey(_stickersKey); @@ -3075,10 +3083,10 @@ namespace Local { int32 setsCount = 0; QByteArray hashToWrite; quint32 size = sizeof(quint32) + _bytearraySize(hashToWrite); - for (StickerSets::const_iterator i = sets.cbegin(); i != sets.cend(); ++i) { - bool notLoaded = (i->flags & MTPDstickerSet_flag_NOT_LOADED); + for (auto i = sets.cbegin(); i != sets.cend(); ++i) { + bool notLoaded = (i->flags & MTPDstickerSet_ClientFlag::f_not_loaded); if (notLoaded) { - if (!(i->flags & MTPDstickerSet::flag_disabled) || (i->flags & MTPDstickerSet::flag_official)) { // waiting to receive + if (!(i->flags & MTPDstickerSet::Flag::f_disabled) || (i->flags & MTPDstickerSet::Flag::f_official)) { // waiting to receive return; } } else { @@ -3114,8 +3122,8 @@ namespace Local { } EncryptedDescriptor data(size); data.stream << quint32(setsCount) << hashToWrite; - _writeStickerSet(data.stream, CustomStickerSetId); - for (StickerSetsOrder::const_iterator i = cStickerSetsOrder().cbegin(), e = cStickerSetsOrder().cend(); i != e; ++i) { + _writeStickerSet(data.stream, Stickers::CustomSetId); + for (auto i = Global::StickerSetsOrder().cbegin(), e = Global::StickerSetsOrder().cend(); i != e; ++i) { _writeStickerSet(data.stream, *i); } FileWriteDescriptor file(_stickersKey); @@ -3134,17 +3142,17 @@ namespace Local { return; } - StickerSets &sets(cRefStickerSets()); + Stickers::Sets &sets(Global::RefStickerSets()); sets.clear(); - StickerSetsOrder &order(cRefStickerSetsOrder()); + Stickers::Order &order(Global::RefStickerSetsOrder()); order.clear(); RecentStickerPack &recent(cRefRecentStickers()); recent.clear(); - StickerSet &def(sets.insert(DefaultStickerSetId, StickerSet(DefaultStickerSetId, 0, lang(lng_stickers_default_set), QString(), 0, 0, MTPDstickerSet::flag_official)).value()); - StickerSet &custom(sets.insert(CustomStickerSetId, StickerSet(CustomStickerSetId, 0, lang(lng_custom_stickers), QString(), 0, 0, 0)).value()); + Stickers::Set &def(sets.insert(Stickers::DefaultSetId, Stickers::Set(Stickers::DefaultSetId, 0, lang(lng_stickers_default_set), QString(), 0, 0, MTPDstickerSet::Flag::f_official)).value()); + Stickers::Set &custom(sets.insert(Stickers::CustomSetId, Stickers::Set(Stickers::CustomSetId, 0, lang(lng_custom_stickers), QString(), 0, 0, 0)).value()); QMap read; while (!stickers.stream.atEnd()) { @@ -3183,11 +3191,11 @@ namespace Local { if (recent.size() < StickerPanPerRow * StickerPanRowsPerPage && qAbs(value) > 1) recent.push_back(qMakePair(doc, qAbs(value))); } if (def.stickers.isEmpty()) { - sets.remove(DefaultStickerSetId); + sets.remove(Stickers::DefaultSetId); } else { - order.push_front(DefaultStickerSetId); + order.push_front(Stickers::DefaultSetId); } - if (custom.stickers.isEmpty()) sets.remove(CustomStickerSetId); + if (custom.stickers.isEmpty()) sets.remove(Stickers::CustomSetId); writeStickers(); writeUserSettings(); @@ -3210,10 +3218,10 @@ namespace Local { return; } - StickerSets &sets(cRefStickerSets()); + Stickers::Sets &sets(Global::RefStickerSets()); sets.clear(); - StickerSetsOrder &order(cRefStickerSetsOrder()); + Stickers::Order &order(Global::RefStickerSetsOrder()); order.clear(); quint32 cnt; @@ -3231,20 +3239,24 @@ namespace Local { qint32 setHash = 0, setFlags = 0; if (stickers.version > 8033) { stickers.stream >> setHash >> setFlags; + if (setFlags & qFlags(MTPDstickerSet_ClientFlag::f_not_loaded__old)) { + setFlags &= ~qFlags(MTPDstickerSet_ClientFlag::f_not_loaded__old); + setFlags |= qFlags(MTPDstickerSet_ClientFlag::f_not_loaded); + } } - if (setId == DefaultStickerSetId) { + if (setId == Stickers::DefaultSetId) { setTitle = lang(lng_stickers_default_set); - setFlags |= MTPDstickerSet::flag_official; + setFlags |= qFlags(MTPDstickerSet::Flag::f_official); order.push_front(setId); - } else if (setId == CustomStickerSetId) { + } else if (setId == Stickers::CustomSetId) { setTitle = lang(lng_custom_stickers); } else if (setId) { order.push_back(setId); } else { continue; } - StickerSet &set(sets.insert(setId, StickerSet(setId, setAccess, setTitle, setShortName, 0, setHash, setFlags)).value()); + Stickers::Set &set(sets.insert(setId, Stickers::Set(setId, setAccess, setTitle, setShortName, 0, setHash, MTPDstickerSet::Flags(setFlags))).value()); if (scnt < 0) { // disabled not loaded set set.count = -scnt; continue; @@ -3264,7 +3276,7 @@ namespace Local { if (read.contains(id)) continue; read.insert(id, true); - if (setId == DefaultStickerSetId || setId == CustomStickerSetId) { + if (setId == Stickers::DefaultSetId || setId == Stickers::CustomSetId) { typeOfSet = StickerSetTypeEmpty; } @@ -3325,17 +3337,17 @@ namespace Local { int32 countStickersHash(bool checkOfficial) { uint32 acc = 0; bool foundOfficial = false, foundBad = false;; - const StickerSets &sets(cStickerSets()); - const StickerSetsOrder &order(cStickerSetsOrder()); - for (StickerSetsOrder::const_iterator i = order.cbegin(), e = order.cend(); i != e; ++i) { - StickerSets::const_iterator j = sets.constFind(*i); + const Stickers::Sets &sets(Global::StickerSets()); + const Stickers::Order &order(Global::StickerSetsOrder()); + for (auto i = order.cbegin(), e = order.cend(); i != e; ++i) { + auto j = sets.constFind(*i); if (j != sets.cend()) { if (j->id == 0) { foundBad = true; - } else if (j->flags & MTPDstickerSet::flag_official) { + } else if (j->flags & MTPDstickerSet::Flag::f_official) { foundOfficial = true; } - if (!(j->flags & MTPDstickerSet::flag_disabled)) { + if (!(j->flags & MTPDstickerSet::Flag::f_disabled)) { acc = (acc * 20261) + j->hash; } } @@ -3600,7 +3612,7 @@ namespace Local { user->setName(first, last, pname, username); user->access = access; - user->flags = flags; + user->flags = MTPDuser::Flags(flags); user->onlineTill = onlineTill; user->contact = contact; user->setBotInfoVersion(botInfoVersion); @@ -3629,7 +3641,7 @@ namespace Local { flags = flagsData; } else { // flagsData was haveLeft - flags = (flagsData == 1 ? MTPDchat::flag_left : 0); + flags = (flagsData == 1 ? MTPDchat::Flags(MTPDchat::Flag::f_left) : 0); } if (!wasLoaded) { chat->updateName(name, QString(), QString()); @@ -3638,7 +3650,7 @@ namespace Local { chat->version = version; chat->creator = creator; chat->isForbidden = (forbidden == 1); - chat->flags = flags; + chat->flags = MTPDchat::Flags(flags); chat->invitationUrl = invitationUrl; chat->input = MTP_inputPeerChat(MTP_int(peerToChat(chat->id))); @@ -3660,7 +3672,7 @@ namespace Local { channel->date = date; channel->version = version; channel->isForbidden = (forbidden == 1); - channel->flags = flags; + channel->flags = MTPDchannel::Flags(flags); channel->invitationUrl = invitationUrl; channel->input = MTP_inputPeerChannel(MTP_int(peerToChannel(channel->id)), MTP_long(access)); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 5681ca685..c420db743 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -615,20 +615,21 @@ void MainWidget::finishForwarding(History *hist, bool broadcast, bool silent) { PeerData *forwardFrom = 0; App::main()->readServerHistory(hist, false); - int32 sendFlags = 0, flags = 0; + MTPDmessage::Flags flags = 0; + MTPmessages_ForwardMessages::Flags sendFlags = 0; bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && (hist->peer->asChannel()->isBroadcast() || broadcast); bool showFromName = !channelPost || hist->peer->asChannel()->addsSignature(); bool silentPost = channelPost && silent; if (channelPost) { - sendFlags |= MTPmessages_ForwardMessages::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_ForwardMessages::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_ForwardMessages::flag_silent; + sendFlags |= MTPmessages_ForwardMessages::Flag::f_silent; } QVector ids; @@ -650,7 +651,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast, bool silent) { } if (forwardFrom != i.value()->history()->peer) { if (forwardFrom) { - hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_int(sendFlags), forwardFrom->input, MTP_vector(ids), MTP_vector(randomIds), hist->peer->input), rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_flags(sendFlags), forwardFrom->input, MTP_vector(ids), MTP_vector(randomIds), hist->peer->input), rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); ids.resize(0); randomIds.resize(0); } @@ -659,7 +660,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast, bool silent) { ids.push_back(MTP_int(i.value()->id)); randomIds.push_back(MTP_long(randomId)); } - hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_int(sendFlags), forwardFrom->input, MTP_vector(ids), MTP_vector(randomIds), hist->peer->input), rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_flags(sendFlags), forwardFrom->input, MTP_vector(ids), MTP_vector(randomIds), hist->peer->input), rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); if (history.peer() == hist->peer) { history.peerMessagesUpdated(); @@ -687,8 +688,7 @@ void MainWidget::webPagesUpdate() { WebPageItems::const_iterator j = items.constFind(App::webPage(i.key())); if (j != items.cend()) { for (HistoryItemsMap::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { - k.key()->initDimensions(); - Notify::historyItemResized(k.key()); + k.key()->setPendingInitDimensions(); } } } @@ -783,8 +783,7 @@ void MainWidget::notify_userIsContactChanged(UserData *user, bool fromThisApp) { SharedContactItems::const_iterator i = items.constFind(peerToUser(user->id)); if (i != items.cend()) { for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - j.key()->initDimensions(); - Ui::repaintHistoryItem(j.key()); + j.key()->setPendingInitDimensions(); } } @@ -830,6 +829,10 @@ void MainWidget::notify_automaticLoadSettingsChangedGif() { history.notify_automaticLoadSettingsChangedGif(); } +void MainWidget::notify_handlePendingHistoryUpdate() { + history.notify_handlePendingHistoryUpdate(); +} + void MainWidget::cmd_search() { history.cmd_search(); } @@ -842,18 +845,6 @@ void MainWidget::cmd_previous_chat() { history.cmd_previous_chat(); } -void MainWidget::notify_historyItemResized(const HistoryItem *item, bool scrollToIt) { - if (!item || ((history.peer() == item->history()->peer || (history.peer() && history.peer() == item->history()->peer->migrateTo())) && !item->detached())) { - history.notify_historyItemResized(item, scrollToIt); - } else if (item) { - item->history()->width = 0; - if (history.peer() == item->history()->peer || (history.peer() && history.peer() == item->history()->peer->migrateTo())) { - history.resizeEvent(0); - } - } - if (item) Ui::repaintHistoryItem(item); -} - void MainWidget::noHider(HistoryHider *destroyed) { if (_hider == destroyed) { _hider = 0; @@ -1379,40 +1370,40 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, App::historyRegSentData(randomId, hist->peer->id, sendingText); MTPstring msgText(MTP_string(sendingText)); - int32 flags = newMessageFlags(hist->peer) | MTPDmessage::flag_entities; // unread, out - int32 sendFlags = 0; + MTPDmessage::Flags flags = newMessageFlags(hist->peer) | MTPDmessage::Flag::f_entities; // unread, out + MTPmessages_SendMessage::Flags sendFlags = 0; if (replyTo) { - flags |= MTPDmessage::flag_reply_to_msg_id; - sendFlags |= MTPmessages_SendMessage::flag_reply_to_msg_id; + flags |= MTPDmessage::Flag::f_reply_to_msg_id; + sendFlags |= MTPmessages_SendMessage::Flag::f_reply_to_msg_id; } MTPMessageMedia media = MTP_messageMediaEmpty(); if (webPageId == CancelledWebPageId) { - sendFlags |= MTPmessages_SendMessage::flag_no_webpage; + sendFlags |= MTPmessages_SendMessage::Flag::f_no_webpage; } else if (webPageId) { WebPageData *page = App::webPage(webPageId); media = MTP_messageMediaWebPage(MTP_webPagePending(MTP_long(page->id), MTP_int(page->pendingTill))); - flags |= MTPDmessage::flag_media; + flags |= MTPDmessage::Flag::f_media; } bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && (hist->peer->asChannel()->isBroadcast() || broadcast); bool showFromName = !channelPost || hist->peer->asChannel()->addsSignature(); bool silentPost = channelPost && silent; if (channelPost) { - sendFlags |= MTPmessages_SendMessage::flag_broadcast; - flags |= MTPDmessage::flag_views; - flags |= MTPDmessage::flag_post; + sendFlags |= MTPmessages_SendMessage::Flag::f_broadcast; + flags |= MTPDmessage::Flag::f_views; + flags |= MTPDmessage::Flag::f_post; } if (showFromName) { - flags |= MTPDmessage::flag_from_id; + flags |= MTPDmessage::Flag::f_from_id; } if (silentPost) { - sendFlags |= MTPmessages_SendMessage::flag_silent; + sendFlags |= MTPmessages_SendMessage::Flag::f_silent; } MTPVector localEntities = linksToMTP(sendingEntities), sentEntities = linksToMTP(sendingEntities, true); if (!sentEntities.c_vector().v.isEmpty()) { - sendFlags |= MTPmessages_SendMessage::flag_entities; + sendFlags |= MTPmessages_SendMessage::Flag::f_entities; } - hist->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(hist->peer->id), MTPnullFwdHeader, MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities, MTP_int(1), MTPint()), NewMessageUnread); - hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, sentEntities), rpcDone(&MainWidget::sentUpdatesReceived, randomId), rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); + hist->addNewMessage(MTP_message(MTP_flags(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(hist->peer->id), MTPnullFwdHeader, MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities, MTP_int(1), MTPint()), NewMessageUnread); + hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_flags(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, sentEntities), rpcDone(&MainWidget::sentUpdatesReceived, randomId), rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); } finishForwarding(hist, broadcast, silent); @@ -1502,8 +1493,11 @@ bool MainWidget::preloadOverview(PeerData *peer, MediaOverviewType type) { return false; } - int32 flags = (peer->isChannel() && !peer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _overviewPreload[type].insert(peer, MTP::send(MTPmessages_Search(MTP_int(flags), peer->input, MTP_string(""), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::overviewPreloaded, peer), rpcFail(&MainWidget::overviewFailed, peer), 0, 10)); + MTPmessages_Search::Flags flags = 0; + if (peer->isChannel() && !peer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _overviewPreload[type].insert(peer, MTP::send(MTPmessages_Search(MTP_flags(flags), peer->input, MTP_string(""), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::overviewPreloaded, peer), rpcFail(&MainWidget::overviewFailed, peer), 0, 10)); return true; } @@ -1635,8 +1629,11 @@ void MainWidget::loadMediaBack(PeerData *peer, MediaOverviewType type, bool many MTPMessagesFilter filter = typeToMediaFilter(type); if (type == OverviewCount) return; - int32 flags = (peer->isChannel() && !peer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _overviewLoad[type].insert(peer, MTP::send(MTPmessages_Search(MTP_int(flags), peer->input, MTPstring(), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minId), MTP_int(limit)), rpcDone(&MainWidget::overviewLoaded, history))); + MTPmessages_Search::Flags flags = 0; + if (peer->isChannel() && !peer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _overviewLoad[type].insert(peer, MTP::send(MTPmessages_Search(MTP_flags(flags), peer->input, MTPstring(), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minId), MTP_int(limit)), rpcDone(&MainWidget::overviewLoaded, history))); } void MainWidget::peerUsernameChanged(PeerData *peer) { @@ -1762,6 +1759,14 @@ void MainWidget::ui_showPeerHistoryAsync(quint64 peerId, qint32 showAtMsgId) { Ui::showPeerHistory(peerId, showAtMsgId); } +void MainWidget::ui_autoplayMediaInlineAsync(qint32 channelId, qint32 msgId) { + if (HistoryItem *item = App::histItemById(channelId, msgId)) { + if (HistoryMedia *media = item->getMedia()) { + media->playInline(item, true); + } + } +} + void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { AudioMsgId playing; AudioPlayerState state = AudioPlayerStopped; @@ -1953,13 +1958,13 @@ void MainWidget::dialogsCancelled() { } void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia &media) { - int32 flags = MTPDmessage::flag_unread | MTPDmessage::flag_entities | MTPDmessage::flag_from_id; + MTPDmessage::Flags flags = MTPDmessage::Flag::f_unread | MTPDmessage::Flag::f_entities | MTPDmessage::Flag::f_from_id; QString sendingText, leftText = msg; EntitiesInText sendingEntities, leftEntities = textParseEntities(leftText, _historyTextNoMonoOptions.flags); HistoryItem *item = 0; while (textSplit(sendingText, sendingEntities, leftText, leftEntities, MaxMessageSize)) { MTPVector localEntities = linksToMTP(sendingEntities); - item = App::histories().addNewMessage(MTP_message(MTP_int(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPnullFwdHeader, MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint(), MTPint()), NewMessageUnread); + item = App::histories().addNewMessage(MTP_message(MTP_flags(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPnullFwdHeader, MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint(), MTPint()), NewMessageUnread); } if (item) { history.peerMessagesUpdated(item->history()->peer->id); @@ -2910,7 +2915,7 @@ void MainWidget::onUpdateNotifySettings() { if (peer->notify == UnknownNotifySettings || peer->notify == EmptyNotifySettings) { peer->notify = new NotifySettings(); } - MTP::send(MTPaccount_UpdateNotifySettings(MTP_inputNotifyPeer(peer->input), MTP_inputPeerNotifySettings(MTP_int(peer->notify->flags), MTP_int(peer->notify->mute), MTP_string(peer->notify->sound))), RPCResponseHandler(), 0, updateNotifySettingPeers.isEmpty() ? 0 : 10); + MTP::send(MTPaccount_UpdateNotifySettings(MTP_inputNotifyPeer(peer->input), MTP_inputPeerNotifySettings(MTP_flags(mtpCastFlags(peer->notify->flags)), MTP_int(peer->notify->mute), MTP_string(peer->notify->sound))), RPCResponseHandler(), 0, updateNotifySettingPeers.isEmpty() ? 0 : 10); } } @@ -3799,9 +3804,9 @@ void MainWidget::updateNotifySetting(PeerData *peer, NotifySettingStatus notify, peer->notify->mute = (notify == NotifySettingSetMuted) ? (unixtime() + muteFor) : 0; } if (silent == SilentNotifiesSetSilent) { - peer->notify->flags |= MTPDpeerNotifySettings::flag_silent; + peer->notify->flags |= MTPDpeerNotifySettings::Flag::f_silent; } else if (silent == SilentNotifiesSetNotify) { - peer->notify->flags &= ~MTPDpeerNotifySettings::flag_silent; + peer->notify->flags &= ~MTPDpeerNotifySettings::Flag::f_silent; } } if (notify != NotifySettingDontChange) { @@ -3864,9 +3869,9 @@ void MainWidget::incrementSticker(DocumentData *sticker) { case mtpc_inputStickerSetID: setId = sticker->sticker()->set.c_inputStickerSetID().vid.v; break; case mtpc_inputStickerSetShortName: setName = qs(sticker->sticker()->set.c_inputStickerSetShortName().vshort_name).toLower().trimmed(); break; } - StickerSets &sets(cRefStickerSets()); - for (StickerSets::const_iterator i = sets.cbegin(); i != sets.cend(); ++i) { - if (i->id == CustomStickerSetId || i->id == DefaultStickerSetId || (setId && i->id == setId) || (!setName.isEmpty() && i->shortName.toLower().trimmed() == setName)) { + Stickers::Sets &sets(Global::RefStickerSets()); + for (auto i = sets.cbegin(); i != sets.cend(); ++i) { + if (i->id == Stickers::CustomSetId || i->id == Stickers::DefaultSetId || (setId && i->id == setId) || (!setName.isEmpty() && i->shortName.toLower().trimmed() == setName)) { for (int32 j = 0, l = i->stickers.size(); j < l; ++j) { if (i->stickers.at(j) == sticker) { found = true; @@ -3877,9 +3882,9 @@ void MainWidget::incrementSticker(DocumentData *sticker) { } } if (!found) { - StickerSets::iterator it = sets.find(CustomStickerSetId); + Stickers::Sets::iterator it = sets.find(Stickers::CustomSetId); if (it == sets.cend()) { - it = sets.insert(CustomStickerSetId, StickerSet(CustomStickerSetId, 0, lang(lng_custom_stickers), QString(), 0, 0, 0)); + it = sets.insert(Stickers::CustomSetId, Stickers::Set(Stickers::CustomSetId, 0, lang(lng_custom_stickers), QString(), 0, 0, 0)); } it->stickers.push_back(sticker); ++it->count; @@ -4094,8 +4099,8 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { } // update before applying skipped - int32 flags = d.vflags.v | MTPDmessage::flag_from_id; - HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, d.is_out() ? MTP_int(MTP::authedId()) : d.vuser_id, MTP_peerUser(d.is_out() ? d.vuser_id : MTP_int(MTP::authedId())), d.vfwd_from, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint(), MTPint()), NewMessageUnread); + MTPDmessage::Flags flags = mtpCastFlags(d.vflags.v) | MTPDmessage::Flag::f_from_id; + HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_flags(flags), d.vid, d.is_out() ? MTP_int(MTP::authedId()) : d.vuser_id, MTP_peerUser(d.is_out() ? d.vuser_id : MTP_int(MTP::authedId())), d.vfwd_from, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint(), MTPint()), NewMessageUnread); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } @@ -4129,8 +4134,8 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { } // update before applying skipped - int32 flags = d.vflags.v | MTPDmessage::flag_from_id; - HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), d.vfwd_from, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint(), MTPint()), NewMessageUnread); + MTPDmessage::Flags flags = mtpCastFlags(d.vflags.v) | MTPDmessage::Flag::f_from_id; + HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_flags(flags), d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), d.vfwd_from, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint(), MTPint()), NewMessageUnread); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } @@ -4152,9 +4157,6 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { if (HistoryItem *item = App::histItemById(peerToChannel(peerId), d.vid.v)) { item->setText(text, d.has_entities() ? entitiesFromMTP(d.ventities.c_vector().v) : EntitiesInText()); item->updateMedia(d.has_media() ? (&d.vmedia) : 0); - item->initDimensions(); - Notify::historyItemResized(item); - item->addToOverview(AddToOverviewNew); } } @@ -4437,7 +4439,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { UserData *user = App::userLoaded(d.vuser_id.v); if (user) { if (App::history(user->id)->loadedAtBottom()) { - App::history(user->id)->addNewService(clientMsgId(), date(d.vdate), lng_action_user_registered(lt_from, user->name), MTPDmessage::flag_unread); + App::history(user->id)->addNewService(clientMsgId(), date(d.vdate), lng_action_user_registered(lt_from, user->name), MTPDmessage::Flag::f_unread); } } } break; @@ -4660,10 +4662,10 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { if (set.vset.type() == mtpc_stickerSet) { const MTPDstickerSet &s(set.vset.c_stickerSet()); - StickerSets &sets(cRefStickerSets()); - StickerSets::iterator it = sets.find(s.vid.v); + Stickers::Sets &sets(Global::RefStickerSets()); + auto it = sets.find(s.vid.v); if (it == sets.cend()) { - it = sets.insert(s.vid.v, StickerSet(s.vid.v, s.vaccess_hash.v, stickerSetTitle(s), qs(s.vshort_name), s.vcount.v, s.vhash.v, s.vflags.v)); + it = sets.insert(s.vid.v, Stickers::Set(s.vid.v, s.vaccess_hash.v, stickerSetTitle(s), qs(s.vshort_name), s.vcount.v, s.vhash.v, s.vflags.v)); } const QVector &v(set.vdocuments.c_vector().v); @@ -4694,7 +4696,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } - StickerSetsOrder &order(cRefStickerSetsOrder()); + auto &order(Global::RefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(s.vid.v); if (currentIndex != insertAtIndex) { if (currentIndex > 0) { @@ -4703,7 +4705,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { order.insert(insertAtIndex, s.vid.v); } - StickerSets::iterator custom = sets.find(CustomStickerSetId); + auto custom = sets.find(Stickers::CustomSetId); if (custom != sets.cend()) { for (int32 i = 0, l = it->stickers.size(); i < l; ++i) { int32 removeIndex = custom->stickers.indexOf(it->stickers.at(i)); @@ -4722,26 +4724,26 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { case mtpc_updateStickerSetsOrder: { const MTPDupdateStickerSetsOrder &d(update.c_updateStickerSetsOrder()); const QVector &order(d.vorder.c_vector().v); - const StickerSets &sets(cStickerSets()); - StickerSetsOrder result; + const Stickers::Sets &sets(Global::StickerSets()); + Stickers::Order result; for (int32 i = 0, l = order.size(); i < l; ++i) { if (sets.constFind(order.at(i).v) == sets.cend()) { break; } result.push_back(order.at(i).v); } - if (result.size() != cStickerSetsOrder().size() || result.size() != order.size()) { - cSetLastStickersUpdate(0); + if (result.size() != Global::StickerSetsOrder().size() || result.size() != order.size()) { + Global::SetLastStickersUpdate(0); App::main()->updateStickers(); } else { - cSetStickerSetsOrder(result); + Global::SetStickerSetsOrder(result); Local::writeStickers(); emit stickersUpdated(); } } break; case mtpc_updateStickerSets: { - cSetLastStickersUpdate(0); + Global::SetLastStickersUpdate(0); App::main()->updateStickers(); } break; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 58561a208..88ee43f4f 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -444,9 +444,9 @@ public: void notify_userIsContactChanged(UserData *user, bool fromThisApp); void notify_migrateUpdated(PeerData *peer); void notify_clipStopperHidden(ClipStopperType type); - void notify_historyItemResized(const HistoryItem *row, bool scrollToIt); void notify_historyItemLayoutChanged(const HistoryItem *item); void notify_automaticLoadSettingsChangedGif(); + void notify_handlePendingHistoryUpdate(); void cmd_search(); void cmd_next_chat(); @@ -520,6 +520,7 @@ public slots: void onDownloadPathSettings(); void ui_showPeerHistoryAsync(quint64 peerId, qint32 showAtMsgId); + void ui_autoplayMediaInlineAsync(qint32 channelId, qint32 msgId); private: diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index de413ceae..a802e721d 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -21,6 +21,28 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org import glob import re +# define some checked flag convertions +# the key flag type should be a subset of the value flag type +# with exact the same names, then the key flag can be implicitly +# casted to the value flag type +parentFlags = {}; +parentFlagsList = []; +def addChildParentFlags(child, parent): + parentFlagsList.append(child); + parentFlags[child] = parent; +addChildParentFlags('MTPDmessageService', 'MTPDmessage'); +addChildParentFlags('MTPDupdateShortMessage', 'MTPDmessage'); +addChildParentFlags('MTPDupdateShortChatMessage', 'MTPDmessage'); +addChildParentFlags('MTPDupdateShortSentMessage', 'MTPDmessage'); +addChildParentFlags('MTPDreplyKeyboardHide', 'MTPDreplyKeyboardMarkup'); +addChildParentFlags('MTPDreplyKeyboardForceReply', 'MTPDreplyKeyboardMarkup'); +addChildParentFlags('MTPDinputPeerNotifySettings', 'MTPDpeerNotifySettings'); +addChildParentFlags('MTPDpeerNotifySettings', 'MTPDinputPeerNotifySettings'); + +# this is a map (key flags -> map (flag name -> flag bit)) +# each key flag of parentFlags should be a subset of the value flag here +parentFlagsCheck = {}; + funcs = 0 types = 0; consts = 0 @@ -35,6 +57,7 @@ boxed = {}; funcsText = ''; typesText = ''; dataTexts = ''; +creatorProxyText = ''; inlineMethods = ''; textSerializeInit = ''; textSerializeMethods = ''; @@ -150,7 +173,10 @@ with open('scheme.tl') as f: continue; elif (ptypewide == '#'): hasFlags = pname; - ptype = 'int'; + if funcsNow: + ptype = 'flags'; + else: + ptype = 'flags'; else: ptype = ptypewide; if (ptype.find('?') >= 0): @@ -195,6 +221,27 @@ with open('scheme.tl') as f: prmsStr = []; prmsInit = []; prmsNames = []; + if (len(conditions)): + funcsText += '\tenum class Flag : int32 {\n'; + maxbit = 0; + parentFlagsCheck['MTP' + name] = {}; + for paramName in conditionsList: + funcsText += '\t\tf_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n'; + parentFlagsCheck['MTP' + name][paramName] = conditions[paramName]; + maxbit = max(maxbit, int(conditions[paramName])); + if (maxbit > 0): + funcsText += '\n\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; + funcsText += '\t};\n'; + funcsText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n'; + funcsText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); }\n'; + funcsText += '\n'; + for paramName in conditionsList: + if (paramName in trivialConditions): + funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + else: + funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + funcsText += '\n'; + if (len(prms) > len(trivialConditions)): for paramName in prmsList: if (paramName in trivialConditions): @@ -207,7 +254,7 @@ with open('scheme.tl') as f: else: ptypeFull = 'MTP' + paramType; funcsText += '\t' + ptypeFull + ' v' + paramName + ';\n'; - if (paramType in ['int', 'Int', 'bool', 'Bool']): + if (paramType in ['int', 'Int', 'bool', 'Bool', 'flags']): prmsStr.append(ptypeFull + ' _' + paramName); else: prmsStr.append('const ' + ptypeFull + ' &_' + paramName); @@ -218,19 +265,6 @@ with open('scheme.tl') as f: if (len(prms) > len(trivialConditions)): funcsText += '\tMTP' + name + '(' + ', '.join(prmsStr) + ') : ' + ', '.join(prmsInit) + ' {\n\t}\n'; - if (len(conditions)): - funcsText += '\n'; - funcsText += '\tenum {\n'; - for paramName in conditionsList: - funcsText += '\t\tflag_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n'; - funcsText += '\t};\n'; - funcsText += '\n'; - for paramName in conditionsList: - if (paramName in trivialConditions): - funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n'; - else: - funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n'; - funcsText += '\n'; funcsText += '\tuint32 innerLength() const {\n'; # count size size = []; @@ -274,6 +308,8 @@ with open('scheme.tl') as f: funcsText += '\n\ttypedef MTP' + resType + ' ResponseType;\n'; # method return type funcsText += '};\n'; # class ending + if (len(conditionsList)): + funcsText += 'Q_DECLARE_OPERATORS_FOR_FLAGS(MTP' + name + '::Flags)\n\n'; if (isTemplate != ''): funcsText += 'template \n'; funcsText += 'class MTP' + Name + ' : public MTPBoxed > {\n'; @@ -325,7 +361,9 @@ def addTextSerialize(lst, dct, dataLetter): conditions = data[6]; trivialConditions = data[7]; - result += 'void _serialize_' + name + '(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {\n'; + result += 'void _serialize_' + name + '(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n'; + if (len(conditions)): + result += '\tMTP' + dataLetter + name + '::Flags flag(iflag);\n\n'; if (len(prms)): result += '\tif (stage) {\n'; result += '\t\tto.add(",\\n").addSpaces(lev);\n'; @@ -341,12 +379,12 @@ def addTextSerialize(lst, dct, dataLetter): if (k == hasFlags): result += 'if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; '; if (k in trivialConditions): - result += 'if (flag & MTP' + dataLetter + name + '::flag_' + k + ') { '; + result += 'if (flag & MTP' + dataLetter + name + '::Flag::f_' + k + ') { '; result += 'to.add("YES [ BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); '; result += '} else { to.add("[ SKIPPED BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); } '; else: if (k in conditions): - result += 'if (flag & MTP' + dataLetter + name + '::flag_' + k + ') { '; + result += 'if (flag & MTP' + dataLetter + name + '::Flag::f_' + k + ') { '; result += 'types.push_back('; vtypeget = re.match(r'^[Vv]ector', v); if (vtypeget): @@ -383,7 +421,10 @@ def addTextSerialize(lst, dct, dataLetter): except KeyError: if (vtypeget): result += '); vtypes.push_back('; - result += 'mtpc_' + restype; + if (re.match(r'^flags<', restype)): + result += 'mtpc_flags'; + else: + result += 'mtpc_' + restype + '+0'; if (not vtypeget): result += '); vtypes.push_back(0'; else: @@ -455,6 +496,28 @@ for restype in typesList: creatorParamsList = []; readText = ''; writeText = ''; + + if (len(conditions)): + dataText += '\tenum class Flag : int32 {\n'; + maxbit = 0; + parentFlagsCheck['MTPD' + name] = {}; + for paramName in conditionsList: + dataText += '\t\tf_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n'; + parentFlagsCheck['MTPD' + name][paramName] = conditions[paramName]; + maxbit = max(maxbit, int(conditions[paramName])); + if (maxbit > 0): + dataText += '\n\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n'; + dataText += '\t};\n'; + dataText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n'; + dataText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); }\n'; + dataText += '\n'; + for paramName in conditionsList: + if (paramName in trivialConditions): + dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + else: + dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n'; + dataText += '\n'; + dataText += '\tMTPD' + name + '() {\n\t}\n'; # default constructor switchLines += '\t\tcase mtpc_' + name + ': '; # for by-type-id type constructor if (len(prms) > len(trivialConditions)): @@ -530,33 +593,25 @@ for restype in typesList: sizeFast = '\treturn 0;\n'; switchLines += 'break;\n'; - - if (len(conditions)): - dataText += '\n'; - dataText += '\tenum {\n'; - for paramName in conditionsList: - dataText += '\t\tflag_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n'; - dataText += '\t};\n'; - dataText += '\n'; - for paramName in conditionsList: - if (paramName in trivialConditions): - dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n'; - else: - dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n'; dataText += '};\n'; # class ending if (len(prms) > len(trivialConditions)): dataTexts += dataText; # add data class - friendDecl += '\tfriend MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ');\n'; - creatorsText += 'inline MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ') {\n'; + friendDecl += '\tfriend class MTP::internal::TypeCreator;\n'; + creatorProxyText += '\t\tinline static MTP' + restype + ' new_' + name + '(' + ', '.join(creatorParams) + ') {\n'; if (len(prms) > len(trivialConditions)): # creator with params - creatorsText += '\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n'; + creatorProxyText += '\t\t\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n'; else: if (withType): # creator by type - creatorsText += '\treturn MTP' + restype + '(mtpc_' + name + ');\n'; + creatorProxyText += '\t\t\treturn MTP' + restype + '(mtpc_' + name + ');\n'; else: # single creator - creatorsText += '\treturn MTP' + restype + '();\n'; + creatorProxyText += '\t\t\treturn MTP' + restype + '();\n'; + creatorProxyText += '\t\t}\n'; + if (len(conditionsList)): + creatorsText += 'Q_DECLARE_OPERATORS_FOR_FLAGS(MTPD' + name + '::Flags)\n'; + creatorsText += 'inline MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ') {\n'; + creatorsText += '\treturn MTP::internal::TypeCreator::new_' + name + '(' + ', '.join(creatorParamsList) + ');\n'; creatorsText += '}\n'; if (withType): @@ -705,8 +760,19 @@ for restype in typesList: inlineMethods += creatorsText; typesText += 'typedef MTPBoxed MTP' + resType + ';\n'; # boxed type definition +for childName in parentFlagsList: + parentName = parentFlags[childName]; + for flag in parentFlagsCheck[childName]: + if (not flag in parentFlagsCheck[parentName]): + print('Flag ' + flag + ' not found in ' + parentName + ' which should be a flags-parent of ' + childName); + error + elif (parentFlagsCheck[childName][flag] != parentFlagsCheck[parentName][flag]): + print('Flag ' + flag + ' has different value in ' + parentName + ' which should be a flags-parent of ' + childName); + error + inlineMethods += 'inline ' + parentName + '::Flags mtpCastFlags(' + childName + '::Flags flags) { return ' + parentName + '::Flags(QFlag(flags)); }\n'; + # manual types added here -textSerializeMethods += 'void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {\n'; +textSerializeMethods += 'void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n'; textSerializeMethods += '\tif (stage) {\n'; textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n'; textSerializeMethods += '\t} else {\n'; @@ -721,7 +787,7 @@ textSerializeMethods += '\t}\n'; textSerializeMethods += '}\n\n'; textSerializeInit += '\t\t_serializers.insert(mtpc_rpc_result, _serialize_rpc_result);\n'; -textSerializeMethods += 'void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {\n'; +textSerializeMethods += 'void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n'; textSerializeMethods += '\tif (stage) {\n'; textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n'; textSerializeMethods += '\t} else {\n'; @@ -735,7 +801,7 @@ textSerializeMethods += '\t}\n'; textSerializeMethods += '}\n\n'; textSerializeInit += '\t\t_serializers.insert(mtpc_msg_container, _serialize_msg_container);\n'; -textSerializeMethods += 'void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {\n'; +textSerializeMethods += 'void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n'; textSerializeMethods += '\tif (stage) {\n'; textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n'; textSerializeMethods += '\t} else {\n'; @@ -786,12 +852,14 @@ textSerializeFull += '\t\t}\n'; textSerializeFull += '\t}\n'; textSerializeFull += '}\n'; +out.write('\n// Creator proxy class declaration\nnamespace MTP {\nnamespace internal {\n\tclass TypeCreator;\n}\n}\n'); out.write('\n// Type id constants\nenum {\n' + ',\n'.join(enums) + '\n};\n'); out.write('\n// Type forward declarations\n' + forwards); out.write('\n// Boxed types definitions\n' + forwTypedefs); out.write('\n// Type classes definitions\n' + typesText); out.write('\n// Type constructors with data\n' + dataTexts); out.write('\n// RPC methods\n' + funcsText); +out.write('\n// Creator proxy class definition\nnamespace MTP {\nnamespace internal {\n\tclass TypeCreator {\n\tpublic:\n' + creatorProxyText + '\t};\n}\n}\n'); out.write('\n// Inline methods definition\n' + inlineMethods); out.write('\n// Human-readable text serialization\nvoid mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons);\n'); @@ -819,7 +887,7 @@ outCpp.write('#include "stdafx.h"\n#include "mtpScheme.h"\n\n'); outCpp.write('typedef QVector Types;\ntypedef QVector StagesFlags;\n\n'); outCpp.write(textSerializeMethods); outCpp.write('namespace {\n'); -outCpp.write('\ttypedef void(*mtpTextSerializer)(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag);\n'); +outCpp.write('\ttypedef void(*mtpTextSerializer)(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag);\n'); outCpp.write('\ttypedef QMap TextSerializers;\n\tTextSerializers _serializers;\n\n'); outCpp.write('\tvoid initTextSerializers() {\n'); outCpp.write(textSerializeInit); diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index 689665b81..b3cd87f1a 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -158,6 +158,17 @@ namespace MTP { QReadWriteLock *dcOptionsMutex(); + struct DcOption { + DcOption(int id, MTPDdcOption::Flags flags, const string &ip, int port) : id(id), flags(flags), ip(ip), port(port) { + } + + int id; + MTPDdcOption::Flags flags; + string ip; + int port; + }; + typedef QMap DcOptions; + }; #include "mtproto/mtpSessionImpl.h" diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 470bc0db3..e74184483 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -660,7 +660,7 @@ MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection void MTPautoConnection::onHttpStart() { if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -671,7 +671,7 @@ void MTPautoConnection::onSocketConnected() { if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { mtpBuffer buffer(_preparePQFake(tcpNonce)); - DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flagsTcp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flagsTcp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout; tcpTimeoutTimer.start(_tcpTimeout); @@ -709,7 +709,7 @@ void MTPautoConnection::onSocketDisconnected() { } else if (status == WaitingTcp || status == UsingTcp) { emit disconnected(); } else if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by socket disconnect").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by socket disconnect").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; emit connected(); } @@ -801,7 +801,7 @@ void MTPautoConnection::disconnectFromServer() { httpStartTimer.stop(); } -void MTPautoConnection::connectTcp(const QString &addr, int32 port, int32 flags) { +void MTPautoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { _addrTcp = addr; _portTcp = port; _flagsTcp = flags; @@ -810,8 +810,8 @@ void MTPautoConnection::connectTcp(const QString &addr, int32 port, int32 flags) sock.connectToHost(QHostAddress(_addrTcp), _portTcp); } -void MTPautoConnection::connectHttp(const QString &addr, int32 port, int32 flags) { - address = QUrl(((flags & MTPDdcOption::flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport +void MTPautoConnection::connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { + address = QUrl(((flags & MTPDdcOption::Flag::f_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString())); connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); @@ -821,7 +821,7 @@ void MTPautoConnection::connectHttp(const QString &addr, int32 port, int32 flags mtpBuffer buffer(_preparePQFake(httpNonce)); - DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); httpSend(buffer); } @@ -857,7 +857,7 @@ void MTPautoConnection::requestFinished(QNetworkReply *reply) { status = HttpReady; httpStartTimer.start(MTPTcpConnectionWaitTimeout); } else { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by pq-response, awaited").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by pq-response, awaited").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -900,7 +900,7 @@ void MTPautoConnection::socketPacket(const char *packet, uint32 length) { status = WaitingHttp; sock.disconnectFromHost(); } else if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, ready").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, ready").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -919,7 +919,7 @@ void MTPautoConnection::socketPacket(const char *packet, uint32 length) { MTPResPQ res_pq = _readPQFakeReply(data); const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); if (res_pq_data.vnonce == tcpNonce) { - DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flagsTcp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flagsTcp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingTcp; emit connected(); } @@ -929,7 +929,7 @@ void MTPautoConnection::socketPacket(const char *packet, uint32 length) { status = WaitingHttp; sock.disconnectFromHost(); } else if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, awaited").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, awaited").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -969,7 +969,7 @@ void MTPautoConnection::socketError(QAbstractSocket::SocketError e) { if (status == WaitingBoth) { status = WaitingHttp; } else if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by tcp error, ready").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by tcp error, ready").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; emit connected(); } else if (status == WaitingTcp || status == UsingTcp) { @@ -998,7 +998,7 @@ void MTPtcpConnection::onSocketConnected() { if (status == WaitingTcp) { mtpBuffer buffer(_preparePQFake(tcpNonce)); - DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout; tcpTimeoutTimer.start(_tcpTimeout); @@ -1083,7 +1083,7 @@ void MTPtcpConnection::disconnectFromServer() { sock.close(); } -void MTPtcpConnection::connectTcp(const QString &addr, int32 port, int32 flags) { +void MTPtcpConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { _addr = addr; _port = port; _flags = flags; @@ -1108,7 +1108,7 @@ void MTPtcpConnection::socketPacket(const char *packet, uint32 length) { MTPResPQ res_pq = _readPQFakeReply(data); const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); if (res_pq_data.vnonce == tcpNonce) { - DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingTcp; emit connected(); } @@ -1180,8 +1180,8 @@ void MTPhttpConnection::disconnectFromServer() { address = QUrl(); } -void MTPhttpConnection::connectHttp(const QString &addr, int32 p, int32 flags) { - address = QUrl(((flags & MTPDdcOption::flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport +void MTPhttpConnection::connectHttp(const QString &addr, int32 p, MTPDdcOption::Flags flags) { + address = QUrl(((flags & MTPDdcOption::Flag::f_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString())); connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); @@ -1189,7 +1189,7 @@ void MTPhttpConnection::connectHttp(const QString &addr, int32 p, int32 flags) { mtpBuffer buffer(_preparePQFake(httpNonce)); - DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); sendData(buffer); } @@ -1217,7 +1217,7 @@ void MTPhttpConnection::requestFinished(QNetworkReply *reply) { MTPResPQ res_pq = _readPQFakeReply(data); const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); if (res_pq_data.vnonce == httpNonce) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport connected by pq-response").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport connected by pq-response").arg((_flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; emit connected(); } @@ -1354,7 +1354,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne if (!dc) { QReadLocker lock(mtpDcOptionsMutex()); - const mtpDcOptions &options(cDcOptions()); + const MTP::DcOptions &options(Global::DcOptions()); if (options.isEmpty()) { LOG(("MTP Error: connect failed, no DCs")); dc = 0; @@ -1994,36 +1994,36 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { static const int IPv4address = 0, IPv6address = 1; static const int TcpProtocol = 0, HttpProtocol = 1; - int32 flags[2][2] = { { 0 } }; + MTPDdcOption::Flags flags[2][2] = { { 0 } }; string ip[2][2]; uint32 port[2][2] = { { 0 } }; { QReadLocker lock(mtpDcOptionsMutex()); - const mtpDcOptions &options(cDcOptions()); + const MTP::DcOptions &options(Global::DcOptions()); int32 shifts[2][2][4] = { { // IPv4 { // TCP IPv4 - isDldDc ? (MTPDdcOption::flag_media_only | MTPDdcOption::flag_tcpo_only) : -1, - MTPDdcOption::flag_tcpo_only, - isDldDc ? (MTPDdcOption::flag_media_only) : -1, + isDldDc ? (MTPDdcOption::Flag::f_media_only | MTPDdcOption::Flag::f_tcpo_only) : -1, + qFlags(MTPDdcOption::Flag::f_tcpo_only), + isDldDc ? qFlags(MTPDdcOption::Flag::f_media_only) : -1, 0 }, { // HTTP IPv4 -1, -1, - isDldDc ? (MTPDdcOption::flag_media_only) : -1, + isDldDc ? qFlags(MTPDdcOption::Flag::f_media_only) : -1, 0 }, }, { // IPv6 { // TCP IPv6 - isDldDc ? (MTPDdcOption::flag_media_only | MTPDdcOption::flag_tcpo_only | MTPDdcOption::flag_ipv6) : -1, - MTPDdcOption::flag_tcpo_only | MTPDdcOption::flag_ipv6, - isDldDc ? (MTPDdcOption::flag_media_only | MTPDdcOption::flag_ipv6) : -1, - MTPDdcOption::flag_ipv6 + isDldDc ? (MTPDdcOption::Flag::f_media_only | MTPDdcOption::Flag::f_tcpo_only | MTPDdcOption::Flag::f_ipv6) : -1, + MTPDdcOption::Flag::f_tcpo_only | MTPDdcOption::Flag::f_ipv6, + isDldDc ? (MTPDdcOption::Flag::f_media_only | MTPDdcOption::Flag::f_ipv6) : -1, + qFlags(MTPDdcOption::Flag::f_ipv6) }, { // HTTP IPv6 -1, -1, - isDldDc ? (MTPDdcOption::flag_media_only | MTPDdcOption::flag_ipv6) : -1, - MTPDdcOption::flag_ipv6 + isDldDc ? (MTPDdcOption::Flag::f_media_only | MTPDdcOption::Flag::f_ipv6) : -1, + qFlags(MTPDdcOption::Flag::f_ipv6) }, }, }; @@ -2033,7 +2033,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { int32 mask = shifts[address][protocol][shift]; if (mask < 0) continue; - mtpDcOptions::const_iterator index = options.constFind(baseDc + _mtp_internal::dcShift * mask); + auto index = options.constFind(baseDc + _mtp_internal::dcShift * mask); if (index != options.cend()) { ip[address][protocol] = index->ip; flags[address][protocol] = index->flags; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 8ac08b94b..d0513848b 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -115,8 +115,8 @@ public: virtual void sendData(mtpBuffer &buffer) = 0; // has size + 3, buffer[0] = len, buffer[1] = packetnum, buffer[last] = crc32 virtual void disconnectFromServer() = 0; - virtual void connectTcp(const QString &addr, int32 port, int32 flags) = 0; - virtual void connectHttp(const QString &addr, int32 port, int32 flags) = 0; + virtual void connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) = 0; + virtual void connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) = 0; virtual bool isConnected() const = 0; virtual bool usingHttpWait() { return false; @@ -182,17 +182,17 @@ public: MTPautoConnection(QThread *thread); - void sendData(mtpBuffer &buffer); - void disconnectFromServer(); - void connectTcp(const QString &addr, int32 port, int32 flags); - void connectHttp(const QString &addr, int32 port, int32 flags); - bool isConnected() const; - bool usingHttpWait(); - bool needHttpWait(); + void sendData(mtpBuffer &buffer) override; + void disconnectFromServer() override; + void connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override; + void connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override; + bool isConnected() const override; + bool usingHttpWait() override; + bool needHttpWait() override; - int32 debugState() const; + int32 debugState() const override; - QString transport() const; + QString transport() const override; public slots: @@ -233,7 +233,8 @@ private: Requests requests; QString _addrTcp, _addrHttp; - int32 _portTcp, _portHttp, _flagsTcp, _flagsHttp; + int32 _portTcp, _portHttp; + MTPDdcOption::Flags _flagsTcp, _flagsHttp; int32 _tcpTimeout; QTimer tcpTimeoutTimer; @@ -246,16 +247,16 @@ public: MTPtcpConnection(QThread *thread); - void sendData(mtpBuffer &buffer); - void disconnectFromServer(); - void connectTcp(const QString &addr, int32 port, int32 flags); - void connectHttp(const QString &addr, int32 port, int32 flags) { // not supported + void sendData(mtpBuffer &buffer) override; + void disconnectFromServer() override; + void connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override; + void connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override { // not supported } - bool isConnected() const; + bool isConnected() const override; - int32 debugState() const; + int32 debugState() const override; - QString transport() const; + QString transport() const override; public slots: @@ -281,7 +282,8 @@ private: MTPint128 tcpNonce; QString _addr; - int32 _port, _tcpTimeout, _flags; + int32 _port, _tcpTimeout; + MTPDdcOption::Flags _flags; QTimer tcpTimeoutTimer; }; @@ -293,18 +295,18 @@ public: MTPhttpConnection(QThread *thread); - void sendData(mtpBuffer &buffer); - void disconnectFromServer(); - void connectTcp(const QString &addr, int32 port, int32 flags) { // not supported + void sendData(mtpBuffer &buffer) override; + void disconnectFromServer() override; + void connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override { // not supported } - void connectHttp(const QString &addr, int32 port, int32 flags); - bool isConnected() const; - bool usingHttpWait(); - bool needHttpWait(); + void connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) override; + bool isConnected() const override; + bool usingHttpWait() override; + bool needHttpWait() override; - int32 debugState() const; + int32 debugState() const override; - QString transport() const; + QString transport() const override; public slots: @@ -319,7 +321,7 @@ private: }; Status status; MTPint128 httpNonce; - int32 _flags; + MTPDdcOption::Flags _flags; QNetworkAccessManager manager; QUrl address; diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp index 48bd7fd52..38b810a2a 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp @@ -149,13 +149,13 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP } } -const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector(0)); +const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_flags(MTPDreplyKeyboardMarkup::Flags(0)), MTP_vector(0)); const MTPVector MTPnullEntities = MTP_vector(0); -const MTPMessageFwdHeader MTPnullFwdHeader = MTP_messageFwdHeader(MTPint(), MTPint(), MTPint(), MTPint(), MTPint()); +const MTPMessageFwdHeader MTPnullFwdHeader = MTP_messageFwdHeader(MTP_flags(MTPDmessageFwdHeader::Flags(0)), MTPint(), MTPint(), MTPint(), MTPint()); QString stickerSetTitle(const MTPDstickerSet &s) { QString title = qs(s.vtitle); - if ((s.vflags.v & MTPDstickerSet::flag_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) { + if ((s.vflags.v & MTPDstickerSet::Flag::f_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) { return lang(lng_stickers_default_set); } return title; diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 3e2647d17..05c26b8e3 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -346,6 +346,7 @@ enum { mtpc_gzip_packed = 0x3072cfa1 }; static const mtpTypeId mtpc_bytes = mtpc_string; +static const mtpTypeId mtpc_flags = mtpc_int; static const mtpTypeId mtpc_core_message = -1; // undefined type, but is used static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer1), @@ -446,6 +447,49 @@ inline MTPint MTP_int(int32 v) { } typedef MTPBoxed MTPInt; +template +class MTPflags { +public: + Flags v; + static_assert(sizeof(Flags) == sizeof(int32), "MTPflags are allowed only wrapping int32 flag types!"); + + MTPflags() { + } + MTPflags(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_flags) { + read(from, end, cons); + } + + uint32 innerLength() const { + return sizeof(Flags); + } + mtpTypeId type() const { + return mtpc_flags; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_flags) { + if (from + 1 > end) throw mtpErrorInsufficient(); + if (cons != mtpc_flags) throw mtpErrorUnexpected(cons, "MTPflags"); + v = static_cast(*(from++)); + } + void write(mtpBuffer &to) const { + to.push_back(static_cast(v)); + } + +private: + explicit MTPflags(Flags val) : v(val) { + } + + template + friend MTPflags MTP_flags(T v); +}; + +template +inline MTPflags MTP_flags(T v) { + return MTPflags(v); +} + +template +using MTPFlags = MTPBoxed>; + inline bool operator==(const MTPint &a, const MTPint &b) { return a.v == b.v; } @@ -871,19 +915,7 @@ inline MTPvector MTP_vector(const QVector &v) { return MTPvector(new MTPDvector(v)); } template -class MTPVector : public MTPBoxed > { -public: - MTPVector() { - } - MTPVector(uint32 count) : MTPBoxed >(MTP_vector(count)) { - } - MTPVector(uint32 count, const T &value) : MTPBoxed >(MTP_vector(count, value)) { - } - MTPVector(const MTPvector &v) : MTPBoxed >(v) { - } - MTPVector(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed >(from, end, cons) { - } -}; +using MTPVector = MTPBoxed>; template inline bool operator==(const MTPvector &a, const MTPvector &b) { @@ -977,13 +1009,71 @@ inline bool mtpIsFalse(const MTPBool &v) { return !mtpIsTrue(v); } -enum { // client side flags - MTPDmessage_flag_HAS_TEXT_LINKS = (1 << 31), // message has links for "shared links" indexing - MTPDmessage_flag_IS_GROUP_MIGRATE = (1 << 30), // message is a group migrate (group -> supergroup) service message - MTPDreplyKeyboardMarkup_flag_FORCE_REPLY = (1 << 30), // markup just wants a text reply - MTPDreplyKeyboardMarkup_flag_ZERO = (1 << 31), // none (zero) markup - MTPDstickerSet_flag_NOT_LOADED = (1 << 31), // sticker set is not yet loaded +#define CHECK_MTP_SCHEME_AND_CLIENT_FLAGS_CONFLICT(Type) \ + +// we must validate that MTProto scheme flags don't intersect with client side flags +// and define common bit operators which allow use Type_ClientFlag together with Type::Flag +#define DEFINE_MTP_CLIENT_FLAGS(Type) \ +static_assert(static_cast(Type::Flag::MAX_FIELD) < static_cast(Type##_ClientFlag::MIN_FIELD), \ + "MTProto flags conflict with client side flags!"); \ +inline Type::Flags qFlags(Type##_ClientFlag v) { return Type::Flags(static_cast(v)); } \ +inline Type::Flags operator&(Type::Flags i, Type##_ClientFlag v) { return i & qFlags(v); } \ +inline Type::Flags operator&(Type::Flag i, Type##_ClientFlag v) { return qFlags(i) & v; } \ +inline Type::Flags operator&(Type##_ClientFlag i, Type##_ClientFlag v) { return qFlags(i) & v; } \ +inline Type::Flags operator&(Type##_ClientFlag i, Type::Flag v) { return qFlags(i) & v; } \ +inline Type::Flags &operator&=(Type::Flags &i, Type##_ClientFlag v) { return i &= qFlags(v); } \ +inline Type::Flags operator|(Type::Flags i, Type##_ClientFlag v) { return i | qFlags(v); } \ +inline Type::Flags operator|(Type::Flag i, Type##_ClientFlag v) { return qFlags(i) | v; } \ +inline Type::Flags operator|(Type##_ClientFlag i, Type##_ClientFlag v) { return qFlags(i) | v; } \ +inline Type::Flags operator|(Type##_ClientFlag i, Type::Flag v) { return qFlags(i) | v; } \ +inline Type::Flags &operator|=(Type::Flags &i, Type##_ClientFlag v) { return i |= qFlags(v); } \ +inline Type::Flags operator~(Type##_ClientFlag v) { return ~qFlags(v); } + +// we use the same flags field for some additional client side flags +enum class MTPDmessage_ClientFlag : int32 { + // message has links for "shared links" indexing + f_has_text_links = (1 << 30), + + // message is a group migrate (group -> supergroup) service message + f_is_group_migrate = (1 << 29), + + // message needs initDimensions() + resize() + paint() + f_pending_init_dimensions = (1 << 28), + + // message needs resize() + paint() + f_pending_resize = (1 << 27), + + // message needs paint() + f_pending_paint = (1 << 26), + + // update this when adding new client side flags + MIN_FIELD = (1 << 26), }; +DEFINE_MTP_CLIENT_FLAGS(MTPDmessage) + +enum class MTPDreplyKeyboardMarkup_ClientFlag : int32 { + // none (zero) markup + f_zero = (1 << 30), + + // markup just wants a text reply + f_force_reply = (1 << 29), + + // update this when adding new client side flags + MIN_FIELD = (1 << 29), +}; +DEFINE_MTP_CLIENT_FLAGS(MTPDreplyKeyboardMarkup) + +enum class MTPDstickerSet_ClientFlag : int32 { + // old value for sticker set is not yet loaded flag + f_not_loaded__old = (1 << 31), + + // sticker set is not yet loaded + f_not_loaded = (1 << 30), + + // update this when adding new client side flags + MIN_FIELD = (1 << 30), +}; +DEFINE_MTP_CLIENT_FLAGS(MTPDstickerSet) extern const MTPReplyMarkup MTPnullMarkup; extern const MTPVector MTPnullEntities; diff --git a/Telegram/SourceFiles/mtproto/mtpDC.cpp b/Telegram/SourceFiles/mtproto/mtpDC.cpp index 0cb0c3bff..854894f70 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.cpp +++ b/Telegram/SourceFiles/mtproto/mtpDC.cpp @@ -185,28 +185,28 @@ namespace { void mtpUpdateDcOptions(const QVector &options) { QSet already, restart; { - mtpDcOptions opts; + MTP::DcOptions opts; { QReadLocker lock(mtpDcOptionsMutex()); - opts = cDcOptions(); + opts = Global::DcOptions(); } for (QVector::const_iterator i = options.cbegin(), e = options.cend(); i != e; ++i) { const MTPDdcOption &optData(i->c_dcOption()); int32 id = optData.vid.v, idWithShift = id + (optData.vflags.v * _mtp_internal::dcShift); if (already.constFind(idWithShift) == already.cend()) { already.insert(idWithShift); - mtpDcOptions::const_iterator a = opts.constFind(idWithShift); + auto a = opts.constFind(idWithShift); if (a != opts.cend()) { if (a.value().ip != optData.vip_address.c_string().v || a.value().port != optData.vport.v) { restart.insert(id); } } - opts.insert(idWithShift, mtpDcOption(id, optData.vflags.v, optData.vip_address.c_string().v, optData.vport.v)); + opts.insert(idWithShift, MTP::DcOption(id, optData.vflags.v, optData.vip_address.c_string().v, optData.vport.v)); } } { QWriteLocker lock(mtpDcOptionsMutex()); - cSetDcOptions(opts); + Global::SetDcOptions(opts); } } for (QSet::const_iterator i = restart.cbegin(), e = restart.cend(); i != e; ++i) { @@ -261,8 +261,8 @@ void MTProtoConfigLoader::enumDC() { OrderedSet dcs; { QReadLocker lock(mtpDcOptionsMutex()); - const mtpDcOptions &options(cDcOptions()); - for (mtpDcOptions::const_iterator i = options.cbegin(), e = options.cend(); i != e; ++i) { + const MTP::DcOptions &options(Global::DcOptions()); + for (auto i = options.cbegin(), e = options.cend(); i != e; ++i) { dcs.insert(i.key() % _mtp_internal::dcShift); } } diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 2efc246a1..14c165cd8 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org typedef QVector Types; typedef QVector StagesFlags; -void _serialize_resPQ(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_resPQ(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -33,15 +33,15 @@ void _serialize_resPQ(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pq: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" server_public_key_fingerprints: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pq: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" server_public_key_fingerprints: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_p_q_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_p_q_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -49,17 +49,17 @@ void _serialize_p_q_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pq: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" p: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" new_nonce: "); ++stages.back(); types.push_back(mtpc_int256); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pq: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" p: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" new_nonce: "); ++stages.back(); types.push_back(mtpc_int256+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_server_DH_params_fail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_server_DH_params_fail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -67,14 +67,14 @@ void _serialize_server_DH_params_fail(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" new_nonce_hash: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" new_nonce_hash: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_server_DH_params_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_server_DH_params_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -82,14 +82,14 @@ void _serialize_server_DH_params_ok(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" encrypted_answer: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" encrypted_answer: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_server_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_server_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -97,17 +97,17 @@ void _serialize_server_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" g: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" dh_prime: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" server_time: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" g: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" dh_prime: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" server_time: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_client_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_client_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -115,15 +115,15 @@ void _serialize_client_DH_inner_data(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" retry_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" g_b: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" retry_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" g_b: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_dh_gen_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dh_gen_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -131,14 +131,14 @@ void _serialize_dh_gen_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" new_nonce_hash1: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" new_nonce_hash1: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_dh_gen_retry(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dh_gen_retry(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -146,14 +146,14 @@ void _serialize_dh_gen_retry(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" new_nonce_hash2: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" new_nonce_hash2: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_dh_gen_fail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dh_gen_fail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -161,14 +161,14 @@ void _serialize_dh_gen_fail(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" new_nonce_hash3: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" new_nonce_hash3: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msgs_ack(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msgs_ack(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -176,12 +176,12 @@ void _serialize_msgs_ack(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_bad_msg_notification(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_bad_msg_notification(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -189,14 +189,14 @@ void _serialize_bad_msg_notification(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" bad_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" bad_msg_seqno: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" bad_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" bad_msg_seqno: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_bad_server_salt(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_bad_server_salt(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -204,15 +204,15 @@ void _serialize_bad_server_salt(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" bad_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" bad_msg_seqno: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" new_server_salt: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" bad_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" bad_msg_seqno: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" new_server_salt: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msgs_state_req(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msgs_state_req(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -220,12 +220,12 @@ void _serialize_msgs_state_req(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msgs_state_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msgs_state_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -233,13 +233,13 @@ void _serialize_msgs_state_info(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" info: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" info: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msgs_all_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msgs_all_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -247,13 +247,13 @@ void _serialize_msgs_all_info(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" info: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" info: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msg_detailed_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msg_detailed_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -261,15 +261,15 @@ void _serialize_msg_detailed_info(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" answer_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" status: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" answer_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" status: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msg_new_detailed_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msg_new_detailed_info(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -277,14 +277,14 @@ void _serialize_msg_new_detailed_info(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" answer_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" status: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" answer_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" status: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_msg_resend_req(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msg_resend_req(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -292,12 +292,12 @@ void _serialize_msg_resend_req(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_rpc_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -305,21 +305,21 @@ void _serialize_rpc_error(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" error_message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" error_code: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" error_message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_rpc_answer_unknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_answer_unknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ rpc_answer_unknown }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_rpc_answer_dropped_running(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_answer_dropped_running(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ rpc_answer_dropped_running }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_rpc_answer_dropped(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_answer_dropped(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -327,14 +327,14 @@ void _serialize_rpc_answer_dropped(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" seq_no: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" seq_no: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_future_salt(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_future_salt(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -342,14 +342,14 @@ void _serialize_future_salt(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" valid_since: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" valid_until: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" salt: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" valid_since: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" valid_until: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" salt: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -357,14 +357,14 @@ void _serialize_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" now: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" now: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" salts: "); ++stages.back(); types.push_back(mtpc_vector); vtypes.push_back(mtpc_future_salt); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_pong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_pong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -372,13 +372,13 @@ void _serialize_pong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_destroy_session_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_destroy_session_ok(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -386,12 +386,12 @@ void _serialize_destroy_session_ok(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_destroy_session_none(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_destroy_session_none(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -399,12 +399,12 @@ void _serialize_destroy_session_none(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_new_session_created(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_new_session_created(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -412,14 +412,14 @@ void _serialize_new_session_created(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" first_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unique_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" server_salt: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" first_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unique_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" server_salt: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_http_wait(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_http_wait(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -427,26 +427,26 @@ void _serialize_http_wait(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" max_delay: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" wait_after: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" max_wait: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" max_delay: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" wait_after: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" max_wait: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_boolFalse(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_boolFalse(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ boolFalse }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_boolTrue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_boolTrue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ boolTrue }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_true(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_true(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ true }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -454,25 +454,25 @@ void _serialize_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" code: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" code: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_null(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_null(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ null }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPeerEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPeerSelf }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -480,12 +480,12 @@ void _serialize_inputPeerChat(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputPeerUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -493,13 +493,13 @@ void _serialize_inputPeerUser(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputPeerChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -507,21 +507,21 @@ void _serialize_inputPeerChannel(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputUserEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputUserEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputUserEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputUserSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputUserSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputUserSelf }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -529,13 +529,13 @@ void _serialize_inputUser(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputPhoneContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPhoneContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -543,15 +543,15 @@ void _serialize_inputPhoneContact(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" client_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" client_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -559,15 +559,15 @@ void _serialize_inputFile(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" md5_checksum: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" md5_checksum: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputFileBig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputFileBig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -575,18 +575,18 @@ void _serialize_inputFileBig(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMediaEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMediaUploadedPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaUploadedPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -595,12 +595,12 @@ void _serialize_inputMediaUploadedPhoto(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -609,12 +609,12 @@ void _serialize_inputMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, Typ } switch (stage) { case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -627,7 +627,7 @@ void _serialize_inputMediaGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_inputMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -635,14 +635,14 @@ void _serialize_inputMediaContact(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaUploadedDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaUploadedDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -651,14 +651,14 @@ void _serialize_inputMediaUploadedDocument(MTPStringLogger &to, int32 stage, int } switch (stage) { case 0: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" attributes: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaUploadedThumbDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaUploadedThumbDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -668,14 +668,14 @@ void _serialize_inputMediaUploadedThumbDocument(MTPStringLogger &to, int32 stage switch (stage) { case 0: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" thumb: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" attributes: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -684,12 +684,12 @@ void _serialize_inputMediaDocument(MTPStringLogger &to, int32 stage, int32 lev, } switch (stage) { case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -698,15 +698,15 @@ void _serialize_inputMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Typ } switch (stage) { case 0: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMediaGifExternal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMediaGifExternal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -714,17 +714,17 @@ void _serialize_inputMediaGifExternal(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputChatPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputChatPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputChatPhotoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputChatUploadedPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputChatUploadedPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -738,7 +738,7 @@ void _serialize_inputChatUploadedPhoto(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_inputChatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputChatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -752,11 +752,11 @@ void _serialize_inputChatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_inputGeoPointEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputGeoPointEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputGeoPointEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -764,17 +764,17 @@ void _serialize_inputGeoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" lat: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" long: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" lat: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" long: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPhotoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -782,13 +782,13 @@ void _serialize_inputPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &t to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -796,14 +796,14 @@ void _serialize_inputFileLocation(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputEncryptedFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -811,13 +811,13 @@ void _serialize_inputEncryptedFileLocation(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputDocumentFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputDocumentFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -825,17 +825,17 @@ void _serialize_inputDocumentFileLocation(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputPhotoCropAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPhotoCropAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPhotoCropAuto }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPhotoCrop(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPhotoCrop(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -843,14 +843,14 @@ void _serialize_inputPhotoCrop(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" crop_left: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" crop_top: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" crop_width: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" crop_left: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" crop_top: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" crop_width: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputAppEvent(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputAppEvent(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -858,15 +858,15 @@ void _serialize_inputAppEvent(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" time: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" peer: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" data: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" time: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" peer: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" data: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_peerUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -874,12 +874,12 @@ void _serialize_peerUser(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_peerChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -887,12 +887,12 @@ void _serialize_peerChat(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_peerChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -900,52 +900,52 @@ void _serialize_peerChannel(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_storage_fileUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileUnknown }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileJpeg(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileJpeg(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileJpeg }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileGif }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_filePng(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_filePng(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_filePng }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_filePdf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_filePdf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_filePdf }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileMp3(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileMp3(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileMp3 }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileMov(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileMov(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileMov }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_filePartial(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_filePartial(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_filePartial }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileMp4(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileMp4(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileMp4 }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_storage_fileWebp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_storage_fileWebp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ storage_fileWebp }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_fileLocationUnavailable(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_fileLocationUnavailable(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -953,14 +953,14 @@ void _serialize_fileLocationUnavailable(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_fileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_fileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -968,15 +968,15 @@ void _serialize_fileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" volume_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" local_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" secret: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -984,12 +984,14 @@ void _serialize_userEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDuser::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -997,37 +999,37 @@ void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" self: "); ++stages.back(); if (flag & MTPDuser::flag_self) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; - case 2: to.add(" contact: "); ++stages.back(); if (flag & MTPDuser::flag_contact) { to.add("YES [ BY BIT 11 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; - case 3: to.add(" mutual_contact: "); ++stages.back(); if (flag & MTPDuser::flag_mutual_contact) { to.add("YES [ BY BIT 12 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; - case 4: to.add(" deleted: "); ++stages.back(); if (flag & MTPDuser::flag_deleted) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 5: to.add(" bot: "); ++stages.back(); if (flag & MTPDuser::flag_bot) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 6: to.add(" bot_chat_history: "); ++stages.back(); if (flag & MTPDuser::flag_bot_chat_history) { to.add("YES [ BY BIT 15 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break; - case 7: to.add(" bot_nochats: "); ++stages.back(); if (flag & MTPDuser::flag_bot_nochats) { to.add("YES [ BY BIT 16 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 16 IN FIELD flags ]"); } break; - case 8: to.add(" verified: "); ++stages.back(); if (flag & MTPDuser::flag_verified) { to.add("YES [ BY BIT 17 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 17 IN FIELD flags ]"); } break; - case 9: to.add(" restricted: "); ++stages.back(); if (flag & MTPDuser::flag_restricted) { to.add("YES [ BY BIT 18 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; - case 10: to.add(" min: "); ++stages.back(); if (flag & MTPDuser::flag_min) { to.add("YES [ BY BIT 20 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 20 IN FIELD flags ]"); } break; - case 11: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 13: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 14: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 15: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 16: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 17: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 18: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 19: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 20: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDuser::flag_restriction_reason) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; - case 21: to.add(" bot_inline_placeholder: "); ++stages.back(); if (flag & MTPDuser::flag_bot_inline_placeholder) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 19 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" self: "); ++stages.back(); if (flag & MTPDuser::Flag::f_self) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; + case 2: to.add(" contact: "); ++stages.back(); if (flag & MTPDuser::Flag::f_contact) { to.add("YES [ BY BIT 11 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; + case 3: to.add(" mutual_contact: "); ++stages.back(); if (flag & MTPDuser::Flag::f_mutual_contact) { to.add("YES [ BY BIT 12 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; + case 4: to.add(" deleted: "); ++stages.back(); if (flag & MTPDuser::Flag::f_deleted) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 5: to.add(" bot: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 6: to.add(" bot_chat_history: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_chat_history) { to.add("YES [ BY BIT 15 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break; + case 7: to.add(" bot_nochats: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_nochats) { to.add("YES [ BY BIT 16 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 16 IN FIELD flags ]"); } break; + case 8: to.add(" verified: "); ++stages.back(); if (flag & MTPDuser::Flag::f_verified) { to.add("YES [ BY BIT 17 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 17 IN FIELD flags ]"); } break; + case 9: to.add(" restricted: "); ++stages.back(); if (flag & MTPDuser::Flag::f_restricted) { to.add("YES [ BY BIT 18 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; + case 10: to.add(" min: "); ++stages.back(); if (flag & MTPDuser::Flag::f_min) { to.add("YES [ BY BIT 20 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 20 IN FIELD flags ]"); } break; + case 11: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::Flag::f_access_hash) { types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 13: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_first_name) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 14: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::Flag::f_last_name) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 15: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::Flag::f_username) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 16: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::Flag::f_phone) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 17: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::Flag::f_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 18: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::Flag::f_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 19: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_info_version) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 20: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDuser::Flag::f_restriction_reason) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 18 IN FIELD flags ]"); } break; + case 21: to.add(" bot_inline_placeholder: "); ++stages.back(); if (flag & MTPDuser::Flag::f_bot_inline_placeholder) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 19 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userProfilePhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userProfilePhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ userProfilePhotoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_userProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1035,18 +1037,18 @@ void _serialize_userProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" photo_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" photo_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" photo_small: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" photo_big: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userStatusEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ userStatusEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_userStatusOnline(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusOnline(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1054,12 +1056,12 @@ void _serialize_userStatusOnline(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" expires: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" expires: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userStatusOffline(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusOffline(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1067,24 +1069,24 @@ void _serialize_userStatusOffline(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" was_online: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" was_online: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userStatusRecently(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusRecently(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ userStatusRecently }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_userStatusLastWeek(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusLastWeek(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ userStatusLastWeek }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_userStatusLastMonth(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userStatusLastMonth(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ userStatusLastMonth }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_chatEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1092,12 +1094,14 @@ void _serialize_chatEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchat::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1105,25 +1109,25 @@ void _serialize_chat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchat::flag_creator) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchat::flag_kicked) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchat::flag_left) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" admins_enabled: "); ++stages.back(); if (flag & MTPDchat::flag_admins_enabled) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 5: to.add(" admin: "); ++stages.back(); if (flag & MTPDchat::flag_admin) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 6: to.add(" deactivated: "); ++stages.back(); if (flag & MTPDchat::flag_deactivated) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchat::Flag::f_creator) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchat::Flag::f_kicked) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchat::Flag::f_left) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 4: to.add(" admins_enabled: "); ++stages.back(); if (flag & MTPDchat::Flag::f_admins_enabled) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 5: to.add(" admin: "); ++stages.back(); if (flag & MTPDchat::Flag::f_admin) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 6: to.add(" deactivated: "); ++stages.back(); if (flag & MTPDchat::Flag::f_deactivated) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 9: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" participants_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" migrated_to: "); ++stages.back(); if (flag & MTPDchat::flag_migrated_to) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 10: to.add(" participants_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" migrated_to: "); ++stages.back(); if (flag & MTPDchat::Flag::f_migrated_to) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1131,13 +1135,15 @@ void _serialize_chatForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchannel::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1145,32 +1151,32 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchannel::flag_creator) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchannel::flag_kicked) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchannel::flag_left) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" editor: "); ++stages.back(); if (flag & MTPDchannel::flag_editor) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 5: to.add(" moderator: "); ++stages.back(); if (flag & MTPDchannel::flag_moderator) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 6: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchannel::flag_broadcast) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 7: to.add(" verified: "); ++stages.back(); if (flag & MTPDchannel::flag_verified) { to.add("YES [ BY BIT 7 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; - case 8: to.add(" megagroup: "); ++stages.back(); if (flag & MTPDchannel::flag_megagroup) { to.add("YES [ BY BIT 8 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; - case 9: to.add(" restricted: "); ++stages.back(); if (flag & MTPDchannel::flag_restricted) { to.add("YES [ BY BIT 9 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; - case 10: to.add(" democracy: "); ++stages.back(); if (flag & MTPDchannel::flag_democracy) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; - case 11: to.add(" signatures: "); ++stages.back(); if (flag & MTPDchannel::flag_signatures) { to.add("YES [ BY BIT 11 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; - case 12: to.add(" min: "); ++stages.back(); if (flag & MTPDchannel::flag_min) { to.add("YES [ BY BIT 12 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; - case 13: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDchannel::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 15: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_creator) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_kicked) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_left) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 4: to.add(" editor: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_editor) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 5: to.add(" moderator: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_moderator) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 6: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_broadcast) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 7: to.add(" verified: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_verified) { to.add("YES [ BY BIT 7 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 8: to.add(" megagroup: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_megagroup) { to.add("YES [ BY BIT 8 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 9: to.add(" restricted: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_restricted) { to.add("YES [ BY BIT 9 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 10: to.add(" democracy: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_democracy) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; + case 11: to.add(" signatures: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_signatures) { to.add("YES [ BY BIT 11 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; + case 12: to.add(" min: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_min) { to.add("YES [ BY BIT 12 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; + case 13: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 14: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_access_hash) { types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 15: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_username) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 17: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 18: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 19: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 20: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDchannel::flag_restriction_reason) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 18: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 19: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 20: to.add(" restriction_reason: "); ++stages.back(); if (flag & MTPDchannel::Flag::f_restriction_reason) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1178,14 +1184,14 @@ void _serialize_channelForbidden(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1193,7 +1199,7 @@ void _serialize_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" participants: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" chat_photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -1203,7 +1209,9 @@ void _serialize_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &typ } } -void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchannelFull::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1211,29 +1219,29 @@ void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" can_view_participants: "); ++stages.back(); if (flag & MTPDchannelFull::flag_can_view_participants) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 2: to.add(" can_set_username: "); ++stages.back(); if (flag & MTPDchannelFull::flag_can_set_username) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" participants_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_participants_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 6: to.add(" admins_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_admins_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 7: to.add(" kicked_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_kicked_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 8: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" can_view_participants: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_can_view_participants) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 2: to.add(" can_set_username: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_can_set_username) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" participants_count: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_participants_count) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 6: to.add(" admins_count: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_admins_count) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 7: to.add(" kicked_count: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_kicked_count) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 8: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 11: to.add(" chat_photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 12: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 13: to.add(" exported_invite: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 14: to.add(" bot_info: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" migrated_from_chat_id: "); ++stages.back(); if (flag & MTPDchannelFull::flag_migrated_from_chat_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 16: to.add(" migrated_from_max_id: "); ++stages.back(); if (flag & MTPDchannelFull::flag_migrated_from_max_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 17: to.add(" pinned_msg_id: "); ++stages.back(); if (flag & MTPDchannelFull::flag_pinned_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 15: to.add(" migrated_from_chat_id: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_migrated_from_chat_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 16: to.add(" migrated_from_max_id: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_migrated_from_max_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 17: to.add(" pinned_msg_id: "); ++stages.back(); if (flag & MTPDchannelFull::Flag::f_pinned_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1241,14 +1249,14 @@ void _serialize_chatParticipant(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatParticipantCreator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatParticipantCreator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1256,12 +1264,12 @@ void _serialize_chatParticipantCreator(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1269,14 +1277,16 @@ void _serialize_chatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatParticipantsForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatParticipantsForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchatParticipantsForbidden::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1284,14 +1294,14 @@ void _serialize_chatParticipantsForbidden(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" self_participant: "); ++stages.back(); if (flag & MTPDchatParticipantsForbidden::flag_self_participant) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" self_participant: "); ++stages.back(); if (flag & MTPDchatParticipantsForbidden::Flag::f_self_participant) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1299,18 +1309,18 @@ void _serialize_chatParticipants(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" participants: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatPhotoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ chatPhotoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_chatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1324,7 +1334,7 @@ void _serialize_chatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &ty } } -void _serialize_messageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1332,12 +1342,14 @@ void _serialize_messageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDmessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1345,31 +1357,33 @@ void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessage::flag_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessage::flag_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessage::flag_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessage::flag_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDmessage::flag_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 6: to.add(" post: "); ++stages.back(); if (flag & MTPDmessage::flag_post) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 6: to.add(" post: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_post) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_from_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; case 9: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 11: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDmessage::flag_via_bot_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; - case 12: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 13: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" media: "); ++stages.back(); if (flag & MTPDmessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; - case 16: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 17: to.add(" entities: "); ++stages.back(); if (flag & MTPDmessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; - case 18: to.add(" views: "); ++stages.back(); if (flag & MTPDmessage::flag_views) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; - case 19: to.add(" edit_date: "); ++stages.back(); if (flag & MTPDmessage::flag_edit_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break; + case 10: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 11: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_via_bot_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; + case 12: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 13: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 14: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 15: to.add(" media: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 16: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 17: to.add(" entities: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 18: to.add(" views: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_views) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; + case 19: to.add(" edit_date: "); ++stages.back(); if (flag & MTPDmessage::Flag::f_edit_date) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDmessageService::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1377,28 +1391,28 @@ void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessageService::flag_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessageService::flag_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessageService::flag_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessageService::flag_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDmessageService::flag_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 6: to.add(" post: "); ++stages.back(); if (flag & MTPDmessageService::flag_post) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageService::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 6: to.add(" post: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_post) { to.add("YES [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; + case 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_from_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; case 9: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessageService::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessageService::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 12: to.add(" action: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageMediaEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messageMediaEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messageMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1407,12 +1421,12 @@ void _serialize_messageMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, T } switch (stage) { case 0: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageMediaGeo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaGeo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1425,7 +1439,7 @@ void _serialize_messageMediaGeo(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_messageMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1433,19 +1447,19 @@ void _serialize_messageMediaContact(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageMediaUnsupported(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaUnsupported(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messageMediaUnsupported }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messageMediaDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1454,12 +1468,12 @@ void _serialize_messageMediaDocument(MTPStringLogger &to, int32 stage, int32 lev } switch (stage) { case 0: to.add(" document: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageMediaWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1472,7 +1486,7 @@ void _serialize_messageMediaWebPage(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_messageMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1481,19 +1495,19 @@ void _serialize_messageMediaVenue(MTPStringLogger &to, int32 stage, int32 lev, T } switch (stage) { case 0: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" provider: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" venue_id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messageActionEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messageActionChatCreate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatCreate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1501,13 +1515,13 @@ void _serialize_messageActionChatCreate(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChatEditTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatEditTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1515,12 +1529,12 @@ void _serialize_messageActionChatEditTitle(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChatEditPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatEditPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1533,11 +1547,11 @@ void _serialize_messageActionChatEditPhoto(MTPStringLogger &to, int32 stage, int } } -void _serialize_messageActionChatDeletePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatDeletePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messageActionChatDeletePhoto }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messageActionChatAddUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatAddUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1545,12 +1559,12 @@ void _serialize_messageActionChatAddUser(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChatDeleteUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatDeleteUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1558,12 +1572,12 @@ void _serialize_messageActionChatDeleteUser(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChatJoinedByLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatJoinedByLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1571,12 +1585,12 @@ void _serialize_messageActionChatJoinedByLink(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChannelCreate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChannelCreate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1584,12 +1598,12 @@ void _serialize_messageActionChannelCreate(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChatMigrateTo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChatMigrateTo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1597,12 +1611,12 @@ void _serialize_messageActionChatMigrateTo(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionChannelMigrateFrom(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionChannelMigrateFrom(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1610,17 +1624,17 @@ void _serialize_messageActionChannelMigrateFrom(MTPStringLogger &to, int32 stage to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageActionPinMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageActionPinMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messageActionPinMessage }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_dialog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dialog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1629,15 +1643,15 @@ void _serialize_dialog(MTPStringLogger &to, int32 stage, int32 lev, Types &types } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_dialogChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dialogChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1646,18 +1660,18 @@ void _serialize_dialogChannel(MTPStringLogger &to, int32 stage, int32 lev, Types } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 6: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1665,12 +1679,12 @@ void _serialize_photoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &t to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1678,15 +1692,15 @@ void _serialize_photo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" sizes: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photoSizeEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photoSizeEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1694,12 +1708,12 @@ void _serialize_photoSizeEmpty(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photoSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photoSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1707,16 +1721,16 @@ void _serialize_photoSize(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" location: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photoCachedSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photoCachedSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1724,20 +1738,20 @@ void _serialize_photoCachedSize(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" location: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_geoPointEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_geoPointEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ geoPointEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_geoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_geoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1745,13 +1759,13 @@ void _serialize_geoPoint(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" long: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" lat: "); ++stages.back(); types.push_back(mtpc_double); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" long: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" lat: "); ++stages.back(); types.push_back(mtpc_double+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_checkedPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_checkedPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1764,7 +1778,9 @@ void _serialize_auth_checkedPhone(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_auth_sentCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sentCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDauth_sentCode::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1772,17 +1788,17 @@ void _serialize_auth_sentCode(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_registered: "); ++stages.back(); if (flag & MTPDauth_sentCode::flag_phone_registered) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_registered: "); ++stages.back(); if (flag & MTPDauth_sentCode::Flag::f_phone_registered) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" type: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" next_type: "); ++stages.back(); if (flag & MTPDauth_sentCode::flag_next_type) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 5: to.add(" timeout: "); ++stages.back(); if (flag & MTPDauth_sentCode::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 3: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" next_type: "); ++stages.back(); if (flag & MTPDauth_sentCode::Flag::f_next_type) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 5: to.add(" timeout: "); ++stages.back(); if (flag & MTPDauth_sentCode::Flag::f_timeout) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1795,7 +1811,7 @@ void _serialize_auth_authorization(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_auth_exportedAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_exportedAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1803,13 +1819,13 @@ void _serialize_auth_exportedAuthorization(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputNotifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputNotifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1822,27 +1838,29 @@ void _serialize_inputNotifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_inputNotifyUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputNotifyUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputNotifyUsers }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputNotifyChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputNotifyChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputNotifyChats }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputNotifyAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputNotifyAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputNotifyAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerNotifyEventsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerNotifyEventsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPeerNotifyEventsEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerNotifyEventsAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerNotifyEventsAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPeerNotifyEventsAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPeerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPeerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputPeerNotifySettings::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1850,28 +1868,30 @@ void _serialize_inputPeerNotifySettings(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" show_previews: "); ++stages.back(); if (flag & MTPDinputPeerNotifySettings::flag_show_previews) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPDinputPeerNotifySettings::flag_silent) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mute_until: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" show_previews: "); ++stages.back(); if (flag & MTPDinputPeerNotifySettings::Flag::f_show_previews) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPDinputPeerNotifySettings::Flag::f_silent) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mute_until: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_peerNotifyEventsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerNotifyEventsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ peerNotifyEventsEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_peerNotifyEventsAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerNotifyEventsAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ peerNotifyEventsAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_peerNotifySettingsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerNotifySettingsEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ peerNotifySettingsEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_peerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDpeerNotifySettings::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1879,16 +1899,18 @@ void _serialize_peerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" show_previews: "); ++stages.back(); if (flag & MTPDpeerNotifySettings::flag_show_previews) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPDpeerNotifySettings::flag_silent) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mute_until: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" show_previews: "); ++stages.back(); if (flag & MTPDpeerNotifySettings::Flag::f_show_previews) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPDpeerNotifySettings::Flag::f_silent) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mute_until: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_peerSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_peerSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDpeerSettings::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1896,13 +1918,13 @@ void _serialize_peerSettings(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" report_spam: "); ++stages.back(); if (flag & MTPDpeerSettings::flag_report_spam) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" report_spam: "); ++stages.back(); if (flag & MTPDpeerSettings::Flag::f_report_spam) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_wallPaper(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_wallPaper(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1910,15 +1932,15 @@ void _serialize_wallPaper(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" sizes: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" color: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" color: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_wallPaperSolid(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_wallPaperSolid(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1926,27 +1948,27 @@ void _serialize_wallPaperSolid(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" bg_color: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" color: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" bg_color: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" color: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputReportReasonSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputReportReasonSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputReportReasonSpam }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputReportReasonViolence(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputReportReasonViolence(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputReportReasonViolence }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputReportReasonPornography(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputReportReasonPornography(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputReportReasonPornography }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputReportReasonOther(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputReportReasonOther(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1954,12 +1976,14 @@ void _serialize_inputReportReasonOther(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_userFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_userFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDuserFull::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1967,19 +1991,19 @@ void _serialize_userFull(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" blocked: "); ++stages.back(); if (flag & MTPDuserFull::flag_blocked) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" blocked: "); ++stages.back(); if (flag & MTPDuserFull::Flag::f_blocked) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" user: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" about: "); ++stages.back(); if (flag & MTPDuserFull::flag_about) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" about: "); ++stages.back(); if (flag & MTPDuserFull::Flag::f_about) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 4: to.add(" link: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" profile_photo: "); ++stages.back(); if (flag & MTPDuserFull::flag_profile_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 5: to.add(" profile_photo: "); ++stages.back(); if (flag & MTPDuserFull::Flag::f_profile_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; case 6: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" bot_info: "); ++stages.back(); if (flag & MTPDuserFull::flag_bot_info) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 7: to.add(" bot_info: "); ++stages.back(); if (flag & MTPDuserFull::Flag::f_bot_info) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -1987,13 +2011,13 @@ void _serialize_contact(MTPStringLogger &to, int32 stage, int32 lev, Types &type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" mutual: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_importedContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_importedContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2001,13 +2025,13 @@ void _serialize_importedContact(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" client_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" client_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contactBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2015,13 +2039,13 @@ void _serialize_contactBlocked(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contactStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2029,13 +2053,13 @@ void _serialize_contactStatus(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" status: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_link(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_link(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2050,11 +2074,11 @@ void _serialize_contacts_link(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_contacts_contactsNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_contactsNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contacts_contactsNotModified }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contacts_contacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_contacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2068,7 +2092,7 @@ void _serialize_contacts_contacts(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_contacts_importedContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_importedContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2077,13 +2101,13 @@ void _serialize_contacts_importedContacts(MTPStringLogger &to, int32 stage, int3 } switch (stage) { case 0: to.add(" imported: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" retry_contacts: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" retry_contacts: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_blocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_blocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2097,7 +2121,7 @@ void _serialize_contacts_blocked(MTPStringLogger &to, int32 stage, int32 lev, Ty } } -void _serialize_contacts_blockedSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_blockedSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2105,14 +2129,14 @@ void _serialize_contacts_blockedSlice(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" blocked: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_dialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_dialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2128,7 +2152,7 @@ void _serialize_messages_dialogs(MTPStringLogger &to, int32 stage, int32 lev, Ty } } -void _serialize_messages_dialogsSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_dialogsSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2136,7 +2160,7 @@ void _serialize_messages_dialogsSlice(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" dialogs: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -2145,7 +2169,7 @@ void _serialize_messages_dialogsSlice(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_messages_messages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_messages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2160,7 +2184,7 @@ void _serialize_messages_messages(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_messages_messagesSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_messagesSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2168,7 +2192,7 @@ void _serialize_messages_messagesSlice(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -2176,7 +2200,9 @@ void _serialize_messages_messagesSlice(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_messages_channelMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_channelMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDmessages_channelMessages::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2184,18 +2210,18 @@ void _serialize_messages_channelMessages(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" collapsed: "); ++stages.back(); if (flag & MTPDmessages_channelMessages::flag_collapsed) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 4: to.add(" collapsed: "); ++stages.back(); if (flag & MTPDmessages_channelMessages::Flag::f_collapsed) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 5: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 6: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_chats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_chats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2208,7 +2234,7 @@ void _serialize_messages_chats(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_messages_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_chatFull(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2223,7 +2249,7 @@ void _serialize_messages_chatFull(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_messages_affectedHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_affectedHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2231,54 +2257,54 @@ void _serialize_messages_affectedHistory(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputMessagesFilterEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterPhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterPhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterPhotos }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterVideo }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterPhotoVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterPhotoVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterPhotoVideo }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterPhotoVideoDocuments(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterPhotoVideoDocuments(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterPhotoVideoDocuments }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterDocument }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterUrl }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterGif }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterVoice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterVoice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterVoice }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterMusic(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputMessagesFilterMusic(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputMessagesFilterMusic }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_updateNewMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNewMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2287,13 +2313,13 @@ void _serialize_updateNewMessage(MTPStringLogger &to, int32 stage, int32 lev, Ty } switch (stage) { case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateMessageID(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateMessageID(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2301,13 +2327,13 @@ void _serialize_updateMessageID(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateDeleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateDeleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2315,14 +2341,14 @@ void _serialize_updateDeleteMessages(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateUserTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2330,13 +2356,13 @@ void _serialize_updateUserTyping(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" action: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatUserTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatUserTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2344,14 +2370,14 @@ void _serialize_updateChatUserTyping(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" action: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2364,7 +2390,7 @@ void _serialize_updateChatParticipants(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_updateUserStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2372,13 +2398,13 @@ void _serialize_updateUserStatus(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" status: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateUserName(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserName(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2386,15 +2412,15 @@ void _serialize_updateUserName(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateUserPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2402,15 +2428,15 @@ void _serialize_updateUserPhoto(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" previous: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateContactRegistered(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateContactRegistered(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2418,13 +2444,13 @@ void _serialize_updateContactRegistered(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateContactLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateContactLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2432,14 +2458,14 @@ void _serialize_updateContactLink(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" my_link: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" foreign_link: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateNewAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNewAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2447,15 +2473,15 @@ void _serialize_updateNewAuthorization(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" auth_key_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" device: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" location: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" auth_key_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" device: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" location: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateNewEncryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNewEncryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2464,12 +2490,12 @@ void _serialize_updateNewEncryptedMessage(MTPStringLogger &to, int32 stage, int3 } switch (stage) { case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateEncryptedChatTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateEncryptedChatTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2477,12 +2503,12 @@ void _serialize_updateEncryptedChatTyping(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2491,12 +2517,12 @@ void _serialize_updateEncryption(MTPStringLogger &to, int32 stage, int32 lev, Ty } switch (stage) { case 0: to.add(" chat: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateEncryptedMessagesRead(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateEncryptedMessagesRead(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2504,14 +2530,14 @@ void _serialize_updateEncryptedMessagesRead(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatParticipantAdd(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatParticipantAdd(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2519,16 +2545,16 @@ void _serialize_updateChatParticipantAdd(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatParticipantDelete(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatParticipantDelete(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2536,14 +2562,14 @@ void _serialize_updateChatParticipantDelete(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateDcOptions(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateDcOptions(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2556,7 +2582,7 @@ void _serialize_updateDcOptions(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_updateUserBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2564,13 +2590,13 @@ void _serialize_updateUserBlocked(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" blocked: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2584,7 +2610,7 @@ void _serialize_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_updateServiceNotification(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateServiceNotification(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2592,15 +2618,15 @@ void _serialize_updateServiceNotification(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" popup: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updatePrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updatePrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2614,7 +2640,7 @@ void _serialize_updatePrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_updateUserPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateUserPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2622,13 +2648,13 @@ void _serialize_updateUserPhone(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateReadHistoryInbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateReadHistoryInbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2637,14 +2663,14 @@ void _serialize_updateReadHistoryInbox(MTPStringLogger &to, int32 stage, int32 l } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateReadHistoryOutbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateReadHistoryOutbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2653,14 +2679,14 @@ void _serialize_updateReadHistoryOutbox(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2669,13 +2695,13 @@ void _serialize_updateWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types } switch (stage) { case 0: to.add(" webpage: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateReadMessagesContents(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateReadMessagesContents(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2683,14 +2709,16 @@ void _serialize_updateReadMessagesContents(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChannelTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChannelTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateChannelTooLong::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2698,14 +2726,14 @@ void _serialize_updateChannelTooLong(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts: "); ++stages.back(); if (flag & MTPDupdateChannelTooLong::flag_pts) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts: "); ++stages.back(); if (flag & MTPDupdateChannelTooLong::Flag::f_pts) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2713,12 +2741,12 @@ void _serialize_updateChannel(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChannelGroup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChannelGroup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2726,13 +2754,13 @@ void _serialize_updateChannelGroup(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" group: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateNewChannelMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNewChannelMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2741,13 +2769,13 @@ void _serialize_updateNewChannelMessage(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateReadChannelInbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateReadChannelInbox(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2755,13 +2783,13 @@ void _serialize_updateReadChannelInbox(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateDeleteChannelMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateDeleteChannelMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2769,15 +2797,15 @@ void _serialize_updateDeleteChannelMessages(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" messages: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChannelMessageViews(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChannelMessageViews(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2785,14 +2813,14 @@ void _serialize_updateChannelMessageViews(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" views: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" views: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2800,14 +2828,14 @@ void _serialize_updateChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" enabled: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2815,15 +2843,15 @@ void _serialize_updateChatParticipantAdmin(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" is_admin: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateNewStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateNewStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2836,7 +2864,7 @@ void _serialize_updateNewStickerSet(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_updateStickerSetsOrder(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateStickerSetsOrder(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2844,20 +2872,20 @@ void _serialize_updateStickerSetsOrder(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" order: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" order: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateStickerSets(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateStickerSets(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ updateStickerSets }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_updateSavedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateSavedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ updateSavedGifs }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2865,15 +2893,15 @@ void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2881,14 +2909,14 @@ void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateEditChannelMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateEditChannelMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2897,13 +2925,13 @@ void _serialize_updateEditChannelMessage(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateChannelPinnedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateChannelPinnedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2911,13 +2939,13 @@ void _serialize_updateChannelPinnedMessage(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_state(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_state(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2925,16 +2953,16 @@ void _serialize_updates_state(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_differenceEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_differenceEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2942,13 +2970,13 @@ void _serialize_updates_differenceEmpty(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_difference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_difference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2966,7 +2994,7 @@ void _serialize_updates_difference(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_updates_differenceSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_differenceSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2984,11 +3012,13 @@ void _serialize_updates_differenceSlice(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_updatesTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updatesTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ updatesTooLong }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateShortMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -2996,27 +3026,29 @@ void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 6: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 13: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_via_bot_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; - case 14: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 15: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 6: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 13: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_via_bot_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; + case 14: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 15: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateShortChatMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3024,28 +3056,28 @@ void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; - case 6: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" from_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 14: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_via_bot_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; - case 15: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 16: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_mentioned) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_media_unread) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 5: to.add(" silent: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_silent) { to.add("YES [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break; + case 6: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" from_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" fwd_from: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_fwd_from) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 14: to.add(" via_bot_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_via_bot_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break; + case 15: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 16: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateShort(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateShort(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3054,12 +3086,12 @@ void _serialize_updateShort(MTPStringLogger &to, int32 stage, int32 lev, Types & } switch (stage) { case 0: to.add(" update: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updatesCombined(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updatesCombined(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3070,14 +3102,14 @@ void _serialize_updatesCombined(MTPStringLogger &to, int32 stage, int32 lev, Typ case 0: to.add(" updates: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" seq_start: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" seq_start: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3088,13 +3120,15 @@ void _serialize_updates(MTPStringLogger &to, int32 stage, int32 lev, Types &type case 0: to.add(" updates: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" seq: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updateShortSentMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updateShortSentMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdateShortSentMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3102,20 +3136,20 @@ void _serialize_updateShortSentMessage(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" media: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; - case 8: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::Flag::f_unread) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::Flag::f_out) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" media: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::Flag::f_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 8: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photos_photos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_photos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3129,7 +3163,7 @@ void _serialize_photos_photos(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_photos_photosSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_photosSlice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3137,14 +3171,14 @@ void _serialize_photos_photosSlice(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" photos: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photos_photo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_photo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3158,7 +3192,7 @@ void _serialize_photos_photo(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_upload_file(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_upload_file(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3167,13 +3201,15 @@ void _serialize_upload_file(MTPStringLogger &to, int32 stage, int32 lev, Types & } switch (stage) { case 0: to.add(" type: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" mtime: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" mtime: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_dcOption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_dcOption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDdcOption::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3181,18 +3217,18 @@ void _serialize_dcOption(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" ipv6: "); ++stages.back(); if (flag & MTPDdcOption::flag_ipv6) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" media_only: "); ++stages.back(); if (flag & MTPDdcOption::flag_media_only) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" tcpo_only: "); ++stages.back(); if (flag & MTPDdcOption::flag_tcpo_only) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" ip_address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" port: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" ipv6: "); ++stages.back(); if (flag & MTPDdcOption::Flag::f_ipv6) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" media_only: "); ++stages.back(); if (flag & MTPDdcOption::Flag::f_media_only) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" tcpo_only: "); ++stages.back(); if (flag & MTPDdcOption::Flag::f_tcpo_only) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" ip_address: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" port: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_config(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_config(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3200,31 +3236,31 @@ void _serialize_config(MTPStringLogger &to, int32 stage, int32 lev, Types &types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" expires: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" expires: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" test_mode: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" dc_options: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" chat_size_max: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" megagroup_size_max: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" forwarded_count_max: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" online_update_period_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" offline_blur_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" offline_idle_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" online_cloud_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" notify_cloud_delay_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" notify_default_delay_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: to.add(" chat_big_size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" push_chat_period_ms: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" push_chat_limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: to.add(" saved_gifs_limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 18: to.add(" edit_time_limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" chat_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" megagroup_size_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" forwarded_count_max: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" online_update_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" offline_blur_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" offline_idle_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" online_cloud_timeout_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" notify_cloud_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" notify_default_delay_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 14: to.add(" chat_big_size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 15: to.add(" push_chat_period_ms: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" push_chat_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 17: to.add(" saved_gifs_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 18: to.add(" edit_time_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 19: to.add(" disabled_features: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_nearestDc(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_nearestDc(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3232,14 +3268,14 @@ void _serialize_nearestDc(MTPStringLogger &to, int32 stage, int32 lev, Types &ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" country: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" nearest_dc: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" country: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" this_dc: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" nearest_dc: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_appUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_appUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3247,19 +3283,19 @@ void _serialize_help_appUpdate(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" critical: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_noAppUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_noAppUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ help_noAppUpdate }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_help_inviteText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_inviteText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3267,12 +3303,12 @@ void _serialize_help_inviteText(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedChatEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedChatEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3280,12 +3316,12 @@ void _serialize_encryptedChatEmpty(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedChatWaiting(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedChatWaiting(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3293,16 +3329,16 @@ void _serialize_encryptedChatWaiting(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedChatRequested(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedChatRequested(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3310,17 +3346,17 @@ void _serialize_encryptedChatRequested(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3328,18 +3364,18 @@ void _serialize_encryptedChat(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" g_a_or_b: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" admin_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" participant_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" g_a_or_b: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedChatDiscarded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedChatDiscarded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3347,12 +3383,12 @@ void _serialize_encryptedChatDiscarded(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputEncryptedChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3360,17 +3396,17 @@ void _serialize_inputEncryptedChat(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedFileEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedFileEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ encryptedFileEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_encryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3378,20 +3414,20 @@ void _serialize_encryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputEncryptedFileEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedFileEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputEncryptedFileEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputEncryptedFileUploaded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedFileUploaded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3399,15 +3435,15 @@ void _serialize_inputEncryptedFileUploaded(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" md5_checksum: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" md5_checksum: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3415,13 +3451,13 @@ void _serialize_inputEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputEncryptedFileBigUploaded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputEncryptedFileBigUploaded(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3429,14 +3465,14 @@ void _serialize_inputEncryptedFileBigUploaded(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" parts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3444,16 +3480,16 @@ void _serialize_encryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_encryptedMessageService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_encryptedMessageService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3461,15 +3497,15 @@ void _serialize_encryptedMessageService(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_dhConfigNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_dhConfigNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3477,12 +3513,12 @@ void _serialize_messages_dhConfigNotModified(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" random: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" random: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_dhConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_dhConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3490,15 +3526,15 @@ void _serialize_messages_dhConfig(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" g: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" p: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" random: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" g: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" p: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" random: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sentEncryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sentEncryptedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3506,12 +3542,12 @@ void _serialize_messages_sentEncryptedMessage(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sentEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sentEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3519,17 +3555,17 @@ void _serialize_messages_sentEncryptedFile(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputDocumentEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputDocumentEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputDocumentEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3537,13 +3573,13 @@ void _serialize_inputDocument(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3551,12 +3587,12 @@ void _serialize_documentEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_document(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_document(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3564,19 +3600,19 @@ void _serialize_document(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 5: to.add(" thumb: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 7: to.add(" attributes: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_support(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_support(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3584,13 +3620,13 @@ void _serialize_help_support(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" user: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_notifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_notifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3603,31 +3639,31 @@ void _serialize_notifyPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &t } } -void _serialize_notifyUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_notifyUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ notifyUsers }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_notifyChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_notifyChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ notifyChats }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_notifyAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_notifyAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ notifyAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageTypingAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageTypingAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageTypingAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageCancelAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageCancelAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageCancelAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageRecordVideoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageRecordVideoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageRecordVideoAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageUploadVideoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageUploadVideoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3635,16 +3671,16 @@ void _serialize_sendMessageUploadVideoAction(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_sendMessageRecordAudioAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageRecordAudioAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageRecordAudioAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageUploadAudioAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageUploadAudioAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3652,12 +3688,12 @@ void _serialize_sendMessageUploadAudioAction(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_sendMessageUploadPhotoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageUploadPhotoAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3665,12 +3701,12 @@ void _serialize_sendMessageUploadPhotoAction(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_sendMessageUploadDocumentAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageUploadDocumentAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3678,20 +3714,20 @@ void _serialize_sendMessageUploadDocumentAction(MTPStringLogger &to, int32 stage to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" progress: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_sendMessageGeoLocationAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageGeoLocationAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageGeoLocationAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_sendMessageChooseContactAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_sendMessageChooseContactAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ sendMessageChooseContactAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contacts_found(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_found(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3706,31 +3742,31 @@ void _serialize_contacts_found(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_inputPrivacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyKeyStatusTimestamp }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyKeyChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyKeyChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyKeyChatInvite }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyKeyStatusTimestamp }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyKeyChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyKeyChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyKeyChatInvite }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyValueAllowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueAllowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyValueAllowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyValueAllowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueAllowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyValueAllowAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyValueAllowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueAllowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3743,15 +3779,15 @@ void _serialize_inputPrivacyValueAllowUsers(MTPStringLogger &to, int32 stage, in } } -void _serialize_inputPrivacyValueDisallowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueDisallowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyValueDisallowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyValueDisallowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueDisallowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputPrivacyValueDisallowAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputPrivacyValueDisallowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputPrivacyValueDisallowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3764,15 +3800,15 @@ void _serialize_inputPrivacyValueDisallowUsers(MTPStringLogger &to, int32 stage, } } -void _serialize_privacyValueAllowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueAllowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyValueAllowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyValueAllowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueAllowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyValueAllowAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyValueAllowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueAllowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3780,20 +3816,20 @@ void _serialize_privacyValueAllowUsers(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_privacyValueDisallowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueDisallowContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyValueDisallowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyValueDisallowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueDisallowAll(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ privacyValueDisallowAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_privacyValueDisallowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_privacyValueDisallowUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3801,12 +3837,12 @@ void _serialize_privacyValueDisallowUsers(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" users: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_privacyRules(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_privacyRules(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3820,7 +3856,7 @@ void _serialize_account_privacyRules(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_accountDaysTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_accountDaysTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3828,12 +3864,12 @@ void _serialize_accountDaysTTL(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" days: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" days: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentAttributeImageSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeImageSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3841,17 +3877,17 @@ void _serialize_documentAttributeImageSize(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentAttributeAnimated(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeAnimated(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ documentAttributeAnimated }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_documentAttributeSticker(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeSticker(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3859,13 +3895,13 @@ void _serialize_documentAttributeSticker(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" alt: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" alt: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" stickerset: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentAttributeVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3873,14 +3909,16 @@ void _serialize_documentAttributeVideo(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentAttributeAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDdocumentAttributeAudio::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3888,17 +3926,17 @@ void _serialize_documentAttributeAudio(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" voice: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::flag_voice) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; - case 2: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::flag_title) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 4: to.add(" performer: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::flag_performer) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 5: to.add(" waveform: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::flag_waveform) { types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" voice: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::Flag::f_voice) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break; + case 2: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::Flag::f_title) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 4: to.add(" performer: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::Flag::f_performer) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 5: to.add(" waveform: "); ++stages.back(); if (flag & MTPDdocumentAttributeAudio::Flag::f_waveform) { types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_documentAttributeFilename(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_documentAttributeFilename(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3906,16 +3944,16 @@ void _serialize_documentAttributeFilename(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" file_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" file_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_stickersNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_stickersNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messages_stickersNotModified }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messages_stickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_stickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3923,13 +3961,13 @@ void _serialize_messages_stickers(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" stickers: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_stickerPack(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_stickerPack(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3937,17 +3975,17 @@ void _serialize_stickerPack(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" emoticon: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" documents: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" emoticon: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" documents: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_allStickersNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_allStickersNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messages_allStickersNotModified }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messages_allStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_allStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3955,13 +3993,13 @@ void _serialize_messages_allStickers(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" sets: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_disabledFeature(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_disabledFeature(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3969,13 +4007,13 @@ void _serialize_disabledFeature(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" feature: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" feature: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_affectedMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_affectedMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -3983,29 +4021,29 @@ void _serialize_messages_affectedMessages(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contactLinkUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactLinkUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contactLinkUnknown }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contactLinkNone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactLinkNone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contactLinkNone }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contactLinkHasPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactLinkHasPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contactLinkHasPhone }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contactLinkContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contactLinkContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contactLinkContact }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_webPageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_webPageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4013,12 +4051,12 @@ void _serialize_webPageEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_webPagePending(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_webPagePending(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4026,13 +4064,15 @@ void _serialize_webPagePending(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_webPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_webPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDwebPage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4040,27 +4080,27 @@ void _serialize_webPage(MTPStringLogger &to, int32 stage, int32 lev, Types &type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" display_url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" type: "); ++stages.back(); if (flag & MTPDwebPage::flag_type) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 5: to.add(" site_name: "); ++stages.back(); if (flag & MTPDwebPage::flag_site_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 6: to.add(" title: "); ++stages.back(); if (flag & MTPDwebPage::flag_title) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 7: to.add(" description: "); ++stages.back(); if (flag & MTPDwebPage::flag_description) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 8: to.add(" photo: "); ++stages.back(); if (flag & MTPDwebPage::flag_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 9: to.add(" embed_url: "); ++stages.back(); if (flag & MTPDwebPage::flag_embed_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 10: to.add(" embed_type: "); ++stages.back(); if (flag & MTPDwebPage::flag_embed_type) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 11: to.add(" embed_width: "); ++stages.back(); if (flag & MTPDwebPage::flag_embed_width) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 12: to.add(" embed_height: "); ++stages.back(); if (flag & MTPDwebPage::flag_embed_height) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 13: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPage::flag_duration) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; - case 14: to.add(" author: "); ++stages.back(); if (flag & MTPDwebPage::flag_author) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; - case 15: to.add(" document: "); ++stages.back(); if (flag & MTPDwebPage::flag_document) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" display_url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_type) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 5: to.add(" site_name: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_site_name) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 6: to.add(" title: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_title) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 7: to.add(" description: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_description) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 8: to.add(" photo: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 9: to.add(" embed_url: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 10: to.add(" embed_type: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_type) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 11: to.add(" embed_width: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_width) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 12: to.add(" embed_height: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_embed_height) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 13: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 14: to.add(" author: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_author) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 15: to.add(" document: "); ++stages.back(); if (flag & MTPDwebPage::Flag::f_document) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4068,24 +4108,24 @@ void _serialize_authorization(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" platform: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" app_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" date_created: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" date_active: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: to.add(" ip: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" country: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" region: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" platform: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" app_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" date_created: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" date_active: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 10: to.add(" ip: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: to.add(" country: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 12: to.add(" region: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_authorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_authorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4098,7 +4138,7 @@ void _serialize_account_authorizations(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_account_noPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_noPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4106,13 +4146,13 @@ void _serialize_account_noPassword(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" new_salt: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" email_unconfirmed_pattern: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" new_salt: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" email_unconfirmed_pattern: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_password(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_password(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4120,16 +4160,16 @@ void _serialize_account_password(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" current_salt: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" new_salt: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" hint: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" current_salt: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" new_salt: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" hint: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" has_recovery: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" email_unconfirmed_pattern: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" email_unconfirmed_pattern: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_passwordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_passwordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4137,12 +4177,14 @@ void _serialize_account_passwordSettings(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" email: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" email: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_passwordInputSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_passwordInputSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDaccount_passwordInputSettings::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4150,16 +4192,16 @@ void _serialize_account_passwordInputSettings(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" new_salt: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::flag_new_salt) { types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" new_password_hash: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::flag_new_password_hash) { types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 3: to.add(" hint: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::flag_hint) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 4: to.add(" email: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::flag_email) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" new_salt: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::Flag::f_new_salt) { types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" new_password_hash: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::Flag::f_new_password_hash) { types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 3: to.add(" hint: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::Flag::f_hint) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 4: to.add(" email: "); ++stages.back(); if (flag & MTPDaccount_passwordInputSettings::Flag::f_email) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_passwordRecovery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_passwordRecovery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4167,12 +4209,12 @@ void _serialize_auth_passwordRecovery(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" email_pattern: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" email_pattern: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_receivedNotifyMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_receivedNotifyMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4180,17 +4222,17 @@ void _serialize_receivedNotifyMessage(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatInviteEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatInviteEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ chatInviteEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_chatInviteExported(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatInviteExported(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4198,12 +4240,12 @@ void _serialize_chatInviteExported(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" link: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" link: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_chatInviteAlready(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatInviteAlready(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4216,7 +4258,9 @@ void _serialize_chatInviteAlready(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_chatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_chatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchatInvite::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4224,21 +4268,21 @@ void _serialize_chatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &t to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" channel: "); ++stages.back(); if (flag & MTPDchatInvite::flag_channel) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchatInvite::flag_broadcast) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" public: "); ++stages.back(); if (flag & MTPDchatInvite::flag_public) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" megagroup: "); ++stages.back(); if (flag & MTPDchatInvite::flag_megagroup) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 5: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" channel: "); ++stages.back(); if (flag & MTPDchatInvite::Flag::f_channel) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchatInvite::Flag::f_broadcast) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" public: "); ++stages.back(); if (flag & MTPDchatInvite::Flag::f_public) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 4: to.add(" megagroup: "); ++stages.back(); if (flag & MTPDchatInvite::Flag::f_megagroup) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 5: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputStickerSetEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputStickerSetEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputStickerSetEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputStickerSetID(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputStickerSetID(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4246,13 +4290,13 @@ void _serialize_inputStickerSetID(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputStickerSetShortName(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputStickerSetShortName(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4260,12 +4304,14 @@ void _serialize_inputStickerSetShortName(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDstickerSet::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4273,21 +4319,21 @@ void _serialize_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &t to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" installed: "); ++stages.back(); if (flag & MTPDstickerSet::flag_installed) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" disabled: "); ++stages.back(); if (flag & MTPDstickerSet::flag_disabled) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" official: "); ++stages.back(); if (flag & MTPDstickerSet::flag_official) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" installed: "); ++stages.back(); if (flag & MTPDstickerSet::Flag::f_installed) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" disabled: "); ++stages.back(); if (flag & MTPDstickerSet::Flag::f_disabled) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" official: "); ++stages.back(); if (flag & MTPDstickerSet::Flag::f_official) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4302,7 +4348,7 @@ void _serialize_messages_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_botCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4310,13 +4356,13 @@ void _serialize_botCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &t to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" command: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" command: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4324,14 +4370,14 @@ void _serialize_botInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" commands: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_keyboardButton(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_keyboardButton(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4339,12 +4385,12 @@ void _serialize_keyboardButton(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_keyboardButtonRow(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_keyboardButtonRow(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4357,7 +4403,9 @@ void _serialize_keyboardButtonRow(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_replyKeyboardHide(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_replyKeyboardHide(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDreplyKeyboardHide::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4365,13 +4413,15 @@ void _serialize_replyKeyboardHide(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardHide::flag_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardHide::Flag::f_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_replyKeyboardForceReply(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_replyKeyboardForceReply(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDreplyKeyboardForceReply::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4379,14 +4429,16 @@ void _serialize_replyKeyboardForceReply(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::flag_single_use) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 2: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::flag_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::Flag::f_single_use) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 2: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::Flag::f_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDreplyKeyboardMarkup::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4394,20 +4446,20 @@ void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" resize: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_resize) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_single_use) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" resize: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_resize) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_single_use) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_selective) { to.add("YES [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; case 4: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_appChangelogEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_appChangelogEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ help_appChangelogEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_help_appChangelog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_appChangelog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4415,12 +4467,12 @@ void _serialize_help_appChangelog(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityUnknown(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4428,13 +4480,13 @@ void _serialize_messageEntityUnknown(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityMention(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityMention(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4442,13 +4494,13 @@ void _serialize_messageEntityMention(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityHashtag(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityHashtag(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4456,13 +4508,13 @@ void _serialize_messageEntityHashtag(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityBotCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityBotCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4470,13 +4522,13 @@ void _serialize_messageEntityBotCommand(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4484,13 +4536,13 @@ void _serialize_messageEntityUrl(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityEmail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityEmail(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4498,13 +4550,13 @@ void _serialize_messageEntityEmail(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityBold(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityBold(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4512,13 +4564,13 @@ void _serialize_messageEntityBold(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityItalic(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityItalic(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4526,13 +4578,13 @@ void _serialize_messageEntityItalic(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4540,13 +4592,13 @@ void _serialize_messageEntityCode(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityPre(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityPre(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4554,14 +4606,14 @@ void _serialize_messageEntityPre(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" language: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" language: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageEntityTextUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageEntityTextUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4569,18 +4621,18 @@ void _serialize_messageEntityTextUrl(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputChannelEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputChannelEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ inputChannelEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4588,13 +4640,13 @@ void _serialize_inputChannel(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" channel_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_resolvedPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_resolvedPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4609,7 +4661,7 @@ void _serialize_contacts_resolvedPeer(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_messageRange(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageRange(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4617,13 +4669,13 @@ void _serialize_messageRange(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageGroup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageGroup(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4631,15 +4683,17 @@ void _serialize_messageGroup(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_channelDifferenceEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_channelDifferenceEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdates_channelDifferenceEmpty::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4647,15 +4701,17 @@ void _serialize_updates_channelDifferenceEmpty(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::flag_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::Flag::f_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::Flag::f_timeout) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_channelDifferenceTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_channelDifferenceTooLong(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdates_channelDifferenceTooLong::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4663,15 +4719,15 @@ void _serialize_updates_channelDifferenceTooLong(MTPStringLogger &to, int32 stag to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::flag_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 4: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::Flag::f_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::Flag::f_timeout) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 9: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 10: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 11: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -4679,7 +4735,9 @@ void _serialize_updates_channelDifferenceTooLong(MTPStringLogger &to, int32 stag } } -void _serialize_updates_channelDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_channelDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDupdates_channelDifference::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4687,10 +4745,10 @@ void _serialize_updates_channelDifference(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::flag_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::Flag::f_final) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::Flag::f_timeout) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 4: to.add(" new_messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 5: to.add(" other_updates: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 6: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -4699,11 +4757,13 @@ void _serialize_updates_channelDifference(MTPStringLogger &to, int32 stage, int3 } } -void _serialize_channelMessagesFilterEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelMessagesFilterEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelMessagesFilterEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelMessagesFilter(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelMessagesFilter(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchannelMessagesFilter::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4711,19 +4771,19 @@ void _serialize_channelMessagesFilter(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPDchannelMessagesFilter::flag_important_only) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" exclude_new_messages: "); ++stages.back(); if (flag & MTPDchannelMessagesFilter::flag_exclude_new_messages) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPDchannelMessagesFilter::Flag::f_important_only) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" exclude_new_messages: "); ++stages.back(); if (flag & MTPDchannelMessagesFilter::Flag::f_exclude_new_messages) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 3: to.add(" ranges: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelMessagesFilterCollapsed(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelMessagesFilterCollapsed(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelMessagesFilterCollapsed }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4731,13 +4791,13 @@ void _serialize_channelParticipant(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantSelf(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4745,14 +4805,14 @@ void _serialize_channelParticipantSelf(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantModerator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantModerator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4760,14 +4820,14 @@ void _serialize_channelParticipantModerator(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantEditor(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantEditor(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4775,14 +4835,14 @@ void _serialize_channelParticipantEditor(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantKicked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantKicked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4790,14 +4850,14 @@ void _serialize_channelParticipantKicked(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" kicked_by: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" kicked_by: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantCreator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantCreator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4805,40 +4865,40 @@ void _serialize_channelParticipantCreator(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channelParticipantsRecent(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantsRecent(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelParticipantsRecent }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelParticipantsAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantsAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelParticipantsAdmins }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelParticipantsKicked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantsKicked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelParticipantsKicked }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelParticipantsBots(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelParticipantsBots(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelParticipantsBots }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelRoleEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelRoleEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelRoleEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelRoleModerator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelRoleModerator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelRoleModerator }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channelRoleEditor(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channelRoleEditor(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ channelRoleEditor }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_channels_channelParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_channelParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4846,14 +4906,14 @@ void _serialize_channels_channelParticipants(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" participants: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_channelParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_channelParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4867,7 +4927,7 @@ void _serialize_channels_channelParticipant(MTPStringLogger &to, int32 stage, in } } -void _serialize_help_termsOfService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_termsOfService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4875,12 +4935,12 @@ void _serialize_help_termsOfService(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_foundGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_foundGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4888,17 +4948,17 @@ void _serialize_foundGif(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" thumb_url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" content_url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" content_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" thumb_url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" content_url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" content_type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_foundGifCached(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_foundGifCached(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4906,14 +4966,14 @@ void _serialize_foundGifCached(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" document: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_foundGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_foundGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4921,17 +4981,17 @@ void _serialize_messages_foundGifs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" next_offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" next_offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" results: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_savedGifsNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_savedGifsNotModified(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ messages_savedGifsNotModified }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messages_savedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_savedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4939,13 +4999,13 @@ void _serialize_messages_savedGifs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" gifs: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputBotInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputBotInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4953,12 +5013,14 @@ void _serialize_inputBotInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputBotInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputBotInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageText::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4966,15 +5028,17 @@ void _serialize_inputBotInlineMessageText(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::flag_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::Flag::f_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageText::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_inputBotInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_inputBotInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineResult::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -4982,24 +5046,24 @@ void _serialize_inputBotInlineResult(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_title) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 4: to.add(" description: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_description) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 5: to.add(" url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 6: to.add(" thumb_url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_thumb_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 7: to.add(" content_url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_content_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 8: to.add(" content_type: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_content_type) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 9: to.add(" w: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_w) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 10: to.add(" h: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_h) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 11: to.add(" duration: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::flag_duration) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_title) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" description: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_description) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 5: to.add(" url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 6: to.add(" thumb_url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_thumb_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 7: to.add(" content_url: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_content_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 8: to.add(" content_type: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_content_type) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 9: to.add(" w: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_w) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 10: to.add(" h: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_h) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 11: to.add(" duration: "); ++stages.back(); if (flag & MTPDinputBotInlineResult::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; case 12: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5007,12 +5071,14 @@ void _serialize_botInlineMessageMediaAuto(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineMessageText::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5020,15 +5086,15 @@ void _serialize_botInlineMessageText(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::flag_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::Flag::f_no_webpage) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" entities: "); ++stages.back(); if (flag & MTPDbotInlineMessageText::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInlineMediaResultDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInlineMediaResultDocument(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5036,15 +5102,15 @@ void _serialize_botInlineMediaResultDocument(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" document: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInlineMediaResultPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInlineMediaResultPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5052,15 +5118,17 @@ void _serialize_botInlineMediaResultPhoto(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_botInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_botInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDbotInlineResult::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5068,24 +5136,26 @@ void _serialize_botInlineResult(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_title) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 4: to.add(" description: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_description) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 5: to.add(" url: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 6: to.add(" thumb_url: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_thumb_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 7: to.add(" content_url: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_content_url) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 8: to.add(" content_type: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_content_type) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 9: to.add(" w: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_w) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 10: to.add(" h: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_h) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 11: to.add(" duration: "); ++stages.back(); if (flag & MTPDbotInlineResult::flag_duration) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" title: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_title) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" description: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_description) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 5: to.add(" url: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 6: to.add(" thumb_url: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_thumb_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 7: to.add(" content_url: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_content_url) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 8: to.add(" content_type: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_content_type) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 9: to.add(" w: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_w) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 10: to.add(" h: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_h) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 11: to.add(" duration: "); ++stages.back(); if (flag & MTPDbotInlineResult::Flag::f_duration) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; case 12: to.add(" send_message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_botResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_botResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDmessages_botResults::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5093,16 +5163,16 @@ void _serialize_messages_botResults(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" gallery: "); ++stages.back(); if (flag & MTPDmessages_botResults::flag_gallery) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" next_offset: "); ++stages.back(); if (flag & MTPDmessages_botResults::flag_next_offset) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" gallery: "); ++stages.back(); if (flag & MTPDmessages_botResults::Flag::f_gallery) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" next_offset: "); ++stages.back(); if (flag & MTPDmessages_botResults::Flag::f_next_offset) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 4: to.add(" results: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_exportedMessageLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_exportedMessageLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5110,12 +5180,14 @@ void _serialize_exportedMessageLink(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" link: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" link: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messageFwdHeader(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messageFwdHeader(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDmessageFwdHeader::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5123,16 +5195,18 @@ void _serialize_messageFwdHeader(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" channel_id: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::flag_channel_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 4: to.add(" channel_post: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::flag_channel_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::Flag::f_from_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" channel_id: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::Flag::f_channel_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 4: to.add(" channel_post: "); ++stages.back(); if (flag & MTPDmessageFwdHeader::Flag::f_channel_post) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_messageEditData(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_messageEditData(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDchannels_messageEditData::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5140,25 +5214,25 @@ void _serialize_channels_messageEditData(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::flag_caption) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::Flag::f_caption) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_codeTypeSms(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_codeTypeSms(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_codeTypeSms }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_auth_codeTypeCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_codeTypeCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_codeTypeCall }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_auth_codeTypeFlashCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_codeTypeFlashCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_codeTypeFlashCall }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_auth_sentCodeTypeApp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sentCodeTypeApp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5166,12 +5240,12 @@ void _serialize_auth_sentCodeTypeApp(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_sentCodeTypeSms(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sentCodeTypeSms(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5179,12 +5253,12 @@ void _serialize_auth_sentCodeTypeSms(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_sentCodeTypeCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sentCodeTypeCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5192,12 +5266,12 @@ void _serialize_auth_sentCodeTypeCall(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_sentCodeTypeFlashCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sentCodeTypeFlashCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5205,12 +5279,12 @@ void _serialize_auth_sentCodeTypeFlashCall(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pattern: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pattern: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5218,12 +5292,12 @@ void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_req_DH_params(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_req_DH_params(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5231,17 +5305,17 @@ void _serialize_req_DH_params(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" p: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" public_key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" encrypted_data: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" p: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" public_key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" encrypted_data: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_set_client_DH_params(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_set_client_DH_params(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5249,14 +5323,14 @@ void _serialize_set_client_DH_params(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" encrypted_data: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" server_nonce: "); ++stages.back(); types.push_back(mtpc_int128+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" encrypted_data: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_rpc_drop_answer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_drop_answer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5264,12 +5338,12 @@ void _serialize_rpc_drop_answer(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_get_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_get_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5277,12 +5351,12 @@ void _serialize_get_future_salts(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" num: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" num: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_ping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_ping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5290,12 +5364,12 @@ void _serialize_ping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_ping_delay_disconnect(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_ping_delay_disconnect(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5303,13 +5377,13 @@ void _serialize_ping_delay_disconnect(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" disconnect_delay: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" ping_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" disconnect_delay: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_destroy_session(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_destroy_session(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5317,12 +5391,12 @@ void _serialize_destroy_session(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" session_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_register_saveDeveloperInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_register_saveDeveloperInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5330,24 +5404,24 @@ void _serialize_register_saveDeveloperInfo(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" email: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" age: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" city: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" email: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" age: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" city: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_logOut(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_logOut(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_logOut }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_auth_resetAuthorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_resetAuthorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_resetAuthorizations }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_auth_sendInvites(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sendInvites(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5355,13 +5429,13 @@ void _serialize_auth_sendInvites(MTPStringLogger &to, int32 stage, int32 lev, Ty to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_numbers: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_string); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_numbers: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_string+0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_bindTempAuthKey(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_bindTempAuthKey(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5369,15 +5443,15 @@ void _serialize_auth_bindTempAuthKey(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" perm_auth_key_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" expires_at: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" encrypted_message: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" perm_auth_key_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" nonce: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" expires_at: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" encrypted_message: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_cancelCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_cancelCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5385,13 +5459,13 @@ void _serialize_auth_cancelCode(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_registerDevice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_registerDevice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5399,18 +5473,18 @@ void _serialize_account_registerDevice(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" token_type: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" token: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" token_type: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" token: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 5: to.add(" app_sandbox: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_unregisterDevice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_unregisterDevice(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5418,13 +5492,13 @@ void _serialize_account_unregisterDevice(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" token_type: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" token: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" token_type: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" token: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updateNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5438,11 +5512,11 @@ void _serialize_account_updateNotifySettings(MTPStringLogger &to, int32 stage, i } } -void _serialize_account_resetNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_resetNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ account_resetNotifySettings }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_updateStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updateStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5455,7 +5529,7 @@ void _serialize_account_updateStatus(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_account_reportPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_reportPeer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5469,7 +5543,7 @@ void _serialize_account_reportPeer(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_account_checkUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_checkUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5477,12 +5551,12 @@ void _serialize_account_checkUsername(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_deleteAccount(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_deleteAccount(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5490,12 +5564,12 @@ void _serialize_account_deleteAccount(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" reason: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" reason: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_setAccountTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_setAccountTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5508,7 +5582,7 @@ void _serialize_account_setAccountTTL(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_account_updateDeviceLocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updateDeviceLocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5516,12 +5590,12 @@ void _serialize_account_updateDeviceLocked(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" period: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" period: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_resetAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_resetAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5529,12 +5603,12 @@ void _serialize_account_resetAuthorization(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_updatePasswordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updatePasswordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5542,13 +5616,13 @@ void _serialize_account_updatePasswordSettings(MTPStringLogger &to, int32 stage, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" current_password_hash: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" current_password_hash: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" new_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_deleteContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_deleteContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5561,7 +5635,7 @@ void _serialize_contacts_deleteContacts(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_contacts_block(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_block(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5574,7 +5648,7 @@ void _serialize_contacts_block(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_contacts_unblock(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_unblock(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5587,7 +5661,7 @@ void _serialize_contacts_unblock(MTPStringLogger &to, int32 stage, int32 lev, Ty } } -void _serialize_messages_setTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_setTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5601,7 +5675,7 @@ void _serialize_messages_setTyping(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_messages_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5614,7 +5688,7 @@ void _serialize_messages_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_messages_hideReportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_hideReportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5627,7 +5701,7 @@ void _serialize_messages_hideReportSpam(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_messages_discardEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_discardEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5635,12 +5709,12 @@ void _serialize_messages_discardEncryption(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_setEncryptedTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_setEncryptedTyping(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5654,7 +5728,7 @@ void _serialize_messages_setEncryptedTyping(MTPStringLogger &to, int32 stage, in } } -void _serialize_messages_readEncryptedHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_readEncryptedHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5663,12 +5737,12 @@ void _serialize_messages_readEncryptedHistory(MTPStringLogger &to, int32 stage, } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_installStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_installStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5682,7 +5756,7 @@ void _serialize_messages_installStickerSet(MTPStringLogger &to, int32 stage, int } } -void _serialize_messages_uninstallStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_uninstallStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5695,7 +5769,7 @@ void _serialize_messages_uninstallStickerSet(MTPStringLogger &to, int32 stage, i } } -void _serialize_messages_editChatAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_editChatAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5703,14 +5777,14 @@ void _serialize_messages_editChatAdmin(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" is_admin: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_reorderStickerSets(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_reorderStickerSets(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5718,12 +5792,12 @@ void _serialize_messages_reorderStickerSets(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" order: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" order: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_saveGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_saveGif(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5737,7 +5811,9 @@ void _serialize_messages_saveGif(MTPStringLogger &to, int32 stage, int32 lev, Ty } } -void _serialize_messages_setInlineBotResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_setInlineBotResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_setInlineBotResults::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5745,18 +5821,18 @@ void _serialize_messages_setInlineBotResults(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" gallery: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::flag_gallery) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" private: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::flag_private) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" gallery: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::Flag::f_gallery) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" private: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::Flag::f_private) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" results: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" cache_time: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" next_offset: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::flag_next_offset) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 5: to.add(" cache_time: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" next_offset: "); ++stages.back(); if (flag & MTPmessages_setInlineBotResults::Flag::f_next_offset) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_upload_saveFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_upload_saveFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5764,14 +5840,14 @@ void _serialize_upload_saveFilePart(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" file_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" file_part: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" file_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" file_part: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_upload_saveBigFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_upload_saveBigFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5779,15 +5855,15 @@ void _serialize_upload_saveBigFilePart(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" file_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" file_part: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" file_total_parts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" file_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" file_part: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" file_total_parts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_saveAppLog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_saveAppLog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5800,7 +5876,7 @@ void _serialize_help_saveAppLog(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_channels_readHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_readHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5809,12 +5885,12 @@ void _serialize_channels_readHistory(MTPStringLogger &to, int32 stage, int32 lev } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5824,12 +5900,12 @@ void _serialize_channels_reportSpam(MTPStringLogger &to, int32 stage, int32 lev, switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_editAbout(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_editAbout(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5838,12 +5914,12 @@ void _serialize_channels_editAbout(MTPStringLogger &to, int32 stage, int32 lev, } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_checkUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_checkUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5852,12 +5928,12 @@ void _serialize_channels_checkUsername(MTPStringLogger &to, int32 stage, int32 l } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_updateUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_updateUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5866,12 +5942,12 @@ void _serialize_channels_updateUsername(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_invokeAfterMsg(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_invokeAfterMsg(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5879,13 +5955,13 @@ void _serialize_invokeAfterMsg(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" query: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_invokeAfterMsgs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_invokeAfterMsgs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5893,13 +5969,13 @@ void _serialize_invokeAfterMsgs(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" msg_ids: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" query: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_initConnection(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_initConnection(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5907,17 +5983,17 @@ void _serialize_initConnection(MTPStringLogger &to, int32 stage, int32 lev, Type to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 5: to.add(" query: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_invokeWithLayer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_invokeWithLayer(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5925,13 +6001,13 @@ void _serialize_invokeWithLayer(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" layer: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" layer: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" query: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_invokeWithoutUpdates(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_invokeWithoutUpdates(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5944,7 +6020,7 @@ void _serialize_invokeWithoutUpdates(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_auth_checkPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_checkPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5952,12 +6028,14 @@ void _serialize_auth_checkPhone(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_sendCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_sendCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPauth_sendCode::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5965,18 +6043,18 @@ void _serialize_auth_sendCode(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" allow_flashcall: "); ++stages.back(); if (flag & MTPauth_sendCode::flag_allow_flashcall) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" current_number: "); ++stages.back(); if (flag & MTPauth_sendCode::flag_current_number) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 4: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" api_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" allow_flashcall: "); ++stages.back(); if (flag & MTPauth_sendCode::Flag::f_allow_flashcall) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" current_number: "); ++stages.back(); if (flag & MTPauth_sendCode::Flag::f_current_number) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 4: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" api_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_resendCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_resendCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5984,13 +6062,15 @@ void _serialize_auth_resendCode(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_sendChangePhoneCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_sendChangePhoneCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPaccount_sendChangePhoneCode::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5998,15 +6078,15 @@ void _serialize_account_sendChangePhoneCode(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" allow_flashcall: "); ++stages.back(); if (flag & MTPaccount_sendChangePhoneCode::flag_allow_flashcall) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" current_number: "); ++stages.back(); if (flag & MTPaccount_sendChangePhoneCode::flag_current_number) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" allow_flashcall: "); ++stages.back(); if (flag & MTPaccount_sendChangePhoneCode::Flag::f_allow_flashcall) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" current_number: "); ++stages.back(); if (flag & MTPaccount_sendChangePhoneCode::Flag::f_current_number) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_signUp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_signUp(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6014,16 +6094,16 @@ void _serialize_auth_signUp(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" first_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" last_name: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_signIn(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_signIn(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6031,14 +6111,14 @@ void _serialize_auth_signIn(MTPStringLogger &to, int32 stage, int32 lev, Types & to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_importAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_importAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6046,13 +6126,13 @@ void _serialize_auth_importAuthorization(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_importBotAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_importBotAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6060,15 +6140,15 @@ void _serialize_auth_importBotAuthorization(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" api_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" bot_auth_token: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" api_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" api_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" bot_auth_token: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_checkPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_checkPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6076,12 +6156,12 @@ void _serialize_auth_checkPassword(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" password_hash: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" password_hash: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_recoverPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_recoverPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6089,12 +6169,12 @@ void _serialize_auth_recoverPassword(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_exportAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_exportAuthorization(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6102,16 +6182,16 @@ void _serialize_auth_exportAuthorization(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" dc_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_auth_requestPasswordRecovery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_auth_requestPasswordRecovery(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ auth_requestPasswordRecovery }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_getNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6124,7 +6204,9 @@ void _serialize_account_getNotifySettings(MTPStringLogger &to, int32 stage, int3 } } -void _serialize_account_updateProfile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updateProfile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPaccount_updateProfile::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6132,15 +6214,15 @@ void _serialize_account_updateProfile(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" first_name: "); ++stages.back(); if (flag & MTPaccount_updateProfile::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" last_name: "); ++stages.back(); if (flag & MTPaccount_updateProfile::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" about: "); ++stages.back(); if (flag & MTPaccount_updateProfile::flag_about) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" first_name: "); ++stages.back(); if (flag & MTPaccount_updateProfile::Flag::f_first_name) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" last_name: "); ++stages.back(); if (flag & MTPaccount_updateProfile::Flag::f_last_name) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" about: "); ++stages.back(); if (flag & MTPaccount_updateProfile::Flag::f_about) { types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_updateUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_updateUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6148,12 +6230,12 @@ void _serialize_account_updateUsername(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_changePhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_changePhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6161,14 +6243,14 @@ void _serialize_account_changePhone(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" phone_number: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" phone_code_hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" phone_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_importCard(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_importCard(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6176,16 +6258,16 @@ void _serialize_contacts_importCard(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" export_card: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" export_card: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_account_getWallPapers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getWallPapers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ account_getWallPapers }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_getPrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getPrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6198,7 +6280,7 @@ void _serialize_account_getPrivacy(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_account_setPrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_setPrivacy(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6212,19 +6294,19 @@ void _serialize_account_setPrivacy(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_account_getAccountTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getAccountTTL(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ account_getAccountTTL }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_getAuthorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getAuthorizations(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ account_getAuthorizations }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_getPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getPassword(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ account_getPassword }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_account_getPasswordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_account_getPasswordSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6232,12 +6314,12 @@ void _serialize_account_getPasswordSettings(MTPStringLogger &to, int32 stage, in to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" current_password_hash: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" current_password_hash: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_users_getUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_users_getUsers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6250,7 +6332,7 @@ void _serialize_users_getUsers(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_users_getFullUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_users_getFullUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6263,11 +6345,11 @@ void _serialize_users_getFullUser(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_contacts_getStatuses(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_getStatuses(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contacts_getStatuses }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_contacts_getContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_getContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6275,12 +6357,12 @@ void _serialize_contacts_getContacts(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_importContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_importContacts(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6294,7 +6376,7 @@ void _serialize_contacts_importContacts(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_contacts_deleteContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_deleteContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6307,7 +6389,7 @@ void _serialize_contacts_deleteContact(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_contacts_getBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_getBlocked(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6315,17 +6397,17 @@ void _serialize_contacts_getBlocked(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_exportCard(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_exportCard(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ contacts_exportCard }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_messages_getMessagesViews(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getMessagesViews(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6334,13 +6416,13 @@ void _serialize_messages_getMessagesViews(MTPStringLogger &to, int32 stage, int3 } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" increment: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_search(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_search(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6348,13 +6430,13 @@ void _serialize_contacts_search(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_contacts_resolveUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_contacts_resolveUsername(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6362,12 +6444,12 @@ void _serialize_contacts_resolveUsername(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" username: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6375,12 +6457,12 @@ void _serialize_messages_getMessages(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6389,17 +6471,19 @@ void _serialize_messages_getHistory(MTPStringLogger &to, int32 stage, int32 lev, } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" add_offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" add_offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_search(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_search(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_search::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6407,21 +6491,21 @@ void _serialize_messages_search(MTPStringLogger &to, int32 stage, int32 lev, Typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPmessages_search::flag_important_only) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPmessages_search::Flag::f_important_only) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" min_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" min_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_searchGlobal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_searchGlobal(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6429,16 +6513,16 @@ void _serialize_messages_searchGlobal(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" offset_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getImportantHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getImportantHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6447,17 +6531,17 @@ void _serialize_channels_getImportantHistory(MTPStringLogger &to, int32 stage, i } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" add_offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" add_offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" min_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6466,12 +6550,12 @@ void _serialize_channels_getMessages(MTPStringLogger &to, int32 stage, int32 lev } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6479,15 +6563,15 @@ void _serialize_messages_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset_date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" offset_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6495,13 +6579,13 @@ void _serialize_channels_getDialogs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_readHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_readHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6510,12 +6594,12 @@ void _serialize_messages_readHistory(MTPStringLogger &to, int32 stage, int32 lev } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_deleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_deleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6523,12 +6607,12 @@ void _serialize_messages_deleteMessages(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_readMessageContents(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_readMessageContents(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6536,12 +6620,12 @@ void _serialize_messages_readMessageContents(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_deleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_deleteMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6550,12 +6634,12 @@ void _serialize_channels_deleteMessages(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_deleteHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_deleteHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6564,12 +6648,12 @@ void _serialize_messages_deleteHistory(MTPStringLogger &to, int32 stage, int32 l } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_deleteUserHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_deleteUserHistory(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6583,7 +6667,7 @@ void _serialize_channels_deleteUserHistory(MTPStringLogger &to, int32 stage, int } } -void _serialize_messages_receivedMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_receivedMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6591,12 +6675,14 @@ void _serialize_messages_receivedMessages(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_sendMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6604,22 +6690,24 @@ void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_no_webpage) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 2: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 3: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 4: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_no_webpage) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 2: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 3: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 4: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 5: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 7: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 10: to.add(" entities: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 6: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 7: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 9: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 10: to.add(" entities: "); ++stages.back(); if (flag & MTPmessages_sendMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendMedia(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendMedia(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_sendMedia::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6627,20 +6715,22 @@ void _serialize_messages_sendMedia(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendMedia::flag_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendMedia::flag_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendMedia::flag_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendMedia::Flag::f_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendMedia::Flag::f_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendMedia::Flag::f_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 4: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMedia::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 5: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMedia::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 6: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMedia::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; + case 7: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMedia::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_forwardMessages::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6648,19 +6738,19 @@ void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::flag_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::flag_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::flag_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::Flag::f_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::Flag::f_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::Flag::f_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 4: to.add(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; case 7: to.add(" to_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_editChatTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_editChatTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6668,13 +6758,13 @@ void _serialize_messages_editChatTitle(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_editChatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_editChatPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6682,13 +6772,13 @@ void _serialize_messages_editChatPhoto(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_addChatUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_addChatUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6696,14 +6786,14 @@ void _serialize_messages_addChatUser(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" fwd_limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" fwd_limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_deleteChatUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_deleteChatUser(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6711,13 +6801,13 @@ void _serialize_messages_deleteChatUser(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_createChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_createChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6726,12 +6816,12 @@ void _serialize_messages_createChat(MTPStringLogger &to, int32 stage, int32 lev, } switch (stage) { case 0: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_forwardMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_forwardMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6740,13 +6830,13 @@ void _serialize_messages_forwardMessage(MTPStringLogger &to, int32 stage, int32 } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendBroadcast(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendBroadcast(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6755,14 +6845,14 @@ void _serialize_messages_sendBroadcast(MTPStringLogger &to, int32 stage, int32 l } switch (stage) { case 0: to.add(" contacts: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long+0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_importChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_importChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6770,12 +6860,12 @@ void _serialize_messages_importChatInvite(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_startBot(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_startBot(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6785,13 +6875,13 @@ void _serialize_messages_startBot(MTPStringLogger &to, int32 stage, int32 lev, T switch (stage) { case 0: to.add(" bot: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" start_param: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" start_param: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_toggleChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_toggleChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6799,13 +6889,13 @@ void _serialize_messages_toggleChatAdmins(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" enabled: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_migrateChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_migrateChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6813,12 +6903,14 @@ void _serialize_messages_migrateChat(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendInlineBotResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendInlineBotResult(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPmessages_sendInlineBotResult::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6826,20 +6918,22 @@ void _serialize_messages_sendInlineBotResult(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::flag_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::flag_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::flag_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::Flag::f_broadcast) { to.add("YES [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; + case 2: to.add(" silent: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::Flag::f_silent) { to.add("YES [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; + case 3: to.add(" background: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::Flag::f_background) { to.add("YES [ BY BIT 6 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 4: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 6: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendInlineBotResult::Flag::f_reply_to_msg_id) { types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 6: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 7: to.add(" query_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 8: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_createChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_createChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPchannels_createChannel::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6847,16 +6941,16 @@ void _serialize_channels_createChannel(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPchannels_createChannel::flag_broadcast) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 2: to.add(" megagroup: "); ++stages.back(); if (flag & MTPchannels_createChannel::flag_megagroup) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 3: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPchannels_createChannel::Flag::f_broadcast) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 2: to.add(" megagroup: "); ++stages.back(); if (flag & MTPchannels_createChannel::Flag::f_megagroup) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 3: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_editAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_editAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6871,7 +6965,7 @@ void _serialize_channels_editAdmin(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_channels_editTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_editTitle(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6880,12 +6974,12 @@ void _serialize_channels_editTitle(MTPStringLogger &to, int32 stage, int32 lev, } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_editPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_editPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6899,7 +6993,7 @@ void _serialize_channels_editPhoto(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_channels_toggleComments(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_toggleComments(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6913,7 +7007,7 @@ void _serialize_channels_toggleComments(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_channels_joinChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_joinChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6926,7 +7020,7 @@ void _serialize_channels_joinChannel(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_channels_leaveChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_leaveChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6939,7 +7033,7 @@ void _serialize_channels_leaveChannel(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_channels_inviteToChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_inviteToChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6953,7 +7047,7 @@ void _serialize_channels_inviteToChannel(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_channels_kickFromChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_kickFromChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6968,7 +7062,7 @@ void _serialize_channels_kickFromChannel(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_channels_deleteChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_deleteChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6981,7 +7075,7 @@ void _serialize_channels_deleteChannel(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_channels_toggleInvites(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_toggleInvites(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -6995,7 +7089,7 @@ void _serialize_channels_toggleInvites(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_channels_toggleSignatures(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_toggleSignatures(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7009,7 +7103,9 @@ void _serialize_channels_toggleSignatures(MTPStringLogger &to, int32 stage, int3 } } -void _serialize_channels_editMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_editMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPchannels_editMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7017,17 +7113,19 @@ void _serialize_channels_editMessage(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPchannels_editMessage::flag_no_webpage) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPchannels_editMessage::Flag::f_no_webpage) { to.add("YES [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; case 2: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" entities: "); ++stages.back(); if (flag & MTPchannels_editMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" entities: "); ++stages.back(); if (flag & MTPchannels_editMessage::Flag::f_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_updatePinnedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_updatePinnedMessage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPchannels_updatePinnedMessage::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7035,15 +7133,15 @@ void _serialize_channels_updatePinnedMessage(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" silent: "); ++stages.back(); if (flag & MTPchannels_updatePinnedMessage::flag_silent) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" silent: "); ++stages.back(); if (flag & MTPchannels_updatePinnedMessage::Flag::f_silent) { to.add("YES [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; case 2: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getPeerSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getPeerSettings(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7056,7 +7154,7 @@ void _serialize_messages_getPeerSettings(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_messages_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7064,12 +7162,12 @@ void _serialize_messages_getChats(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int+0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getChannels(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getChannels(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7082,7 +7180,7 @@ void _serialize_channels_getChannels(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_messages_getFullChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getFullChat(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7090,12 +7188,12 @@ void _serialize_messages_getFullChat(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getFullChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getFullChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7108,7 +7206,7 @@ void _serialize_channels_getFullChannel(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_messages_getDhConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getDhConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7116,13 +7214,13 @@ void _serialize_messages_getDhConfig(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_length: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_length: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_requestEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_requestEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7131,13 +7229,13 @@ void _serialize_messages_requestEncryption(MTPStringLogger &to, int32 stage, int } switch (stage) { case 0: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" g_a: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_acceptEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_acceptEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7146,13 +7244,13 @@ void _serialize_messages_acceptEncryption(MTPStringLogger &to, int32 stage, int3 } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" g_b: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" g_b: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" key_fingerprint: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendEncrypted(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendEncrypted(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7161,13 +7259,13 @@ void _serialize_messages_sendEncrypted(MTPStringLogger &to, int32 stage, int32 l } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendEncryptedFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7176,14 +7274,14 @@ void _serialize_messages_sendEncryptedFile(MTPStringLogger &to, int32 stage, int } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_sendEncryptedService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_sendEncryptedService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7192,13 +7290,13 @@ void _serialize_messages_sendEncryptedService(MTPStringLogger &to, int32 stage, } switch (stage) { case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" data: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_receivedQueue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_receivedQueue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7206,12 +7304,12 @@ void _serialize_messages_receivedQueue(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" max_qts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" max_qts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photos_deletePhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_deletePhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7224,7 +7322,7 @@ void _serialize_photos_deletePhotos(MTPStringLogger &to, int32 stage, int32 lev, } } -void _serialize_messages_getStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7232,13 +7330,13 @@ void _serialize_messages_getStickers(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" emoticon: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" emoticon: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getAllStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getAllStickers(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7246,12 +7344,12 @@ void _serialize_messages_getAllStickers(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getWebPagePreview(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getWebPagePreview(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7259,12 +7357,12 @@ void _serialize_messages_getWebPagePreview(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_exportChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_exportChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7272,12 +7370,12 @@ void _serialize_messages_exportChatInvite(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_exportInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_exportInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7290,7 +7388,7 @@ void _serialize_channels_exportInvite(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_messages_checkChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_checkChatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7298,12 +7396,12 @@ void _serialize_messages_checkChatInvite(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getStickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7316,7 +7414,7 @@ void _serialize_messages_getStickerSet(MTPStringLogger &to, int32 stage, int32 l } } -void _serialize_messages_getDocumentByHash(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getDocumentByHash(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7324,14 +7422,14 @@ void _serialize_messages_getDocumentByHash(MTPStringLogger &to, int32 stage, int to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" sha256: "); ++stages.back(); types.push_back(mtpc_bytes); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" sha256: "); ++stages.back(); types.push_back(mtpc_bytes+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_searchGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_searchGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7339,13 +7437,13 @@ void _serialize_messages_searchGifs(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getSavedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getSavedGifs(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7353,12 +7451,12 @@ void _serialize_messages_getSavedGifs(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_messages_getInlineBotResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_messages_getInlineBotResults(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7367,17 +7465,17 @@ void _serialize_messages_getInlineBotResults(MTPStringLogger &to, int32 stage, i } switch (stage) { case 0: to.add(" bot: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" query: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_getState(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_getState(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_updates_getDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_getDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7385,14 +7483,14 @@ void _serialize_updates_getDifference(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" qts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_updates_getChannelDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_updates_getChannelDifference(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7402,13 +7500,13 @@ void _serialize_updates_getChannelDifference(MTPStringLogger &to, int32 stage, i switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photos_updateProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_updateProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7422,7 +7520,7 @@ void _serialize_photos_updateProfilePhoto(MTPStringLogger &to, int32 stage, int3 } } -void _serialize_photos_uploadProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_uploadProfilePhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7431,14 +7529,14 @@ void _serialize_photos_uploadProfilePhoto(MTPStringLogger &to, int32 stage, int3 } switch (stage) { case 0: to.add(" file: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" crop: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_photos_getUserPhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_photos_getUserPhotos(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7447,14 +7545,14 @@ void _serialize_photos_getUserPhotos(MTPStringLogger &to, int32 stage, int32 lev } switch (stage) { case 0: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_long+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_upload_getFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_upload_getFile(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7463,21 +7561,21 @@ void _serialize_upload_getFile(MTPStringLogger &to, int32 stage, int32 lev, Type } switch (stage) { case 0: to.add(" location: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_getConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getConfig(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ help_getConfig }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_help_getNearestDc(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getNearestDc(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ help_getNearestDc }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_help_getAppUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getAppUpdate(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7485,15 +7583,15 @@ void _serialize_help_getAppUpdate(MTPStringLogger &to, int32 stage, int32 lev, T to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_getInviteText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getInviteText(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7501,16 +7599,16 @@ void _serialize_help_getInviteText(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_getSupport(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getSupport(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { to.add("{ help_getSupport }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_help_getAppChangelog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getAppChangelog(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7518,15 +7616,15 @@ void _serialize_help_getAppChangelog(MTPStringLogger &to, int32 stage, int32 lev to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" device_model: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" system_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" app_version: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_help_getTermsOfService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_help_getTermsOfService(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7534,12 +7632,12 @@ void _serialize_help_getTermsOfService(MTPStringLogger &to, int32 stage, int32 l to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" lang_code: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getParticipants(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7549,13 +7647,13 @@ void _serialize_channels_getParticipants(MTPStringLogger &to, int32 stage, int32 switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 1: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getParticipant(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7569,7 +7667,7 @@ void _serialize_channels_getParticipant(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_channels_exportMessageLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_exportMessageLink(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7578,12 +7676,12 @@ void _serialize_channels_exportMessageLink(MTPStringLogger &to, int32 stage, int } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_channels_getMessageEditData(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_channels_getMessageEditData(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7592,12 +7690,12 @@ void _serialize_channels_getMessageEditData(MTPStringLogger &to, int32 stage, in } switch (stage) { case 0: to.add(" channel: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } -void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7611,7 +7709,7 @@ void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &t } } -void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7624,7 +7722,7 @@ void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { +void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -7641,7 +7739,7 @@ void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types } namespace { - typedef void(*mtpTextSerializer)(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag); + typedef void(*mtpTextSerializer)(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag); typedef QMap TextSerializers; TextSerializers _serializers; diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index db65f2378..7c487353c 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -26,6 +26,13 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "mtpCoreTypes.h" +// Creator proxy class declaration +namespace MTP { +namespace internal { + class TypeCreator; +} +} + // Type id constants enum { mtpc_resPQ = 0x05162463, @@ -1459,7 +1466,7 @@ public: private: explicit MTPresPQ(MTPDresPQ *_data); - friend MTPresPQ MTP_resPQ(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_pq, const MTPVector &_server_public_key_fingerprints); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPResPQ; @@ -1490,7 +1497,7 @@ public: private: explicit MTPp_Q_inner_data(MTPDp_q_inner_data *_data); - friend MTPp_Q_inner_data MTP_p_q_inner_data(const MTPstring &_pq, const MTPstring &_p, const MTPstring &_q, const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint256 &_new_nonce); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPP_Q_inner_data; @@ -1538,8 +1545,8 @@ private: explicit MTPserver_DH_Params(MTPDserver_DH_params_fail *_data); explicit MTPserver_DH_Params(MTPDserver_DH_params_ok *_data); - friend MTPserver_DH_Params MTP_server_DH_params_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash); - friend MTPserver_DH_Params MTP_server_DH_params_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_encrypted_answer); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -1572,7 +1579,7 @@ public: private: explicit MTPserver_DH_inner_data(MTPDserver_DH_inner_data *_data); - friend MTPserver_DH_inner_data MTP_server_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, MTPint _g, const MTPstring &_dh_prime, const MTPstring &_g_a, MTPint _server_time); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPServer_DH_inner_data; @@ -1603,7 +1610,7 @@ public: private: explicit MTPclient_DH_Inner_Data(MTPDclient_DH_inner_data *_data); - friend MTPclient_DH_Inner_Data MTP_client_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPlong &_retry_id, const MTPstring &_g_b); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPClient_DH_Inner_Data; @@ -1664,9 +1671,9 @@ private: explicit MTPset_client_DH_params_answer(MTPDdh_gen_retry *_data); explicit MTPset_client_DH_params_answer(MTPDdh_gen_fail *_data); - friend MTPset_client_DH_params_answer MTP_dh_gen_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash1); - friend MTPset_client_DH_params_answer MTP_dh_gen_retry(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash2); - friend MTPset_client_DH_params_answer MTP_dh_gen_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash3); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -1699,7 +1706,7 @@ public: private: explicit MTPmsgsAck(MTPDmsgs_ack *_data); - friend MTPmsgsAck MTP_msgs_ack(const MTPVector &_msg_ids); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMsgsAck; @@ -1747,8 +1754,8 @@ private: explicit MTPbadMsgNotification(MTPDbad_msg_notification *_data); explicit MTPbadMsgNotification(MTPDbad_server_salt *_data); - friend MTPbadMsgNotification MTP_bad_msg_notification(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code); - friend MTPbadMsgNotification MTP_bad_server_salt(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code, const MTPlong &_new_server_salt); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -1781,7 +1788,7 @@ public: private: explicit MTPmsgsStateReq(MTPDmsgs_state_req *_data); - friend MTPmsgsStateReq MTP_msgs_state_req(const MTPVector &_msg_ids); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMsgsStateReq; @@ -1812,7 +1819,7 @@ public: private: explicit MTPmsgsStateInfo(MTPDmsgs_state_info *_data); - friend MTPmsgsStateInfo MTP_msgs_state_info(const MTPlong &_req_msg_id, const MTPstring &_info); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMsgsStateInfo; @@ -1843,7 +1850,7 @@ public: private: explicit MTPmsgsAllInfo(MTPDmsgs_all_info *_data); - friend MTPmsgsAllInfo MTP_msgs_all_info(const MTPVector &_msg_ids, const MTPstring &_info); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMsgsAllInfo; @@ -1891,8 +1898,8 @@ private: explicit MTPmsgDetailedInfo(MTPDmsg_detailed_info *_data); explicit MTPmsgDetailedInfo(MTPDmsg_new_detailed_info *_data); - friend MTPmsgDetailedInfo MTP_msg_detailed_info(const MTPlong &_msg_id, const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status); - friend MTPmsgDetailedInfo MTP_msg_new_detailed_info(const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -1925,7 +1932,7 @@ public: private: explicit MTPmsgResendReq(MTPDmsg_resend_req *_data); - friend MTPmsgResendReq MTP_msg_resend_req(const MTPVector &_msg_ids); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMsgResendReq; @@ -1956,7 +1963,7 @@ public: private: explicit MTPrpcError(MTPDrpc_error *_data); - friend MTPrpcError MTP_rpc_error(MTPint _error_code, const MTPstring &_error_message); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPRpcError; @@ -1991,9 +1998,9 @@ private: explicit MTPrpcDropAnswer(mtpTypeId type); explicit MTPrpcDropAnswer(MTPDrpc_answer_dropped *_data); - friend MTPrpcDropAnswer MTP_rpc_answer_unknown(); - friend MTPrpcDropAnswer MTP_rpc_answer_dropped_running(); - friend MTPrpcDropAnswer MTP_rpc_answer_dropped(const MTPlong &_msg_id, MTPint _seq_no, MTPint _bytes); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2026,7 +2033,7 @@ public: private: explicit MTPfutureSalt(MTPDfuture_salt *_data); - friend MTPfutureSalt MTP_future_salt(MTPint _valid_since, MTPint _valid_until, const MTPlong &_salt); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPFutureSalt; @@ -2057,7 +2064,7 @@ public: private: explicit MTPfutureSalts(MTPDfuture_salts *_data); - friend MTPfutureSalts MTP_future_salts(const MTPlong &_req_msg_id, MTPint _now, const MTPvector &_salts); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPFutureSalts; @@ -2088,7 +2095,7 @@ public: private: explicit MTPpong(MTPDpong *_data); - friend MTPpong MTP_pong(const MTPlong &_msg_id, const MTPlong &_ping_id); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPPong; @@ -2136,8 +2143,8 @@ private: explicit MTPdestroySessionRes(MTPDdestroy_session_ok *_data); explicit MTPdestroySessionRes(MTPDdestroy_session_none *_data); - friend MTPdestroySessionRes MTP_destroy_session_ok(const MTPlong &_session_id); - friend MTPdestroySessionRes MTP_destroy_session_none(const MTPlong &_session_id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2170,7 +2177,7 @@ public: private: explicit MTPnewSession(MTPDnew_session_created *_data); - friend MTPnewSession MTP_new_session_created(const MTPlong &_first_msg_id, const MTPlong &_unique_id, const MTPlong &_server_salt); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPNewSession; @@ -2201,7 +2208,7 @@ public: private: explicit MTPhttpWait(MTPDhttp_wait *_data); - friend MTPhttpWait MTP_http_wait(MTPint _max_delay, MTPint _wait_after, MTPint _max_wait); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPHttpWait; @@ -2223,8 +2230,8 @@ public: private: explicit MTPbool(mtpTypeId type); - friend MTPbool MTP_boolFalse(); - friend MTPbool MTP_boolTrue(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2247,7 +2254,7 @@ public: private: - friend MTPtrue MTP_true(); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPTrue; @@ -2278,7 +2285,7 @@ public: private: explicit MTPerror(MTPDerror *_data); - friend MTPerror MTP_error(MTPint _code, const MTPstring &_text); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPError; @@ -2299,7 +2306,7 @@ public: private: - friend MTPnull MTP_null(); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPNull; @@ -2360,11 +2367,11 @@ private: explicit MTPinputPeer(MTPDinputPeerUser *_data); explicit MTPinputPeer(MTPDinputPeerChannel *_data); - friend MTPinputPeer MTP_inputPeerEmpty(); - friend MTPinputPeer MTP_inputPeerSelf(); - friend MTPinputPeer MTP_inputPeerChat(MTPint _chat_id); - friend MTPinputPeer MTP_inputPeerUser(MTPint _user_id, const MTPlong &_access_hash); - friend MTPinputPeer MTP_inputPeerChannel(MTPint _channel_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2401,9 +2408,9 @@ private: explicit MTPinputUser(mtpTypeId type); explicit MTPinputUser(MTPDinputUser *_data); - friend MTPinputUser MTP_inputUserEmpty(); - friend MTPinputUser MTP_inputUserSelf(); - friend MTPinputUser MTP_inputUser(MTPint _user_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2436,7 +2443,7 @@ public: private: explicit MTPinputContact(MTPDinputPhoneContact *_data); - friend MTPinputContact MTP_inputPhoneContact(const MTPlong &_client_id, const MTPstring &_phone, const MTPstring &_first_name, const MTPstring &_last_name); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPInputContact; @@ -2484,8 +2491,8 @@ private: explicit MTPinputFile(MTPDinputFile *_data); explicit MTPinputFile(MTPDinputFileBig *_data); - friend MTPinputFile MTP_inputFile(const MTPlong &_id, MTPint _parts, const MTPstring &_name, const MTPstring &_md5_checksum); - friend MTPinputFile MTP_inputFileBig(const MTPlong &_id, MTPint _parts, const MTPstring &_name); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2626,16 +2633,16 @@ private: explicit MTPinputMedia(MTPDinputMediaVenue *_data); explicit MTPinputMedia(MTPDinputMediaGifExternal *_data); - friend MTPinputMedia MTP_inputMediaEmpty(); - friend MTPinputMedia MTP_inputMediaUploadedPhoto(const MTPInputFile &_file, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaPhoto(const MTPInputPhoto &_id, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaGeoPoint(const MTPInputGeoPoint &_geo_point); - friend MTPinputMedia MTP_inputMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name); - friend MTPinputMedia MTP_inputMediaUploadedDocument(const MTPInputFile &_file, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaUploadedThumbDocument(const MTPInputFile &_file, const MTPInputFile &_thumb, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaDocument(const MTPInputDocument &_id, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id); - friend MTPinputMedia MTP_inputMediaGifExternal(const MTPstring &_url, const MTPstring &_q); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2685,9 +2692,9 @@ private: explicit MTPinputChatPhoto(MTPDinputChatUploadedPhoto *_data); explicit MTPinputChatPhoto(MTPDinputChatPhoto *_data); - friend MTPinputChatPhoto MTP_inputChatPhotoEmpty(); - friend MTPinputChatPhoto MTP_inputChatUploadedPhoto(const MTPInputFile &_file, const MTPInputPhotoCrop &_crop); - friend MTPinputChatPhoto MTP_inputChatPhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2724,8 +2731,8 @@ private: explicit MTPinputGeoPoint(mtpTypeId type); explicit MTPinputGeoPoint(MTPDinputGeoPoint *_data); - friend MTPinputGeoPoint MTP_inputGeoPointEmpty(); - friend MTPinputGeoPoint MTP_inputGeoPoint(const MTPdouble &_lat, const MTPdouble &_long); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2762,8 +2769,8 @@ private: explicit MTPinputPhoto(mtpTypeId type); explicit MTPinputPhoto(MTPDinputPhoto *_data); - friend MTPinputPhoto MTP_inputPhotoEmpty(); - friend MTPinputPhoto MTP_inputPhoto(const MTPlong &_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2826,9 +2833,9 @@ private: explicit MTPinputFileLocation(MTPDinputEncryptedFileLocation *_data); explicit MTPinputFileLocation(MTPDinputDocumentFileLocation *_data); - friend MTPinputFileLocation MTP_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret); - friend MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash); - friend MTPinputFileLocation MTP_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2865,8 +2872,8 @@ private: explicit MTPinputPhotoCrop(mtpTypeId type); explicit MTPinputPhotoCrop(MTPDinputPhotoCrop *_data); - friend MTPinputPhotoCrop MTP_inputPhotoCropAuto(); - friend MTPinputPhotoCrop MTP_inputPhotoCrop(const MTPdouble &_crop_left, const MTPdouble &_crop_top, const MTPdouble &_crop_width); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2899,7 +2906,7 @@ public: private: explicit MTPinputAppEvent(MTPDinputAppEvent *_data); - friend MTPinputAppEvent MTP_inputAppEvent(const MTPdouble &_time, const MTPstring &_type, const MTPlong &_peer, const MTPstring &_data); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPInputAppEvent; @@ -2960,9 +2967,9 @@ private: explicit MTPpeer(MTPDpeerChat *_data); explicit MTPpeer(MTPDpeerChannel *_data); - friend MTPpeer MTP_peerUser(MTPint _user_id); - friend MTPpeer MTP_peerChat(MTPint _chat_id); - friend MTPpeer MTP_peerChannel(MTPint _channel_id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -2986,16 +2993,16 @@ public: private: explicit MTPstorage_fileType(mtpTypeId type); - friend MTPstorage_fileType MTP_storage_fileUnknown(); - friend MTPstorage_fileType MTP_storage_fileJpeg(); - friend MTPstorage_fileType MTP_storage_fileGif(); - friend MTPstorage_fileType MTP_storage_filePng(); - friend MTPstorage_fileType MTP_storage_filePdf(); - friend MTPstorage_fileType MTP_storage_fileMp3(); - friend MTPstorage_fileType MTP_storage_fileMov(); - friend MTPstorage_fileType MTP_storage_filePartial(); - friend MTPstorage_fileType MTP_storage_fileMp4(); - friend MTPstorage_fileType MTP_storage_fileWebp(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3045,8 +3052,8 @@ private: explicit MTPfileLocation(MTPDfileLocationUnavailable *_data); explicit MTPfileLocation(MTPDfileLocation *_data); - friend MTPfileLocation MTP_fileLocationUnavailable(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret); - friend MTPfileLocation MTP_fileLocation(MTPint _dc_id, const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3096,8 +3103,8 @@ private: explicit MTPuser(MTPDuserEmpty *_data); explicit MTPuser(MTPDuser *_data); - friend MTPuser MTP_userEmpty(MTPint _id); - friend MTPuser MTP_user(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3134,8 +3141,8 @@ private: explicit MTPuserProfilePhoto(mtpTypeId type); explicit MTPuserProfilePhoto(MTPDuserProfilePhoto *_data); - friend MTPuserProfilePhoto MTP_userProfilePhotoEmpty(); - friend MTPuserProfilePhoto MTP_userProfilePhoto(const MTPlong &_photo_id, const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3185,12 +3192,12 @@ private: explicit MTPuserStatus(MTPDuserStatusOnline *_data); explicit MTPuserStatus(MTPDuserStatusOffline *_data); - friend MTPuserStatus MTP_userStatusEmpty(); - friend MTPuserStatus MTP_userStatusOnline(MTPint _expires); - friend MTPuserStatus MTP_userStatusOffline(MTPint _was_online); - friend MTPuserStatus MTP_userStatusRecently(); - friend MTPuserStatus MTP_userStatusLastWeek(); - friend MTPuserStatus MTP_userStatusLastMonth(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3279,11 +3286,11 @@ private: explicit MTPchat(MTPDchannel *_data); explicit MTPchat(MTPDchannelForbidden *_data); - friend MTPchat MTP_chatEmpty(MTPint _id); - friend MTPchat MTP_chat(MTPint _flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to); - friend MTPchat MTP_chatForbidden(MTPint _id, const MTPstring &_title); - friend MTPchat MTP_channel(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason); - friend MTPchat MTP_channelForbidden(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3333,8 +3340,8 @@ private: explicit MTPchatFull(MTPDchatFull *_data); explicit MTPchatFull(MTPDchannelFull *_data); - friend MTPchatFull MTP_chatFull(MTPint _id, const MTPChatParticipants &_participants, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info); - friend MTPchatFull MTP_channelFull(MTPint _flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3397,9 +3404,9 @@ private: explicit MTPchatParticipant(MTPDchatParticipantCreator *_data); explicit MTPchatParticipant(MTPDchatParticipantAdmin *_data); - friend MTPchatParticipant MTP_chatParticipant(MTPint _user_id, MTPint _inviter_id, MTPint _date); - friend MTPchatParticipant MTP_chatParticipantCreator(MTPint _user_id); - friend MTPchatParticipant MTP_chatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3449,8 +3456,8 @@ private: explicit MTPchatParticipants(MTPDchatParticipantsForbidden *_data); explicit MTPchatParticipants(MTPDchatParticipants *_data); - friend MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _flags, MTPint _chat_id, const MTPChatParticipant &_self_participant); - friend MTPchatParticipants MTP_chatParticipants(MTPint _chat_id, const MTPVector &_participants, MTPint _version); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3487,8 +3494,8 @@ private: explicit MTPchatPhoto(mtpTypeId type); explicit MTPchatPhoto(MTPDchatPhoto *_data); - friend MTPchatPhoto MTP_chatPhotoEmpty(); - friend MTPchatPhoto MTP_chatPhoto(const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3551,9 +3558,9 @@ private: explicit MTPmessage(MTPDmessage *_data); explicit MTPmessage(MTPDmessageService *_data); - friend MTPmessage MTP_messageEmpty(MTPint _id); - friend MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date); - friend MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3655,14 +3662,14 @@ private: explicit MTPmessageMedia(MTPDmessageMediaWebPage *_data); explicit MTPmessageMedia(MTPDmessageMediaVenue *_data); - friend MTPmessageMedia MTP_messageMediaEmpty(); - friend MTPmessageMedia MTP_messageMediaPhoto(const MTPPhoto &_photo, const MTPstring &_caption); - friend MTPmessageMedia MTP_messageMediaGeo(const MTPGeoPoint &_geo); - friend MTPmessageMedia MTP_messageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, MTPint _user_id); - friend MTPmessageMedia MTP_messageMediaUnsupported(); - friend MTPmessageMedia MTP_messageMediaDocument(const MTPDocument &_document, const MTPstring &_caption); - friend MTPmessageMedia MTP_messageMediaWebPage(const MTPWebPage &_webpage); - friend MTPmessageMedia MTP_messageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3803,18 +3810,18 @@ private: explicit MTPmessageAction(MTPDmessageActionChatMigrateTo *_data); explicit MTPmessageAction(MTPDmessageActionChannelMigrateFrom *_data); - friend MTPmessageAction MTP_messageActionEmpty(); - friend MTPmessageAction MTP_messageActionChatCreate(const MTPstring &_title, const MTPVector &_users); - friend MTPmessageAction MTP_messageActionChatEditTitle(const MTPstring &_title); - friend MTPmessageAction MTP_messageActionChatEditPhoto(const MTPPhoto &_photo); - friend MTPmessageAction MTP_messageActionChatDeletePhoto(); - friend MTPmessageAction MTP_messageActionChatAddUser(const MTPVector &_users); - friend MTPmessageAction MTP_messageActionChatDeleteUser(MTPint _user_id); - friend MTPmessageAction MTP_messageActionChatJoinedByLink(MTPint _inviter_id); - friend MTPmessageAction MTP_messageActionChannelCreate(const MTPstring &_title); - friend MTPmessageAction MTP_messageActionChatMigrateTo(MTPint _channel_id); - friend MTPmessageAction MTP_messageActionChannelMigrateFrom(const MTPstring &_title, MTPint _chat_id); - friend MTPmessageAction MTP_messageActionPinMessage(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3864,8 +3871,8 @@ private: explicit MTPdialog(MTPDdialog *_data); explicit MTPdialog(MTPDdialogChannel *_data); - friend MTPdialog MTP_dialog(const MTPPeer &_peer, MTPint _top_message, MTPint _read_inbox_max_id, MTPint _unread_count, const MTPPeerNotifySettings &_notify_settings); - friend MTPdialog MTP_dialogChannel(const MTPPeer &_peer, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPeerNotifySettings &_notify_settings, MTPint _pts); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3915,8 +3922,8 @@ private: explicit MTPphoto(MTPDphotoEmpty *_data); explicit MTPphoto(MTPDphoto *_data); - friend MTPphoto MTP_photoEmpty(const MTPlong &_id); - friend MTPphoto MTP_photo(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPVector &_sizes); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -3979,9 +3986,9 @@ private: explicit MTPphotoSize(MTPDphotoSize *_data); explicit MTPphotoSize(MTPDphotoCachedSize *_data); - friend MTPphotoSize MTP_photoSizeEmpty(const MTPstring &_type); - friend MTPphotoSize MTP_photoSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, MTPint _size); - friend MTPphotoSize MTP_photoCachedSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, const MTPbytes &_bytes); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4018,8 +4025,8 @@ private: explicit MTPgeoPoint(mtpTypeId type); explicit MTPgeoPoint(MTPDgeoPoint *_data); - friend MTPgeoPoint MTP_geoPointEmpty(); - friend MTPgeoPoint MTP_geoPoint(const MTPdouble &_long, const MTPdouble &_lat); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4052,7 +4059,7 @@ public: private: explicit MTPauth_checkedPhone(MTPDauth_checkedPhone *_data); - friend MTPauth_checkedPhone MTP_auth_checkedPhone(MTPBool _phone_registered); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPauth_CheckedPhone; @@ -4083,7 +4090,7 @@ public: private: explicit MTPauth_sentCode(MTPDauth_sentCode *_data); - friend MTPauth_sentCode MTP_auth_sentCode(MTPint _flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPauth_SentCode; @@ -4114,7 +4121,7 @@ public: private: explicit MTPauth_authorization(MTPDauth_authorization *_data); - friend MTPauth_authorization MTP_auth_authorization(const MTPUser &_user); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPauth_Authorization; @@ -4145,7 +4152,7 @@ public: private: explicit MTPauth_exportedAuthorization(MTPDauth_exportedAuthorization *_data); - friend MTPauth_exportedAuthorization MTP_auth_exportedAuthorization(MTPint _id, const MTPbytes &_bytes); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPauth_ExportedAuthorization; @@ -4180,10 +4187,10 @@ private: explicit MTPinputNotifyPeer(mtpTypeId type); explicit MTPinputNotifyPeer(MTPDinputNotifyPeer *_data); - friend MTPinputNotifyPeer MTP_inputNotifyPeer(const MTPInputPeer &_peer); - friend MTPinputNotifyPeer MTP_inputNotifyUsers(); - friend MTPinputNotifyPeer MTP_inputNotifyChats(); - friend MTPinputNotifyPeer MTP_inputNotifyAll(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4207,8 +4214,8 @@ public: private: explicit MTPinputPeerNotifyEvents(mtpTypeId type); - friend MTPinputPeerNotifyEvents MTP_inputPeerNotifyEventsEmpty(); - friend MTPinputPeerNotifyEvents MTP_inputPeerNotifyEventsAll(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4241,7 +4248,7 @@ public: private: explicit MTPinputPeerNotifySettings(MTPDinputPeerNotifySettings *_data); - friend MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPInputPeerNotifySettings; @@ -4263,8 +4270,8 @@ public: private: explicit MTPpeerNotifyEvents(mtpTypeId type); - friend MTPpeerNotifyEvents MTP_peerNotifyEventsEmpty(); - friend MTPpeerNotifyEvents MTP_peerNotifyEventsAll(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4301,8 +4308,8 @@ private: explicit MTPpeerNotifySettings(mtpTypeId type); explicit MTPpeerNotifySettings(MTPDpeerNotifySettings *_data); - friend MTPpeerNotifySettings MTP_peerNotifySettingsEmpty(); - friend MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4335,7 +4342,7 @@ public: private: explicit MTPpeerSettings(MTPDpeerSettings *_data); - friend MTPpeerSettings MTP_peerSettings(MTPint _flags); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPPeerSettings; @@ -4383,8 +4390,8 @@ private: explicit MTPwallPaper(MTPDwallPaper *_data); explicit MTPwallPaper(MTPDwallPaperSolid *_data); - friend MTPwallPaper MTP_wallPaper(MTPint _id, const MTPstring &_title, const MTPVector &_sizes, MTPint _color); - friend MTPwallPaper MTP_wallPaperSolid(MTPint _id, const MTPstring &_title, MTPint _bg_color, MTPint _color); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4421,10 +4428,10 @@ private: explicit MTPreportReason(mtpTypeId type); explicit MTPreportReason(MTPDinputReportReasonOther *_data); - friend MTPreportReason MTP_inputReportReasonSpam(); - friend MTPreportReason MTP_inputReportReasonViolence(); - friend MTPreportReason MTP_inputReportReasonPornography(); - friend MTPreportReason MTP_inputReportReasonOther(const MTPstring &_text); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4457,7 +4464,7 @@ public: private: explicit MTPuserFull(MTPDuserFull *_data); - friend MTPuserFull MTP_userFull(MTPint _flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPUserFull; @@ -4488,7 +4495,7 @@ public: private: explicit MTPcontact(MTPDcontact *_data); - friend MTPcontact MTP_contact(MTPint _user_id, MTPBool _mutual); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPContact; @@ -4519,7 +4526,7 @@ public: private: explicit MTPimportedContact(MTPDimportedContact *_data); - friend MTPimportedContact MTP_importedContact(MTPint _user_id, const MTPlong &_client_id); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPImportedContact; @@ -4550,7 +4557,7 @@ public: private: explicit MTPcontactBlocked(MTPDcontactBlocked *_data); - friend MTPcontactBlocked MTP_contactBlocked(MTPint _user_id, MTPint _date); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPContactBlocked; @@ -4581,7 +4588,7 @@ public: private: explicit MTPcontactStatus(MTPDcontactStatus *_data); - friend MTPcontactStatus MTP_contactStatus(MTPint _user_id, const MTPUserStatus &_status); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPContactStatus; @@ -4612,7 +4619,7 @@ public: private: explicit MTPcontacts_link(MTPDcontacts_link *_data); - friend MTPcontacts_link MTP_contacts_link(const MTPContactLink &_my_link, const MTPContactLink &_foreign_link, const MTPUser &_user); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPcontacts_Link; @@ -4647,8 +4654,8 @@ private: explicit MTPcontacts_contacts(mtpTypeId type); explicit MTPcontacts_contacts(MTPDcontacts_contacts *_data); - friend MTPcontacts_contacts MTP_contacts_contactsNotModified(); - friend MTPcontacts_contacts MTP_contacts_contacts(const MTPVector &_contacts, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4681,7 +4688,7 @@ public: private: explicit MTPcontacts_importedContacts(MTPDcontacts_importedContacts *_data); - friend MTPcontacts_importedContacts MTP_contacts_importedContacts(const MTPVector &_imported, const MTPVector &_retry_contacts, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPcontacts_ImportedContacts; @@ -4729,8 +4736,8 @@ private: explicit MTPcontacts_blocked(MTPDcontacts_blocked *_data); explicit MTPcontacts_blocked(MTPDcontacts_blockedSlice *_data); - friend MTPcontacts_blocked MTP_contacts_blocked(const MTPVector &_blocked, const MTPVector &_users); - friend MTPcontacts_blocked MTP_contacts_blockedSlice(MTPint _count, const MTPVector &_blocked, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4780,8 +4787,8 @@ private: explicit MTPmessages_dialogs(MTPDmessages_dialogs *_data); explicit MTPmessages_dialogs(MTPDmessages_dialogsSlice *_data); - friend MTPmessages_dialogs MTP_messages_dialogs(const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - friend MTPmessages_dialogs MTP_messages_dialogsSlice(MTPint _count, const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4844,9 +4851,9 @@ private: explicit MTPmessages_messages(MTPDmessages_messagesSlice *_data); explicit MTPmessages_messages(MTPDmessages_channelMessages *_data); - friend MTPmessages_messages MTP_messages_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - friend MTPmessages_messages MTP_messages_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - friend MTPmessages_messages MTP_messages_channelMessages(MTPint _flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -4879,7 +4886,7 @@ public: private: explicit MTPmessages_chats(MTPDmessages_chats *_data); - friend MTPmessages_chats MTP_messages_chats(const MTPVector &_chats); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_Chats; @@ -4910,7 +4917,7 @@ public: private: explicit MTPmessages_chatFull(MTPDmessages_chatFull *_data); - friend MTPmessages_chatFull MTP_messages_chatFull(const MTPChatFull &_full_chat, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_ChatFull; @@ -4941,7 +4948,7 @@ public: private: explicit MTPmessages_affectedHistory(MTPDmessages_affectedHistory *_data); - friend MTPmessages_affectedHistory MTP_messages_affectedHistory(MTPint _pts, MTPint _pts_count, MTPint _offset); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_AffectedHistory; @@ -4963,16 +4970,16 @@ public: private: explicit MTPmessagesFilter(mtpTypeId type); - friend MTPmessagesFilter MTP_inputMessagesFilterEmpty(); - friend MTPmessagesFilter MTP_inputMessagesFilterPhotos(); - friend MTPmessagesFilter MTP_inputMessagesFilterVideo(); - friend MTPmessagesFilter MTP_inputMessagesFilterPhotoVideo(); - friend MTPmessagesFilter MTP_inputMessagesFilterPhotoVideoDocuments(); - friend MTPmessagesFilter MTP_inputMessagesFilterDocument(); - friend MTPmessagesFilter MTP_inputMessagesFilterUrl(); - friend MTPmessagesFilter MTP_inputMessagesFilterGif(); - friend MTPmessagesFilter MTP_inputMessagesFilterVoice(); - friend MTPmessagesFilter MTP_inputMessagesFilterMusic(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -5555,51 +5562,51 @@ private: explicit MTPupdate(MTPDupdateEditChannelMessage *_data); explicit MTPupdate(MTPDupdateChannelPinnedMessage *_data); - friend MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateMessageID(MTPint _id, const MTPlong &_random_id); - friend MTPupdate MTP_updateDeleteMessages(const MTPVector &_messages, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateUserTyping(MTPint _user_id, const MTPSendMessageAction &_action); - friend MTPupdate MTP_updateChatUserTyping(MTPint _chat_id, MTPint _user_id, const MTPSendMessageAction &_action); - friend MTPupdate MTP_updateChatParticipants(const MTPChatParticipants &_participants); - friend MTPupdate MTP_updateUserStatus(MTPint _user_id, const MTPUserStatus &_status); - friend MTPupdate MTP_updateUserName(MTPint _user_id, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username); - friend MTPupdate MTP_updateUserPhoto(MTPint _user_id, MTPint _date, const MTPUserProfilePhoto &_photo, MTPBool _previous); - friend MTPupdate MTP_updateContactRegistered(MTPint _user_id, MTPint _date); - friend MTPupdate MTP_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link); - friend MTPupdate MTP_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location); - friend MTPupdate MTP_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts); - friend MTPupdate MTP_updateEncryptedChatTyping(MTPint _chat_id); - friend MTPupdate MTP_updateEncryption(const MTPEncryptedChat &_chat, MTPint _date); - friend MTPupdate MTP_updateEncryptedMessagesRead(MTPint _chat_id, MTPint _max_date, MTPint _date); - friend MTPupdate MTP_updateChatParticipantAdd(MTPint _chat_id, MTPint _user_id, MTPint _inviter_id, MTPint _date, MTPint _version); - friend MTPupdate MTP_updateChatParticipantDelete(MTPint _chat_id, MTPint _user_id, MTPint _version); - friend MTPupdate MTP_updateDcOptions(const MTPVector &_dc_options); - friend MTPupdate MTP_updateUserBlocked(MTPint _user_id, MTPBool _blocked); - friend MTPupdate MTP_updateNotifySettings(const MTPNotifyPeer &_peer, const MTPPeerNotifySettings &_notify_settings); - friend MTPupdate MTP_updateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup); - friend MTPupdate MTP_updatePrivacy(const MTPPrivacyKey &_key, const MTPVector &_rules); - friend MTPupdate MTP_updateUserPhone(MTPint _user_id, const MTPstring &_phone); - friend MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateChannelTooLong(MTPint _flags, MTPint _channel_id, MTPint _pts); - friend MTPupdate MTP_updateChannel(MTPint _channel_id); - friend MTPupdate MTP_updateChannelGroup(MTPint _channel_id, const MTPMessageGroup &_group); - friend MTPupdate MTP_updateNewChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateReadChannelInbox(MTPint _channel_id, MTPint _max_id); - friend MTPupdate MTP_updateDeleteChannelMessages(MTPint _channel_id, const MTPVector &_messages, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateChannelMessageViews(MTPint _channel_id, MTPint _id, MTPint _views); - friend MTPupdate MTP_updateChatAdmins(MTPint _chat_id, MTPBool _enabled, MTPint _version); - friend MTPupdate MTP_updateChatParticipantAdmin(MTPint _chat_id, MTPint _user_id, MTPBool _is_admin, MTPint _version); - friend MTPupdate MTP_updateNewStickerSet(const MTPmessages_StickerSet &_stickerset); - friend MTPupdate MTP_updateStickerSetsOrder(const MTPVector &_order); - friend MTPupdate MTP_updateStickerSets(); - friend MTPupdate MTP_updateSavedGifs(); - friend MTPupdate MTP_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset); - friend MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id); - friend MTPupdate MTP_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count); - friend MTPupdate MTP_updateChannelPinnedMessage(MTPint _channel_id, MTPint _id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -5632,7 +5639,7 @@ public: private: explicit MTPupdates_state(MTPDupdates_state *_data); - friend MTPupdates_state MTP_updates_state(MTPint _pts, MTPint _qts, MTPint _date, MTPint _seq, MTPint _unread_count); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPupdates_State; @@ -5693,9 +5700,9 @@ private: explicit MTPupdates_difference(MTPDupdates_difference *_data); explicit MTPupdates_difference(MTPDupdates_differenceSlice *_data); - friend MTPupdates_difference MTP_updates_differenceEmpty(MTPint _date, MTPint _seq); - friend MTPupdates_difference MTP_updates_difference(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_state); - friend MTPupdates_difference MTP_updates_differenceSlice(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_intermediate_state); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -5797,13 +5804,13 @@ private: explicit MTPupdates(MTPDupdates *_data); explicit MTPupdates(MTPDupdateShortSentMessage *_data); - friend MTPupdates MTP_updatesTooLong(); - friend MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities); - friend MTPupdates MTP_updateShortChatMessage(MTPint _flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities); - friend MTPupdates MTP_updateShort(const MTPUpdate &_update, MTPint _date); - friend MTPupdates MTP_updatesCombined(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq_start, MTPint _seq); - friend MTPupdates MTP_updates(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq); - friend MTPupdates MTP_updateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -5853,8 +5860,8 @@ private: explicit MTPphotos_photos(MTPDphotos_photos *_data); explicit MTPphotos_photos(MTPDphotos_photosSlice *_data); - friend MTPphotos_photos MTP_photos_photos(const MTPVector &_photos, const MTPVector &_users); - friend MTPphotos_photos MTP_photos_photosSlice(MTPint _count, const MTPVector &_photos, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -5887,7 +5894,7 @@ public: private: explicit MTPphotos_photo(MTPDphotos_photo *_data); - friend MTPphotos_photo MTP_photos_photo(const MTPPhoto &_photo, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPphotos_Photo; @@ -5918,7 +5925,7 @@ public: private: explicit MTPupload_file(MTPDupload_file *_data); - friend MTPupload_file MTP_upload_file(const MTPstorage_FileType &_type, MTPint _mtime, const MTPbytes &_bytes); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPupload_File; @@ -5949,7 +5956,7 @@ public: private: explicit MTPdcOption(MTPDdcOption *_data); - friend MTPdcOption MTP_dcOption(MTPint _flags, MTPint _id, const MTPstring &_ip_address, MTPint _port); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPDcOption; @@ -5980,7 +5987,7 @@ public: private: explicit MTPconfig(MTPDconfig *_data); - friend MTPconfig MTP_config(MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, const MTPVector &_disabled_features); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPConfig; @@ -6011,7 +6018,7 @@ public: private: explicit MTPnearestDc(MTPDnearestDc *_data); - friend MTPnearestDc MTP_nearestDc(const MTPstring &_country, MTPint _this_dc, MTPint _nearest_dc); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPNearestDc; @@ -6046,8 +6053,8 @@ private: explicit MTPhelp_appUpdate(mtpTypeId type); explicit MTPhelp_appUpdate(MTPDhelp_appUpdate *_data); - friend MTPhelp_appUpdate MTP_help_appUpdate(MTPint _id, MTPBool _critical, const MTPstring &_url, const MTPstring &_text); - friend MTPhelp_appUpdate MTP_help_noAppUpdate(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6080,7 +6087,7 @@ public: private: explicit MTPhelp_inviteText(MTPDhelp_inviteText *_data); - friend MTPhelp_inviteText MTP_help_inviteText(const MTPstring &_message); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPhelp_InviteText; @@ -6167,11 +6174,11 @@ private: explicit MTPencryptedChat(MTPDencryptedChat *_data); explicit MTPencryptedChat(MTPDencryptedChatDiscarded *_data); - friend MTPencryptedChat MTP_encryptedChatEmpty(MTPint _id); - friend MTPencryptedChat MTP_encryptedChatWaiting(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id); - friend MTPencryptedChat MTP_encryptedChatRequested(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a); - friend MTPencryptedChat MTP_encryptedChat(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint); - friend MTPencryptedChat MTP_encryptedChatDiscarded(MTPint _id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6204,7 +6211,7 @@ public: private: explicit MTPinputEncryptedChat(MTPDinputEncryptedChat *_data); - friend MTPinputEncryptedChat MTP_inputEncryptedChat(MTPint _chat_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPInputEncryptedChat; @@ -6239,8 +6246,8 @@ private: explicit MTPencryptedFile(mtpTypeId type); explicit MTPencryptedFile(MTPDencryptedFile *_data); - friend MTPencryptedFile MTP_encryptedFileEmpty(); - friend MTPencryptedFile MTP_encryptedFile(const MTPlong &_id, const MTPlong &_access_hash, MTPint _size, MTPint _dc_id, MTPint _key_fingerprint); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6303,10 +6310,10 @@ private: explicit MTPinputEncryptedFile(MTPDinputEncryptedFile *_data); explicit MTPinputEncryptedFile(MTPDinputEncryptedFileBigUploaded *_data); - friend MTPinputEncryptedFile MTP_inputEncryptedFileEmpty(); - friend MTPinputEncryptedFile MTP_inputEncryptedFileUploaded(const MTPlong &_id, MTPint _parts, const MTPstring &_md5_checksum, MTPint _key_fingerprint); - friend MTPinputEncryptedFile MTP_inputEncryptedFile(const MTPlong &_id, const MTPlong &_access_hash); - friend MTPinputEncryptedFile MTP_inputEncryptedFileBigUploaded(const MTPlong &_id, MTPint _parts, MTPint _key_fingerprint); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6356,8 +6363,8 @@ private: explicit MTPencryptedMessage(MTPDencryptedMessage *_data); explicit MTPencryptedMessage(MTPDencryptedMessageService *_data); - friend MTPencryptedMessage MTP_encryptedMessage(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes, const MTPEncryptedFile &_file); - friend MTPencryptedMessage MTP_encryptedMessageService(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6407,8 +6414,8 @@ private: explicit MTPmessages_dhConfig(MTPDmessages_dhConfigNotModified *_data); explicit MTPmessages_dhConfig(MTPDmessages_dhConfig *_data); - friend MTPmessages_dhConfig MTP_messages_dhConfigNotModified(const MTPbytes &_random); - friend MTPmessages_dhConfig MTP_messages_dhConfig(MTPint _g, const MTPbytes &_p, MTPint _version, const MTPbytes &_random); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6458,8 +6465,8 @@ private: explicit MTPmessages_sentEncryptedMessage(MTPDmessages_sentEncryptedMessage *_data); explicit MTPmessages_sentEncryptedMessage(MTPDmessages_sentEncryptedFile *_data); - friend MTPmessages_sentEncryptedMessage MTP_messages_sentEncryptedMessage(MTPint _date); - friend MTPmessages_sentEncryptedMessage MTP_messages_sentEncryptedFile(MTPint _date, const MTPEncryptedFile &_file); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6496,8 +6503,8 @@ private: explicit MTPinputDocument(mtpTypeId type); explicit MTPinputDocument(MTPDinputDocument *_data); - friend MTPinputDocument MTP_inputDocumentEmpty(); - friend MTPinputDocument MTP_inputDocument(const MTPlong &_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6547,8 +6554,8 @@ private: explicit MTPdocument(MTPDdocumentEmpty *_data); explicit MTPdocument(MTPDdocument *_data); - friend MTPdocument MTP_documentEmpty(const MTPlong &_id); - friend MTPdocument MTP_document(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, const MTPVector &_attributes); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6581,7 +6588,7 @@ public: private: explicit MTPhelp_support(MTPDhelp_support *_data); - friend MTPhelp_support MTP_help_support(const MTPstring &_phone_number, const MTPUser &_user); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPhelp_Support; @@ -6616,10 +6623,10 @@ private: explicit MTPnotifyPeer(mtpTypeId type); explicit MTPnotifyPeer(MTPDnotifyPeer *_data); - friend MTPnotifyPeer MTP_notifyPeer(const MTPPeer &_peer); - friend MTPnotifyPeer MTP_notifyUsers(); - friend MTPnotifyPeer MTP_notifyChats(); - friend MTPnotifyPeer MTP_notifyAll(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6695,16 +6702,16 @@ private: explicit MTPsendMessageAction(MTPDsendMessageUploadPhotoAction *_data); explicit MTPsendMessageAction(MTPDsendMessageUploadDocumentAction *_data); - friend MTPsendMessageAction MTP_sendMessageTypingAction(); - friend MTPsendMessageAction MTP_sendMessageCancelAction(); - friend MTPsendMessageAction MTP_sendMessageRecordVideoAction(); - friend MTPsendMessageAction MTP_sendMessageUploadVideoAction(MTPint _progress); - friend MTPsendMessageAction MTP_sendMessageRecordAudioAction(); - friend MTPsendMessageAction MTP_sendMessageUploadAudioAction(MTPint _progress); - friend MTPsendMessageAction MTP_sendMessageUploadPhotoAction(MTPint _progress); - friend MTPsendMessageAction MTP_sendMessageUploadDocumentAction(MTPint _progress); - friend MTPsendMessageAction MTP_sendMessageGeoLocationAction(); - friend MTPsendMessageAction MTP_sendMessageChooseContactAction(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6737,7 +6744,7 @@ public: private: explicit MTPcontacts_found(MTPDcontacts_found *_data); - friend MTPcontacts_found MTP_contacts_found(const MTPVector &_results, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPcontacts_Found; @@ -6759,8 +6766,8 @@ public: private: explicit MTPinputPrivacyKey(mtpTypeId type); - friend MTPinputPrivacyKey MTP_inputPrivacyKeyStatusTimestamp(); - friend MTPinputPrivacyKey MTP_inputPrivacyKeyChatInvite(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6784,8 +6791,8 @@ public: private: explicit MTPprivacyKey(mtpTypeId type); - friend MTPprivacyKey MTP_privacyKeyStatusTimestamp(); - friend MTPprivacyKey MTP_privacyKeyChatInvite(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6835,12 +6842,12 @@ private: explicit MTPinputPrivacyRule(MTPDinputPrivacyValueAllowUsers *_data); explicit MTPinputPrivacyRule(MTPDinputPrivacyValueDisallowUsers *_data); - friend MTPinputPrivacyRule MTP_inputPrivacyValueAllowContacts(); - friend MTPinputPrivacyRule MTP_inputPrivacyValueAllowAll(); - friend MTPinputPrivacyRule MTP_inputPrivacyValueAllowUsers(const MTPVector &_users); - friend MTPinputPrivacyRule MTP_inputPrivacyValueDisallowContacts(); - friend MTPinputPrivacyRule MTP_inputPrivacyValueDisallowAll(); - friend MTPinputPrivacyRule MTP_inputPrivacyValueDisallowUsers(const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6890,12 +6897,12 @@ private: explicit MTPprivacyRule(MTPDprivacyValueAllowUsers *_data); explicit MTPprivacyRule(MTPDprivacyValueDisallowUsers *_data); - friend MTPprivacyRule MTP_privacyValueAllowContacts(); - friend MTPprivacyRule MTP_privacyValueAllowAll(); - friend MTPprivacyRule MTP_privacyValueAllowUsers(const MTPVector &_users); - friend MTPprivacyRule MTP_privacyValueDisallowContacts(); - friend MTPprivacyRule MTP_privacyValueDisallowAll(); - friend MTPprivacyRule MTP_privacyValueDisallowUsers(const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -6928,7 +6935,7 @@ public: private: explicit MTPaccount_privacyRules(MTPDaccount_privacyRules *_data); - friend MTPaccount_privacyRules MTP_account_privacyRules(const MTPVector &_rules, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPaccount_PrivacyRules; @@ -6959,7 +6966,7 @@ public: private: explicit MTPaccountDaysTTL(MTPDaccountDaysTTL *_data); - friend MTPaccountDaysTTL MTP_accountDaysTTL(MTPint _days); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPAccountDaysTTL; @@ -7046,12 +7053,12 @@ private: explicit MTPdocumentAttribute(MTPDdocumentAttributeAudio *_data); explicit MTPdocumentAttribute(MTPDdocumentAttributeFilename *_data); - friend MTPdocumentAttribute MTP_documentAttributeImageSize(MTPint _w, MTPint _h); - friend MTPdocumentAttribute MTP_documentAttributeAnimated(); - friend MTPdocumentAttribute MTP_documentAttributeSticker(const MTPstring &_alt, const MTPInputStickerSet &_stickerset); - friend MTPdocumentAttribute MTP_documentAttributeVideo(MTPint _duration, MTPint _w, MTPint _h); - friend MTPdocumentAttribute MTP_documentAttributeAudio(MTPint _flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform); - friend MTPdocumentAttribute MTP_documentAttributeFilename(const MTPstring &_file_name); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7088,8 +7095,8 @@ private: explicit MTPmessages_stickers(mtpTypeId type); explicit MTPmessages_stickers(MTPDmessages_stickers *_data); - friend MTPmessages_stickers MTP_messages_stickersNotModified(); - friend MTPmessages_stickers MTP_messages_stickers(const MTPstring &_hash, const MTPVector &_stickers); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7122,7 +7129,7 @@ public: private: explicit MTPstickerPack(MTPDstickerPack *_data); - friend MTPstickerPack MTP_stickerPack(const MTPstring &_emoticon, const MTPVector &_documents); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPStickerPack; @@ -7157,8 +7164,8 @@ private: explicit MTPmessages_allStickers(mtpTypeId type); explicit MTPmessages_allStickers(MTPDmessages_allStickers *_data); - friend MTPmessages_allStickers MTP_messages_allStickersNotModified(); - friend MTPmessages_allStickers MTP_messages_allStickers(MTPint _hash, const MTPVector &_sets); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7191,7 +7198,7 @@ public: private: explicit MTPdisabledFeature(MTPDdisabledFeature *_data); - friend MTPdisabledFeature MTP_disabledFeature(const MTPstring &_feature, const MTPstring &_description); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPDisabledFeature; @@ -7222,7 +7229,7 @@ public: private: explicit MTPmessages_affectedMessages(MTPDmessages_affectedMessages *_data); - friend MTPmessages_affectedMessages MTP_messages_affectedMessages(MTPint _pts, MTPint _pts_count); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_AffectedMessages; @@ -7244,10 +7251,10 @@ public: private: explicit MTPcontactLink(mtpTypeId type); - friend MTPcontactLink MTP_contactLinkUnknown(); - friend MTPcontactLink MTP_contactLinkNone(); - friend MTPcontactLink MTP_contactLinkHasPhone(); - friend MTPcontactLink MTP_contactLinkContact(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7310,9 +7317,9 @@ private: explicit MTPwebPage(MTPDwebPagePending *_data); explicit MTPwebPage(MTPDwebPage *_data); - friend MTPwebPage MTP_webPageEmpty(const MTPlong &_id); - friend MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date); - friend MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7345,7 +7352,7 @@ public: private: explicit MTPauthorization(MTPDauthorization *_data); - friend MTPauthorization MTP_authorization(const MTPlong &_hash, MTPint _flags, const MTPstring &_device_model, const MTPstring &_platform, const MTPstring &_system_version, MTPint _api_id, const MTPstring &_app_name, const MTPstring &_app_version, MTPint _date_created, MTPint _date_active, const MTPstring &_ip, const MTPstring &_country, const MTPstring &_region); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPAuthorization; @@ -7376,7 +7383,7 @@ public: private: explicit MTPaccount_authorizations(MTPDaccount_authorizations *_data); - friend MTPaccount_authorizations MTP_account_authorizations(const MTPVector &_authorizations); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPaccount_Authorizations; @@ -7424,8 +7431,8 @@ private: explicit MTPaccount_password(MTPDaccount_noPassword *_data); explicit MTPaccount_password(MTPDaccount_password *_data); - friend MTPaccount_password MTP_account_noPassword(const MTPbytes &_new_salt, const MTPstring &_email_unconfirmed_pattern); - friend MTPaccount_password MTP_account_password(const MTPbytes &_current_salt, const MTPbytes &_new_salt, const MTPstring &_hint, MTPBool _has_recovery, const MTPstring &_email_unconfirmed_pattern); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7458,7 +7465,7 @@ public: private: explicit MTPaccount_passwordSettings(MTPDaccount_passwordSettings *_data); - friend MTPaccount_passwordSettings MTP_account_passwordSettings(const MTPstring &_email); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPaccount_PasswordSettings; @@ -7489,7 +7496,7 @@ public: private: explicit MTPaccount_passwordInputSettings(MTPDaccount_passwordInputSettings *_data); - friend MTPaccount_passwordInputSettings MTP_account_passwordInputSettings(MTPint _flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPaccount_PasswordInputSettings; @@ -7520,7 +7527,7 @@ public: private: explicit MTPauth_passwordRecovery(MTPDauth_passwordRecovery *_data); - friend MTPauth_passwordRecovery MTP_auth_passwordRecovery(const MTPstring &_email_pattern); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPauth_PasswordRecovery; @@ -7551,7 +7558,7 @@ public: private: explicit MTPreceivedNotifyMessage(MTPDreceivedNotifyMessage *_data); - friend MTPreceivedNotifyMessage MTP_receivedNotifyMessage(MTPint _id, MTPint _flags); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPReceivedNotifyMessage; @@ -7586,8 +7593,8 @@ private: explicit MTPexportedChatInvite(mtpTypeId type); explicit MTPexportedChatInvite(MTPDchatInviteExported *_data); - friend MTPexportedChatInvite MTP_chatInviteEmpty(); - friend MTPexportedChatInvite MTP_chatInviteExported(const MTPstring &_link); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7637,8 +7644,8 @@ private: explicit MTPchatInvite(MTPDchatInviteAlready *_data); explicit MTPchatInvite(MTPDchatInvite *_data); - friend MTPchatInvite MTP_chatInviteAlready(const MTPChat &_chat); - friend MTPchatInvite MTP_chatInvite(MTPint _flags, const MTPstring &_title); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7688,9 +7695,9 @@ private: explicit MTPinputStickerSet(MTPDinputStickerSetID *_data); explicit MTPinputStickerSet(MTPDinputStickerSetShortName *_data); - friend MTPinputStickerSet MTP_inputStickerSetEmpty(); - friend MTPinputStickerSet MTP_inputStickerSetID(const MTPlong &_id, const MTPlong &_access_hash); - friend MTPinputStickerSet MTP_inputStickerSetShortName(const MTPstring &_short_name); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7723,7 +7730,7 @@ public: private: explicit MTPstickerSet(MTPDstickerSet *_data); - friend MTPstickerSet MTP_stickerSet(MTPint _flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPStickerSet; @@ -7754,7 +7761,7 @@ public: private: explicit MTPmessages_stickerSet(MTPDmessages_stickerSet *_data); - friend MTPmessages_stickerSet MTP_messages_stickerSet(const MTPStickerSet &_set, const MTPVector &_packs, const MTPVector &_documents); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_StickerSet; @@ -7785,7 +7792,7 @@ public: private: explicit MTPbotCommand(MTPDbotCommand *_data); - friend MTPbotCommand MTP_botCommand(const MTPstring &_command, const MTPstring &_description); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPBotCommand; @@ -7816,7 +7823,7 @@ public: private: explicit MTPbotInfo(MTPDbotInfo *_data); - friend MTPbotInfo MTP_botInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPBotInfo; @@ -7847,7 +7854,7 @@ public: private: explicit MTPkeyboardButton(MTPDkeyboardButton *_data); - friend MTPkeyboardButton MTP_keyboardButton(const MTPstring &_text); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPKeyboardButton; @@ -7878,7 +7885,7 @@ public: private: explicit MTPkeyboardButtonRow(MTPDkeyboardButtonRow *_data); - friend MTPkeyboardButtonRow MTP_keyboardButtonRow(const MTPVector &_buttons); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPKeyboardButtonRow; @@ -7939,9 +7946,9 @@ private: explicit MTPreplyMarkup(MTPDreplyKeyboardForceReply *_data); explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data); - friend MTPreplyMarkup MTP_replyKeyboardHide(MTPint _flags); - friend MTPreplyMarkup MTP_replyKeyboardForceReply(MTPint _flags); - friend MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector &_rows); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -7978,8 +7985,8 @@ private: explicit MTPhelp_appChangelog(mtpTypeId type); explicit MTPhelp_appChangelog(MTPDhelp_appChangelog *_data); - friend MTPhelp_appChangelog MTP_help_appChangelogEmpty(); - friend MTPhelp_appChangelog MTP_help_appChangelog(const MTPstring &_text); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8146,17 +8153,17 @@ private: explicit MTPmessageEntity(MTPDmessageEntityPre *_data); explicit MTPmessageEntity(MTPDmessageEntityTextUrl *_data); - friend MTPmessageEntity MTP_messageEntityUnknown(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityMention(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityHashtag(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityBotCommand(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityUrl(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityEmail(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityBold(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityItalic(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityCode(MTPint _offset, MTPint _length); - friend MTPmessageEntity MTP_messageEntityPre(MTPint _offset, MTPint _length, const MTPstring &_language); - friend MTPmessageEntity MTP_messageEntityTextUrl(MTPint _offset, MTPint _length, const MTPstring &_url); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8193,8 +8200,8 @@ private: explicit MTPinputChannel(mtpTypeId type); explicit MTPinputChannel(MTPDinputChannel *_data); - friend MTPinputChannel MTP_inputChannelEmpty(); - friend MTPinputChannel MTP_inputChannel(MTPint _channel_id, const MTPlong &_access_hash); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8227,7 +8234,7 @@ public: private: explicit MTPcontacts_resolvedPeer(MTPDcontacts_resolvedPeer *_data); - friend MTPcontacts_resolvedPeer MTP_contacts_resolvedPeer(const MTPPeer &_peer, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPcontacts_ResolvedPeer; @@ -8258,7 +8265,7 @@ public: private: explicit MTPmessageRange(MTPDmessageRange *_data); - friend MTPmessageRange MTP_messageRange(MTPint _min_id, MTPint _max_id); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMessageRange; @@ -8289,7 +8296,7 @@ public: private: explicit MTPmessageGroup(MTPDmessageGroup *_data); - friend MTPmessageGroup MTP_messageGroup(MTPint _min_id, MTPint _max_id, MTPint _count, MTPint _date); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMessageGroup; @@ -8350,9 +8357,9 @@ private: explicit MTPupdates_channelDifference(MTPDupdates_channelDifferenceTooLong *_data); explicit MTPupdates_channelDifference(MTPDupdates_channelDifference *_data); - friend MTPupdates_channelDifference MTP_updates_channelDifferenceEmpty(MTPint _flags, MTPint _pts, MTPint _timeout); - friend MTPupdates_channelDifference MTP_updates_channelDifferenceTooLong(MTPint _flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - friend MTPupdates_channelDifference MTP_updates_channelDifference(MTPint _flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8389,9 +8396,9 @@ private: explicit MTPchannelMessagesFilter(mtpTypeId type); explicit MTPchannelMessagesFilter(MTPDchannelMessagesFilter *_data); - friend MTPchannelMessagesFilter MTP_channelMessagesFilterEmpty(); - friend MTPchannelMessagesFilter MTP_channelMessagesFilter(MTPint _flags, const MTPVector &_ranges); - friend MTPchannelMessagesFilter MTP_channelMessagesFilterCollapsed(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8493,12 +8500,12 @@ private: explicit MTPchannelParticipant(MTPDchannelParticipantKicked *_data); explicit MTPchannelParticipant(MTPDchannelParticipantCreator *_data); - friend MTPchannelParticipant MTP_channelParticipant(MTPint _user_id, MTPint _date); - friend MTPchannelParticipant MTP_channelParticipantSelf(MTPint _user_id, MTPint _inviter_id, MTPint _date); - friend MTPchannelParticipant MTP_channelParticipantModerator(MTPint _user_id, MTPint _inviter_id, MTPint _date); - friend MTPchannelParticipant MTP_channelParticipantEditor(MTPint _user_id, MTPint _inviter_id, MTPint _date); - friend MTPchannelParticipant MTP_channelParticipantKicked(MTPint _user_id, MTPint _kicked_by, MTPint _date); - friend MTPchannelParticipant MTP_channelParticipantCreator(MTPint _user_id); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8522,10 +8529,10 @@ public: private: explicit MTPchannelParticipantsFilter(mtpTypeId type); - friend MTPchannelParticipantsFilter MTP_channelParticipantsRecent(); - friend MTPchannelParticipantsFilter MTP_channelParticipantsAdmins(); - friend MTPchannelParticipantsFilter MTP_channelParticipantsKicked(); - friend MTPchannelParticipantsFilter MTP_channelParticipantsBots(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8549,9 +8556,9 @@ public: private: explicit MTPchannelParticipantRole(mtpTypeId type); - friend MTPchannelParticipantRole MTP_channelRoleEmpty(); - friend MTPchannelParticipantRole MTP_channelRoleModerator(); - friend MTPchannelParticipantRole MTP_channelRoleEditor(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8584,7 +8591,7 @@ public: private: explicit MTPchannels_channelParticipants(MTPDchannels_channelParticipants *_data); - friend MTPchannels_channelParticipants MTP_channels_channelParticipants(MTPint _count, const MTPVector &_participants, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPchannels_ChannelParticipants; @@ -8615,7 +8622,7 @@ public: private: explicit MTPchannels_channelParticipant(MTPDchannels_channelParticipant *_data); - friend MTPchannels_channelParticipant MTP_channels_channelParticipant(const MTPChannelParticipant &_participant, const MTPVector &_users); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPchannels_ChannelParticipant; @@ -8646,7 +8653,7 @@ public: private: explicit MTPhelp_termsOfService(MTPDhelp_termsOfService *_data); - friend MTPhelp_termsOfService MTP_help_termsOfService(const MTPstring &_text); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPhelp_TermsOfService; @@ -8694,8 +8701,8 @@ private: explicit MTPfoundGif(MTPDfoundGif *_data); explicit MTPfoundGif(MTPDfoundGifCached *_data); - friend MTPfoundGif MTP_foundGif(const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h); - friend MTPfoundGif MTP_foundGifCached(const MTPstring &_url, const MTPPhoto &_photo, const MTPDocument &_document); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8728,7 +8735,7 @@ public: private: explicit MTPmessages_foundGifs(MTPDmessages_foundGifs *_data); - friend MTPmessages_foundGifs MTP_messages_foundGifs(MTPint _next_offset, const MTPVector &_results); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_FoundGifs; @@ -8763,8 +8770,8 @@ private: explicit MTPmessages_savedGifs(mtpTypeId type); explicit MTPmessages_savedGifs(MTPDmessages_savedGifs *_data); - friend MTPmessages_savedGifs MTP_messages_savedGifsNotModified(); - friend MTPmessages_savedGifs MTP_messages_savedGifs(MTPint _hash, const MTPVector &_gifs); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8814,8 +8821,8 @@ private: explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaAuto *_data); explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageText *_data); - friend MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaAuto(const MTPstring &_caption); - friend MTPinputBotInlineMessage MTP_inputBotInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8848,7 +8855,7 @@ public: private: explicit MTPinputBotInlineResult(MTPDinputBotInlineResult *_data); - friend MTPinputBotInlineResult MTP_inputBotInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPInputBotInlineResult; @@ -8896,8 +8903,8 @@ private: explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaAuto *_data); explicit MTPbotInlineMessage(MTPDbotInlineMessageText *_data); - friend MTPbotInlineMessage MTP_botInlineMessageMediaAuto(const MTPstring &_caption); - friend MTPbotInlineMessage MTP_botInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8960,9 +8967,9 @@ private: explicit MTPbotInlineResult(MTPDbotInlineMediaResultPhoto *_data); explicit MTPbotInlineResult(MTPDbotInlineResult *_data); - friend MTPbotInlineResult MTP_botInlineMediaResultDocument(const MTPstring &_id, const MTPstring &_type, const MTPDocument &_document, const MTPBotInlineMessage &_send_message); - friend MTPbotInlineResult MTP_botInlineMediaResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPPhoto &_photo, const MTPBotInlineMessage &_send_message); - friend MTPbotInlineResult MTP_botInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -8995,7 +9002,7 @@ public: private: explicit MTPmessages_botResults(MTPDmessages_botResults *_data); - friend MTPmessages_botResults MTP_messages_botResults(MTPint _flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPmessages_BotResults; @@ -9026,7 +9033,7 @@ public: private: explicit MTPexportedMessageLink(MTPDexportedMessageLink *_data); - friend MTPexportedMessageLink MTP_exportedMessageLink(const MTPstring &_link); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPExportedMessageLink; @@ -9057,7 +9064,7 @@ public: private: explicit MTPmessageFwdHeader(MTPDmessageFwdHeader *_data); - friend MTPmessageFwdHeader MTP_messageFwdHeader(MTPint _flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPMessageFwdHeader; @@ -9088,7 +9095,7 @@ public: private: explicit MTPchannels_messageEditData(MTPDchannels_messageEditData *_data); - friend MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags); + friend class MTP::internal::TypeCreator; }; typedef MTPBoxed MTPchannels_MessageEditData; @@ -9110,9 +9117,9 @@ public: private: explicit MTPauth_codeType(mtpTypeId type); - friend MTPauth_codeType MTP_auth_codeTypeSms(); - friend MTPauth_codeType MTP_auth_codeTypeCall(); - friend MTPauth_codeType MTP_auth_codeTypeFlashCall(); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -9188,10 +9195,10 @@ private: explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeCall *_data); explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeFlashCall *_data); - friend MTPauth_sentCodeType MTP_auth_sentCodeTypeApp(MTPint _length); - friend MTPauth_sentCodeType MTP_auth_sentCodeTypeSms(MTPint _length); - friend MTPauth_sentCodeType MTP_auth_sentCodeTypeCall(MTPint _length); - friend MTPauth_sentCodeType MTP_auth_sentCodeTypeFlashCall(const MTPstring &_pattern); + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; + friend class MTP::internal::TypeCreator; mtpTypeId _type; }; @@ -9888,12 +9895,60 @@ public: class MTPDuser : public mtpDataImpl { public: + enum class Flag : int32 { + f_self = (1 << 10), + f_contact = (1 << 11), + f_mutual_contact = (1 << 12), + f_deleted = (1 << 13), + f_bot = (1 << 14), + f_bot_chat_history = (1 << 15), + f_bot_nochats = (1 << 16), + f_verified = (1 << 17), + f_restricted = (1 << 18), + f_min = (1 << 20), + f_access_hash = (1 << 0), + f_first_name = (1 << 1), + f_last_name = (1 << 2), + f_username = (1 << 3), + f_phone = (1 << 4), + f_photo = (1 << 5), + f_status = (1 << 6), + f_bot_info_version = (1 << 14), + f_restriction_reason = (1 << 18), + f_bot_inline_placeholder = (1 << 19), + + MAX_FIELD = (1 << 20), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_self() const { return vflags.v & Flag::f_self; } + bool is_contact() const { return vflags.v & Flag::f_contact; } + bool is_mutual_contact() const { return vflags.v & Flag::f_mutual_contact; } + bool is_deleted() const { return vflags.v & Flag::f_deleted; } + bool is_bot() const { return vflags.v & Flag::f_bot; } + bool is_bot_chat_history() const { return vflags.v & Flag::f_bot_chat_history; } + bool is_bot_nochats() const { return vflags.v & Flag::f_bot_nochats; } + bool is_verified() const { return vflags.v & Flag::f_verified; } + bool is_restricted() const { return vflags.v & Flag::f_restricted; } + bool is_min() const { return vflags.v & Flag::f_min; } + bool has_access_hash() const { return vflags.v & Flag::f_access_hash; } + bool has_first_name() const { return vflags.v & Flag::f_first_name; } + bool has_last_name() const { return vflags.v & Flag::f_last_name; } + bool has_username() const { return vflags.v & Flag::f_username; } + bool has_phone() const { return vflags.v & Flag::f_phone; } + bool has_photo() const { return vflags.v & Flag::f_photo; } + bool has_status() const { return vflags.v & Flag::f_status; } + bool has_bot_info_version() const { return vflags.v & Flag::f_bot_info_version; } + bool has_restriction_reason() const { return vflags.v & Flag::f_restriction_reason; } + bool has_bot_inline_placeholder() const { return vflags.v & Flag::f_bot_inline_placeholder; } + MTPDuser() { } - MTPDuser(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vfirst_name(_first_name), vlast_name(_last_name), vusername(_username), vphone(_phone), vphoto(_photo), vstatus(_status), vbot_info_version(_bot_info_version), vrestriction_reason(_restriction_reason), vbot_inline_placeholder(_bot_inline_placeholder) { + MTPDuser(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vfirst_name(_first_name), vlast_name(_last_name), vusername(_username), vphone(_phone), vphoto(_photo), vstatus(_status), vbot_info_version(_bot_info_version), vrestriction_reason(_restriction_reason), vbot_inline_placeholder(_bot_inline_placeholder) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPlong vaccess_hash; MTPstring vfirst_name; @@ -9905,50 +9960,6 @@ public: MTPint vbot_info_version; MTPstring vrestriction_reason; MTPstring vbot_inline_placeholder; - - enum { - flag_self = (1 << 10), - flag_contact = (1 << 11), - flag_mutual_contact = (1 << 12), - flag_deleted = (1 << 13), - flag_bot = (1 << 14), - flag_bot_chat_history = (1 << 15), - flag_bot_nochats = (1 << 16), - flag_verified = (1 << 17), - flag_restricted = (1 << 18), - flag_min = (1 << 20), - flag_access_hash = (1 << 0), - flag_first_name = (1 << 1), - flag_last_name = (1 << 2), - flag_username = (1 << 3), - flag_phone = (1 << 4), - flag_photo = (1 << 5), - flag_status = (1 << 6), - flag_bot_info_version = (1 << 14), - flag_restriction_reason = (1 << 18), - flag_bot_inline_placeholder = (1 << 19), - }; - - bool is_self() const { return vflags.v & flag_self; } - bool is_contact() const { return vflags.v & flag_contact; } - bool is_mutual_contact() const { return vflags.v & flag_mutual_contact; } - bool is_deleted() const { return vflags.v & flag_deleted; } - bool is_bot() const { return vflags.v & flag_bot; } - bool is_bot_chat_history() const { return vflags.v & flag_bot_chat_history; } - bool is_bot_nochats() const { return vflags.v & flag_bot_nochats; } - bool is_verified() const { return vflags.v & flag_verified; } - bool is_restricted() const { return vflags.v & flag_restricted; } - bool is_min() const { return vflags.v & flag_min; } - bool has_access_hash() const { return vflags.v & flag_access_hash; } - bool has_first_name() const { return vflags.v & flag_first_name; } - bool has_last_name() const { return vflags.v & flag_last_name; } - bool has_username() const { return vflags.v & flag_username; } - bool has_phone() const { return vflags.v & flag_phone; } - bool has_photo() const { return vflags.v & flag_photo; } - bool has_status() const { return vflags.v & flag_status; } - bool has_bot_info_version() const { return vflags.v & flag_bot_info_version; } - bool has_restriction_reason() const { return vflags.v & flag_restriction_reason; } - bool has_bot_inline_placeholder() const { return vflags.v & flag_bot_inline_placeholder; } }; class MTPDuserProfilePhoto : public mtpDataImpl { @@ -9995,12 +10006,34 @@ public: class MTPDchat : public mtpDataImpl { public: + enum class Flag : int32 { + f_creator = (1 << 0), + f_kicked = (1 << 1), + f_left = (1 << 2), + f_admins_enabled = (1 << 3), + f_admin = (1 << 4), + f_deactivated = (1 << 5), + f_migrated_to = (1 << 6), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_creator() const { return vflags.v & Flag::f_creator; } + bool is_kicked() const { return vflags.v & Flag::f_kicked; } + bool is_left() const { return vflags.v & Flag::f_left; } + bool is_admins_enabled() const { return vflags.v & Flag::f_admins_enabled; } + bool is_admin() const { return vflags.v & Flag::f_admin; } + bool is_deactivated() const { return vflags.v & Flag::f_deactivated; } + bool has_migrated_to() const { return vflags.v & Flag::f_migrated_to; } + MTPDchat() { } - MTPDchat(MTPint _flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to) : vflags(_flags), vid(_id), vtitle(_title), vphoto(_photo), vparticipants_count(_participants_count), vdate(_date), vversion(_version), vmigrated_to(_migrated_to) { + MTPDchat(const MTPflags &_flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to) : vflags(_flags), vid(_id), vtitle(_title), vphoto(_photo), vparticipants_count(_participants_count), vdate(_date), vversion(_version), vmigrated_to(_migrated_to) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPstring vtitle; MTPChatPhoto vphoto; @@ -10008,24 +10041,6 @@ public: MTPint vdate; MTPint vversion; MTPInputChannel vmigrated_to; - - enum { - flag_creator = (1 << 0), - flag_kicked = (1 << 1), - flag_left = (1 << 2), - flag_admins_enabled = (1 << 3), - flag_admin = (1 << 4), - flag_deactivated = (1 << 5), - flag_migrated_to = (1 << 6), - }; - - bool is_creator() const { return vflags.v & flag_creator; } - bool is_kicked() const { return vflags.v & flag_kicked; } - bool is_left() const { return vflags.v & flag_left; } - bool is_admins_enabled() const { return vflags.v & flag_admins_enabled; } - bool is_admin() const { return vflags.v & flag_admin; } - bool is_deactivated() const { return vflags.v & flag_deactivated; } - bool has_migrated_to() const { return vflags.v & flag_migrated_to; } }; class MTPDchatForbidden : public mtpDataImpl { @@ -10041,12 +10056,50 @@ public: class MTPDchannel : public mtpDataImpl { public: + enum class Flag : int32 { + f_creator = (1 << 0), + f_kicked = (1 << 1), + f_left = (1 << 2), + f_editor = (1 << 3), + f_moderator = (1 << 4), + f_broadcast = (1 << 5), + f_verified = (1 << 7), + f_megagroup = (1 << 8), + f_restricted = (1 << 9), + f_democracy = (1 << 10), + f_signatures = (1 << 11), + f_min = (1 << 12), + f_access_hash = (1 << 13), + f_username = (1 << 6), + f_restriction_reason = (1 << 9), + + MAX_FIELD = (1 << 13), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_creator() const { return vflags.v & Flag::f_creator; } + bool is_kicked() const { return vflags.v & Flag::f_kicked; } + bool is_left() const { return vflags.v & Flag::f_left; } + bool is_editor() const { return vflags.v & Flag::f_editor; } + bool is_moderator() const { return vflags.v & Flag::f_moderator; } + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_verified() const { return vflags.v & Flag::f_verified; } + bool is_megagroup() const { return vflags.v & Flag::f_megagroup; } + bool is_restricted() const { return vflags.v & Flag::f_restricted; } + bool is_democracy() const { return vflags.v & Flag::f_democracy; } + bool is_signatures() const { return vflags.v & Flag::f_signatures; } + bool is_min() const { return vflags.v & Flag::f_min; } + bool has_access_hash() const { return vflags.v & Flag::f_access_hash; } + bool has_username() const { return vflags.v & Flag::f_username; } + bool has_restriction_reason() const { return vflags.v & Flag::f_restriction_reason; } + MTPDchannel() { } - MTPDchannel(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vtitle(_title), vusername(_username), vphoto(_photo), vdate(_date), vversion(_version), vrestriction_reason(_restriction_reason) { + MTPDchannel(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vtitle(_title), vusername(_username), vphoto(_photo), vdate(_date), vversion(_version), vrestriction_reason(_restriction_reason) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPlong vaccess_hash; MTPstring vtitle; @@ -10055,40 +10108,6 @@ public: MTPint vdate; MTPint vversion; MTPstring vrestriction_reason; - - enum { - flag_creator = (1 << 0), - flag_kicked = (1 << 1), - flag_left = (1 << 2), - flag_editor = (1 << 3), - flag_moderator = (1 << 4), - flag_broadcast = (1 << 5), - flag_verified = (1 << 7), - flag_megagroup = (1 << 8), - flag_restricted = (1 << 9), - flag_democracy = (1 << 10), - flag_signatures = (1 << 11), - flag_min = (1 << 12), - flag_access_hash = (1 << 13), - flag_username = (1 << 6), - flag_restriction_reason = (1 << 9), - }; - - bool is_creator() const { return vflags.v & flag_creator; } - bool is_kicked() const { return vflags.v & flag_kicked; } - bool is_left() const { return vflags.v & flag_left; } - bool is_editor() const { return vflags.v & flag_editor; } - bool is_moderator() const { return vflags.v & flag_moderator; } - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_verified() const { return vflags.v & flag_verified; } - bool is_megagroup() const { return vflags.v & flag_megagroup; } - bool is_restricted() const { return vflags.v & flag_restricted; } - bool is_democracy() const { return vflags.v & flag_democracy; } - bool is_signatures() const { return vflags.v & flag_signatures; } - bool is_min() const { return vflags.v & flag_min; } - bool has_access_hash() const { return vflags.v & flag_access_hash; } - bool has_username() const { return vflags.v & flag_username; } - bool has_restriction_reason() const { return vflags.v & flag_restriction_reason; } }; class MTPDchannelForbidden : public mtpDataImpl { @@ -10120,12 +10139,36 @@ public: class MTPDchannelFull : public mtpDataImpl { public: + enum class Flag : int32 { + f_can_view_participants = (1 << 3), + f_can_set_username = (1 << 6), + f_participants_count = (1 << 0), + f_admins_count = (1 << 1), + f_kicked_count = (1 << 2), + f_migrated_from_chat_id = (1 << 4), + f_migrated_from_max_id = (1 << 4), + f_pinned_msg_id = (1 << 5), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_can_view_participants() const { return vflags.v & Flag::f_can_view_participants; } + bool is_can_set_username() const { return vflags.v & Flag::f_can_set_username; } + bool has_participants_count() const { return vflags.v & Flag::f_participants_count; } + bool has_admins_count() const { return vflags.v & Flag::f_admins_count; } + bool has_kicked_count() const { return vflags.v & Flag::f_kicked_count; } + bool has_migrated_from_chat_id() const { return vflags.v & Flag::f_migrated_from_chat_id; } + bool has_migrated_from_max_id() const { return vflags.v & Flag::f_migrated_from_max_id; } + bool has_pinned_msg_id() const { return vflags.v & Flag::f_pinned_msg_id; } + MTPDchannelFull() { } - MTPDchannelFull(MTPint _flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id) : vflags(_flags), vid(_id), vabout(_about), vparticipants_count(_participants_count), vadmins_count(_admins_count), vkicked_count(_kicked_count), vread_inbox_max_id(_read_inbox_max_id), vunread_count(_unread_count), vunread_important_count(_unread_important_count), vchat_photo(_chat_photo), vnotify_settings(_notify_settings), vexported_invite(_exported_invite), vbot_info(_bot_info), vmigrated_from_chat_id(_migrated_from_chat_id), vmigrated_from_max_id(_migrated_from_max_id), vpinned_msg_id(_pinned_msg_id) { + MTPDchannelFull(const MTPflags &_flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id) : vflags(_flags), vid(_id), vabout(_about), vparticipants_count(_participants_count), vadmins_count(_admins_count), vkicked_count(_kicked_count), vread_inbox_max_id(_read_inbox_max_id), vunread_count(_unread_count), vunread_important_count(_unread_important_count), vchat_photo(_chat_photo), vnotify_settings(_notify_settings), vexported_invite(_exported_invite), vbot_info(_bot_info), vmigrated_from_chat_id(_migrated_from_chat_id), vmigrated_from_max_id(_migrated_from_max_id), vpinned_msg_id(_pinned_msg_id) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPstring vabout; MTPint vparticipants_count; @@ -10141,26 +10184,6 @@ public: MTPint vmigrated_from_chat_id; MTPint vmigrated_from_max_id; MTPint vpinned_msg_id; - - enum { - flag_can_view_participants = (1 << 3), - flag_can_set_username = (1 << 6), - flag_participants_count = (1 << 0), - flag_admins_count = (1 << 1), - flag_kicked_count = (1 << 2), - flag_migrated_from_chat_id = (1 << 4), - flag_migrated_from_max_id = (1 << 4), - flag_pinned_msg_id = (1 << 5), - }; - - bool is_can_view_participants() const { return vflags.v & flag_can_view_participants; } - bool is_can_set_username() const { return vflags.v & flag_can_set_username; } - bool has_participants_count() const { return vflags.v & flag_participants_count; } - bool has_admins_count() const { return vflags.v & flag_admins_count; } - bool has_kicked_count() const { return vflags.v & flag_kicked_count; } - bool has_migrated_from_chat_id() const { return vflags.v & flag_migrated_from_chat_id; } - bool has_migrated_from_max_id() const { return vflags.v & flag_migrated_from_max_id; } - bool has_pinned_msg_id() const { return vflags.v & flag_pinned_msg_id; } }; class MTPDchatParticipant : public mtpDataImpl { @@ -10199,20 +10222,22 @@ public: class MTPDchatParticipantsForbidden : public mtpDataImpl { public: + enum class Flag : int32 { + f_self_participant = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_self_participant() const { return vflags.v & Flag::f_self_participant; } + MTPDchatParticipantsForbidden() { } - MTPDchatParticipantsForbidden(MTPint _flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) : vflags(_flags), vchat_id(_chat_id), vself_participant(_self_participant) { + MTPDchatParticipantsForbidden(const MTPflags &_flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) : vflags(_flags), vchat_id(_chat_id), vself_participant(_self_participant) { } - MTPint vflags; + MTPflags vflags; MTPint vchat_id; MTPChatParticipant vself_participant; - - enum { - flag_self_participant = (1 << 0), - }; - - bool has_self_participant() const { return vflags.v & flag_self_participant; } }; class MTPDchatParticipants : public mtpDataImpl { @@ -10250,12 +10275,50 @@ public: class MTPDmessage : public mtpDataImpl { public: + enum class Flag : int32 { + f_unread = (1 << 0), + f_out = (1 << 1), + f_mentioned = (1 << 4), + f_media_unread = (1 << 5), + f_silent = (1 << 13), + f_post = (1 << 14), + f_from_id = (1 << 8), + f_fwd_from = (1 << 2), + f_via_bot_id = (1 << 11), + f_reply_to_msg_id = (1 << 3), + f_media = (1 << 9), + f_reply_markup = (1 << 6), + f_entities = (1 << 7), + f_views = (1 << 10), + f_edit_date = (1 << 15), + + MAX_FIELD = (1 << 15), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_unread() const { return vflags.v & Flag::f_unread; } + bool is_out() const { return vflags.v & Flag::f_out; } + bool is_mentioned() const { return vflags.v & Flag::f_mentioned; } + bool is_media_unread() const { return vflags.v & Flag::f_media_unread; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_post() const { return vflags.v & Flag::f_post; } + bool has_from_id() const { return vflags.v & Flag::f_from_id; } + bool has_fwd_from() const { return vflags.v & Flag::f_fwd_from; } + bool has_via_bot_id() const { return vflags.v & Flag::f_via_bot_id; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + bool has_media() const { return vflags.v & Flag::f_media; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + bool has_views() const { return vflags.v & Flag::f_views; } + bool has_edit_date() const { return vflags.v & Flag::f_edit_date; } + MTPDmessage() { } - MTPDmessage(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), vdate(_date), vmessage(_message), vmedia(_media), vreply_markup(_reply_markup), ventities(_entities), vviews(_views), vedit_date(_edit_date) { + MTPDmessage(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), vdate(_date), vmessage(_message), vmedia(_media), vreply_markup(_reply_markup), ventities(_entities), vviews(_views), vedit_date(_edit_date) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPint vfrom_id; MTPPeer vto_id; @@ -10269,76 +10332,46 @@ public: MTPVector ventities; MTPint vviews; MTPint vedit_date; - - enum { - flag_unread = (1 << 0), - flag_out = (1 << 1), - flag_mentioned = (1 << 4), - flag_media_unread = (1 << 5), - flag_silent = (1 << 13), - flag_post = (1 << 14), - flag_from_id = (1 << 8), - flag_fwd_from = (1 << 2), - flag_via_bot_id = (1 << 11), - flag_reply_to_msg_id = (1 << 3), - flag_media = (1 << 9), - flag_reply_markup = (1 << 6), - flag_entities = (1 << 7), - flag_views = (1 << 10), - flag_edit_date = (1 << 15), - }; - - bool is_unread() const { return vflags.v & flag_unread; } - bool is_out() const { return vflags.v & flag_out; } - bool is_mentioned() const { return vflags.v & flag_mentioned; } - bool is_media_unread() const { return vflags.v & flag_media_unread; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_post() const { return vflags.v & flag_post; } - bool has_from_id() const { return vflags.v & flag_from_id; } - bool has_fwd_from() const { return vflags.v & flag_fwd_from; } - bool has_via_bot_id() const { return vflags.v & flag_via_bot_id; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - bool has_media() const { return vflags.v & flag_media; } - bool has_reply_markup() const { return vflags.v & flag_reply_markup; } - bool has_entities() const { return vflags.v & flag_entities; } - bool has_views() const { return vflags.v & flag_views; } - bool has_edit_date() const { return vflags.v & flag_edit_date; } }; class MTPDmessageService : public mtpDataImpl { public: + enum class Flag : int32 { + f_unread = (1 << 0), + f_out = (1 << 1), + f_mentioned = (1 << 4), + f_media_unread = (1 << 5), + f_silent = (1 << 13), + f_post = (1 << 14), + f_from_id = (1 << 8), + f_reply_to_msg_id = (1 << 3), + + MAX_FIELD = (1 << 14), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_unread() const { return vflags.v & Flag::f_unread; } + bool is_out() const { return vflags.v & Flag::f_out; } + bool is_mentioned() const { return vflags.v & Flag::f_mentioned; } + bool is_media_unread() const { return vflags.v & Flag::f_media_unread; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_post() const { return vflags.v & Flag::f_post; } + bool has_from_id() const { return vflags.v & Flag::f_from_id; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + MTPDmessageService() { } - MTPDmessageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vreply_to_msg_id(_reply_to_msg_id), vdate(_date), vaction(_action) { + MTPDmessageService(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vreply_to_msg_id(_reply_to_msg_id), vdate(_date), vaction(_action) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPint vfrom_id; MTPPeer vto_id; MTPint vreply_to_msg_id; MTPint vdate; MTPMessageAction vaction; - - enum { - flag_unread = (1 << 0), - flag_out = (1 << 1), - flag_mentioned = (1 << 4), - flag_media_unread = (1 << 5), - flag_silent = (1 << 13), - flag_post = (1 << 14), - flag_from_id = (1 << 8), - flag_reply_to_msg_id = (1 << 3), - }; - - bool is_unread() const { return vflags.v & flag_unread; } - bool is_out() const { return vflags.v & flag_out; } - bool is_mentioned() const { return vflags.v & flag_mentioned; } - bool is_media_unread() const { return vflags.v & flag_media_unread; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_post() const { return vflags.v & flag_post; } - bool has_from_id() const { return vflags.v & flag_from_id; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } }; class MTPDmessageMediaPhoto : public mtpDataImpl { @@ -10617,26 +10650,30 @@ public: class MTPDauth_sentCode : public mtpDataImpl { public: + enum class Flag : int32 { + f_phone_registered = (1 << 0), + f_next_type = (1 << 1), + f_timeout = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_phone_registered() const { return vflags.v & Flag::f_phone_registered; } + bool has_next_type() const { return vflags.v & Flag::f_next_type; } + bool has_timeout() const { return vflags.v & Flag::f_timeout; } + MTPDauth_sentCode() { } - MTPDauth_sentCode(MTPint _flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout) : vflags(_flags), vtype(_type), vphone_code_hash(_phone_code_hash), vnext_type(_next_type), vtimeout(_timeout) { + MTPDauth_sentCode(const MTPflags &_flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout) : vflags(_flags), vtype(_type), vphone_code_hash(_phone_code_hash), vnext_type(_next_type), vtimeout(_timeout) { } - MTPint vflags; + MTPflags vflags; MTPauth_SentCodeType vtype; MTPstring vphone_code_hash; MTPauth_CodeType vnext_type; MTPint vtimeout; - - enum { - flag_phone_registered = (1 << 0), - flag_next_type = (1 << 1), - flag_timeout = (1 << 2), - }; - - bool is_phone_registered() const { return vflags.v & flag_phone_registered; } - bool has_next_type() const { return vflags.v & flag_next_type; } - bool has_timeout() const { return vflags.v & flag_timeout; } }; class MTPDauth_authorization : public mtpDataImpl { @@ -10672,58 +10709,68 @@ public: class MTPDinputPeerNotifySettings : public mtpDataImpl { public: + enum class Flag : int32 { + f_show_previews = (1 << 0), + f_silent = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_show_previews() const { return vflags.v & Flag::f_show_previews; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + MTPDinputPeerNotifySettings() { } - MTPDinputPeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) : vflags(_flags), vmute_until(_mute_until), vsound(_sound) { + MTPDinputPeerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) : vflags(_flags), vmute_until(_mute_until), vsound(_sound) { } - MTPint vflags; + MTPflags vflags; MTPint vmute_until; MTPstring vsound; - - enum { - flag_show_previews = (1 << 0), - flag_silent = (1 << 1), - }; - - bool is_show_previews() const { return vflags.v & flag_show_previews; } - bool is_silent() const { return vflags.v & flag_silent; } }; class MTPDpeerNotifySettings : public mtpDataImpl { public: + enum class Flag : int32 { + f_show_previews = (1 << 0), + f_silent = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_show_previews() const { return vflags.v & Flag::f_show_previews; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + MTPDpeerNotifySettings() { } - MTPDpeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) : vflags(_flags), vmute_until(_mute_until), vsound(_sound) { + MTPDpeerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) : vflags(_flags), vmute_until(_mute_until), vsound(_sound) { } - MTPint vflags; + MTPflags vflags; MTPint vmute_until; MTPstring vsound; - - enum { - flag_show_previews = (1 << 0), - flag_silent = (1 << 1), - }; - - bool is_show_previews() const { return vflags.v & flag_show_previews; } - bool is_silent() const { return vflags.v & flag_silent; } }; class MTPDpeerSettings : public mtpDataImpl { public: + enum class Flag : int32 { + f_report_spam = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_report_spam() const { return vflags.v & Flag::f_report_spam; } + MTPDpeerSettings() { } - MTPDpeerSettings(MTPint _flags) : vflags(_flags) { + MTPDpeerSettings(const MTPflags &_flags) : vflags(_flags) { } - MTPint vflags; - - enum { - flag_report_spam = (1 << 0), - }; - - bool is_report_spam() const { return vflags.v & flag_report_spam; } + MTPflags vflags; }; class MTPDwallPaper : public mtpDataImpl { @@ -10764,30 +10811,34 @@ public: class MTPDuserFull : public mtpDataImpl { public: + enum class Flag : int32 { + f_blocked = (1 << 0), + f_about = (1 << 1), + f_profile_photo = (1 << 2), + f_bot_info = (1 << 3), + + MAX_FIELD = (1 << 3), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_blocked() const { return vflags.v & Flag::f_blocked; } + bool has_about() const { return vflags.v & Flag::f_about; } + bool has_profile_photo() const { return vflags.v & Flag::f_profile_photo; } + bool has_bot_info() const { return vflags.v & Flag::f_bot_info; } + MTPDuserFull() { } - MTPDuserFull(MTPint _flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info) : vflags(_flags), vuser(_user), vabout(_about), vlink(_link), vprofile_photo(_profile_photo), vnotify_settings(_notify_settings), vbot_info(_bot_info) { + MTPDuserFull(const MTPflags &_flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info) : vflags(_flags), vuser(_user), vabout(_about), vlink(_link), vprofile_photo(_profile_photo), vnotify_settings(_notify_settings), vbot_info(_bot_info) { } - MTPint vflags; + MTPflags vflags; MTPUser vuser; MTPstring vabout; MTPcontacts_Link vlink; MTPPhoto vprofile_photo; MTPPeerNotifySettings vnotify_settings; MTPBotInfo vbot_info; - - enum { - flag_blocked = (1 << 0), - flag_about = (1 << 1), - flag_profile_photo = (1 << 2), - flag_bot_info = (1 << 3), - }; - - bool is_blocked() const { return vflags.v & flag_blocked; } - bool has_about() const { return vflags.v & flag_about; } - bool has_profile_photo() const { return vflags.v & flag_profile_photo; } - bool has_bot_info() const { return vflags.v & flag_bot_info; } }; class MTPDcontact : public mtpDataImpl { @@ -10946,24 +10997,26 @@ public: class MTPDmessages_channelMessages : public mtpDataImpl { public: + enum class Flag : int32 { + f_collapsed = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_collapsed() const { return vflags.v & Flag::f_collapsed; } + MTPDmessages_channelMessages() { } - MTPDmessages_channelMessages(MTPint _flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vcount(_count), vmessages(_messages), vcollapsed(_collapsed), vchats(_chats), vusers(_users) { + MTPDmessages_channelMessages(const MTPflags &_flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vcount(_count), vmessages(_messages), vcollapsed(_collapsed), vchats(_chats), vusers(_users) { } - MTPint vflags; + MTPflags vflags; MTPint vpts; MTPint vcount; MTPVector vmessages; MTPVector vcollapsed; MTPVector vchats; MTPVector vusers; - - enum { - flag_collapsed = (1 << 0), - }; - - bool has_collapsed() const { return vflags.v & flag_collapsed; } }; class MTPDmessages_chats : public mtpDataImpl { @@ -11330,20 +11383,22 @@ public: class MTPDupdateChannelTooLong : public mtpDataImpl { public: + enum class Flag : int32 { + f_pts = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_pts() const { return vflags.v & Flag::f_pts; } + MTPDupdateChannelTooLong() { } - MTPDupdateChannelTooLong(MTPint _flags, MTPint _channel_id, MTPint _pts) : vflags(_flags), vchannel_id(_channel_id), vpts(_pts) { + MTPDupdateChannelTooLong(const MTPflags &_flags, MTPint _channel_id, MTPint _pts) : vflags(_flags), vchannel_id(_channel_id), vpts(_pts) { } - MTPint vflags; + MTPflags vflags; MTPint vchannel_id; MTPint vpts; - - enum { - flag_pts = (1 << 0), - }; - - bool has_pts() const { return vflags.v & flag_pts; } }; class MTPDupdateChannel : public mtpDataImpl { @@ -11565,12 +11620,38 @@ public: class MTPDupdateShortMessage : public mtpDataImpl { public: + enum class Flag : int32 { + f_unread = (1 << 0), + f_out = (1 << 1), + f_mentioned = (1 << 4), + f_media_unread = (1 << 5), + f_silent = (1 << 13), + f_fwd_from = (1 << 2), + f_via_bot_id = (1 << 11), + f_reply_to_msg_id = (1 << 3), + f_entities = (1 << 7), + + MAX_FIELD = (1 << 13), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_unread() const { return vflags.v & Flag::f_unread; } + bool is_out() const { return vflags.v & Flag::f_out; } + bool is_mentioned() const { return vflags.v & Flag::f_mentioned; } + bool is_media_unread() const { return vflags.v & Flag::f_media_unread; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool has_fwd_from() const { return vflags.v & Flag::f_fwd_from; } + bool has_via_bot_id() const { return vflags.v & Flag::f_via_bot_id; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + MTPDupdateShortMessage() { } - MTPDupdateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) : vflags(_flags), vid(_id), vuser_id(_user_id), vmessage(_message), vpts(_pts), vpts_count(_pts_count), vdate(_date), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + MTPDupdateShortMessage(const MTPflags &_flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) : vflags(_flags), vid(_id), vuser_id(_user_id), vmessage(_message), vpts(_pts), vpts_count(_pts_count), vdate(_date), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPint vuser_id; MTPstring vmessage; @@ -11581,38 +11662,42 @@ public: MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; - - enum { - flag_unread = (1 << 0), - flag_out = (1 << 1), - flag_mentioned = (1 << 4), - flag_media_unread = (1 << 5), - flag_silent = (1 << 13), - flag_fwd_from = (1 << 2), - flag_via_bot_id = (1 << 11), - flag_reply_to_msg_id = (1 << 3), - flag_entities = (1 << 7), - }; - - bool is_unread() const { return vflags.v & flag_unread; } - bool is_out() const { return vflags.v & flag_out; } - bool is_mentioned() const { return vflags.v & flag_mentioned; } - bool is_media_unread() const { return vflags.v & flag_media_unread; } - bool is_silent() const { return vflags.v & flag_silent; } - bool has_fwd_from() const { return vflags.v & flag_fwd_from; } - bool has_via_bot_id() const { return vflags.v & flag_via_bot_id; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - bool has_entities() const { return vflags.v & flag_entities; } }; class MTPDupdateShortChatMessage : public mtpDataImpl { public: + enum class Flag : int32 { + f_unread = (1 << 0), + f_out = (1 << 1), + f_mentioned = (1 << 4), + f_media_unread = (1 << 5), + f_silent = (1 << 13), + f_fwd_from = (1 << 2), + f_via_bot_id = (1 << 11), + f_reply_to_msg_id = (1 << 3), + f_entities = (1 << 7), + + MAX_FIELD = (1 << 13), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_unread() const { return vflags.v & Flag::f_unread; } + bool is_out() const { return vflags.v & Flag::f_out; } + bool is_mentioned() const { return vflags.v & Flag::f_mentioned; } + bool is_media_unread() const { return vflags.v & Flag::f_media_unread; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool has_fwd_from() const { return vflags.v & Flag::f_fwd_from; } + bool has_via_bot_id() const { return vflags.v & Flag::f_via_bot_id; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + MTPDupdateShortChatMessage() { } - MTPDupdateShortChatMessage(MTPint _flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) : vflags(_flags), vid(_id), vfrom_id(_from_id), vchat_id(_chat_id), vmessage(_message), vpts(_pts), vpts_count(_pts_count), vdate(_date), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + MTPDupdateShortChatMessage(const MTPflags &_flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) : vflags(_flags), vid(_id), vfrom_id(_from_id), vchat_id(_chat_id), vmessage(_message), vpts(_pts), vpts_count(_pts_count), vdate(_date), vfwd_from(_fwd_from), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPint vfrom_id; MTPint vchat_id; @@ -11624,28 +11709,6 @@ public: MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; - - enum { - flag_unread = (1 << 0), - flag_out = (1 << 1), - flag_mentioned = (1 << 4), - flag_media_unread = (1 << 5), - flag_silent = (1 << 13), - flag_fwd_from = (1 << 2), - flag_via_bot_id = (1 << 11), - flag_reply_to_msg_id = (1 << 3), - flag_entities = (1 << 7), - }; - - bool is_unread() const { return vflags.v & flag_unread; } - bool is_out() const { return vflags.v & flag_out; } - bool is_mentioned() const { return vflags.v & flag_mentioned; } - bool is_media_unread() const { return vflags.v & flag_media_unread; } - bool is_silent() const { return vflags.v & flag_silent; } - bool has_fwd_from() const { return vflags.v & flag_fwd_from; } - bool has_via_bot_id() const { return vflags.v & flag_via_bot_id; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - bool has_entities() const { return vflags.v & flag_entities; } }; class MTPDupdateShort : public mtpDataImpl { @@ -11690,30 +11753,34 @@ public: class MTPDupdateShortSentMessage : public mtpDataImpl { public: + enum class Flag : int32 { + f_unread = (1 << 0), + f_out = (1 << 1), + f_media = (1 << 9), + f_entities = (1 << 7), + + MAX_FIELD = (1 << 9), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_unread() const { return vflags.v & Flag::f_unread; } + bool is_out() const { return vflags.v & Flag::f_out; } + bool has_media() const { return vflags.v & Flag::f_media; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + MTPDupdateShortSentMessage() { } - MTPDupdateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) : vflags(_flags), vid(_id), vpts(_pts), vpts_count(_pts_count), vdate(_date), vmedia(_media), ventities(_entities) { + MTPDupdateShortSentMessage(const MTPflags &_flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) : vflags(_flags), vid(_id), vpts(_pts), vpts_count(_pts_count), vdate(_date), vmedia(_media), ventities(_entities) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPint vpts; MTPint vpts_count; MTPint vdate; MTPMessageMedia vmedia; MTPVector ventities; - - enum { - flag_unread = (1 << 0), - flag_out = (1 << 1), - flag_media = (1 << 9), - flag_entities = (1 << 7), - }; - - bool is_unread() const { return vflags.v & flag_unread; } - bool is_out() const { return vflags.v & flag_out; } - bool has_media() const { return vflags.v & flag_media; } - bool has_entities() const { return vflags.v & flag_entities; } }; class MTPDphotos_photos : public mtpDataImpl { @@ -11764,25 +11831,29 @@ public: class MTPDdcOption : public mtpDataImpl { public: + enum class Flag : int32 { + f_ipv6 = (1 << 0), + f_media_only = (1 << 1), + f_tcpo_only = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_ipv6() const { return vflags.v & Flag::f_ipv6; } + bool is_media_only() const { return vflags.v & Flag::f_media_only; } + bool is_tcpo_only() const { return vflags.v & Flag::f_tcpo_only; } + MTPDdcOption() { } - MTPDdcOption(MTPint _flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) : vflags(_flags), vid(_id), vip_address(_ip_address), vport(_port) { + MTPDdcOption(const MTPflags &_flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) : vflags(_flags), vid(_id), vip_address(_ip_address), vport(_port) { } - MTPint vflags; + MTPflags vflags; MTPint vid; MTPstring vip_address; MTPint vport; - - enum { - flag_ipv6 = (1 << 0), - flag_media_only = (1 << 1), - flag_tcpo_only = (1 << 2), - }; - - bool is_ipv6() const { return vflags.v & flag_ipv6; } - bool is_media_only() const { return vflags.v & flag_media_only; } - bool is_tcpo_only() const { return vflags.v & flag_tcpo_only; } }; class MTPDconfig : public mtpDataImpl { @@ -12254,28 +12325,32 @@ public: class MTPDdocumentAttributeAudio : public mtpDataImpl { public: + enum class Flag : int32 { + f_voice = (1 << 10), + f_title = (1 << 0), + f_performer = (1 << 1), + f_waveform = (1 << 2), + + MAX_FIELD = (1 << 10), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_voice() const { return vflags.v & Flag::f_voice; } + bool has_title() const { return vflags.v & Flag::f_title; } + bool has_performer() const { return vflags.v & Flag::f_performer; } + bool has_waveform() const { return vflags.v & Flag::f_waveform; } + MTPDdocumentAttributeAudio() { } - MTPDdocumentAttributeAudio(MTPint _flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform) : vflags(_flags), vduration(_duration), vtitle(_title), vperformer(_performer), vwaveform(_waveform) { + MTPDdocumentAttributeAudio(const MTPflags &_flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform) : vflags(_flags), vduration(_duration), vtitle(_title), vperformer(_performer), vwaveform(_waveform) { } - MTPint vflags; + MTPflags vflags; MTPint vduration; MTPstring vtitle; MTPstring vperformer; MTPbytes vwaveform; - - enum { - flag_voice = (1 << 10), - flag_title = (1 << 0), - flag_performer = (1 << 1), - flag_waveform = (1 << 2), - }; - - bool is_voice() const { return vflags.v & flag_voice; } - bool has_title() const { return vflags.v & flag_title; } - bool has_performer() const { return vflags.v & flag_performer; } - bool has_waveform() const { return vflags.v & flag_waveform; } }; class MTPDdocumentAttributeFilename : public mtpDataImpl { @@ -12366,12 +12441,44 @@ public: class MTPDwebPage : public mtpDataImpl { public: + enum class Flag : int32 { + f_type = (1 << 0), + f_site_name = (1 << 1), + f_title = (1 << 2), + f_description = (1 << 3), + f_photo = (1 << 4), + f_embed_url = (1 << 5), + f_embed_type = (1 << 5), + f_embed_width = (1 << 6), + f_embed_height = (1 << 6), + f_duration = (1 << 7), + f_author = (1 << 8), + f_document = (1 << 9), + + MAX_FIELD = (1 << 9), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_type() const { return vflags.v & Flag::f_type; } + bool has_site_name() const { return vflags.v & Flag::f_site_name; } + bool has_title() const { return vflags.v & Flag::f_title; } + bool has_description() const { return vflags.v & Flag::f_description; } + bool has_photo() const { return vflags.v & Flag::f_photo; } + bool has_embed_url() const { return vflags.v & Flag::f_embed_url; } + bool has_embed_type() const { return vflags.v & Flag::f_embed_type; } + bool has_embed_width() const { return vflags.v & Flag::f_embed_width; } + bool has_embed_height() const { return vflags.v & Flag::f_embed_height; } + bool has_duration() const { return vflags.v & Flag::f_duration; } + bool has_author() const { return vflags.v & Flag::f_author; } + bool has_document() const { return vflags.v & Flag::f_document; } + MTPDwebPage() { } - MTPDwebPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author), vdocument(_document) { + MTPDwebPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author), vdocument(_document) { } - MTPint vflags; + MTPflags vflags; MTPlong vid; MTPstring vurl; MTPstring vdisplay_url; @@ -12387,34 +12494,6 @@ public: MTPint vduration; MTPstring vauthor; MTPDocument vdocument; - - enum { - flag_type = (1 << 0), - flag_site_name = (1 << 1), - flag_title = (1 << 2), - flag_description = (1 << 3), - flag_photo = (1 << 4), - flag_embed_url = (1 << 5), - flag_embed_type = (1 << 5), - flag_embed_width = (1 << 6), - flag_embed_height = (1 << 6), - flag_duration = (1 << 7), - flag_author = (1 << 8), - flag_document = (1 << 9), - }; - - bool has_type() const { return vflags.v & flag_type; } - bool has_site_name() const { return vflags.v & flag_site_name; } - bool has_title() const { return vflags.v & flag_title; } - bool has_description() const { return vflags.v & flag_description; } - bool has_photo() const { return vflags.v & flag_photo; } - bool has_embed_url() const { return vflags.v & flag_embed_url; } - bool has_embed_type() const { return vflags.v & flag_embed_type; } - bool has_embed_width() const { return vflags.v & flag_embed_width; } - bool has_embed_height() const { return vflags.v & flag_embed_height; } - bool has_duration() const { return vflags.v & flag_duration; } - bool has_author() const { return vflags.v & flag_author; } - bool has_document() const { return vflags.v & flag_document; } }; class MTPDauthorization : public mtpDataImpl { @@ -12486,28 +12565,32 @@ public: class MTPDaccount_passwordInputSettings : public mtpDataImpl { public: + enum class Flag : int32 { + f_new_salt = (1 << 0), + f_new_password_hash = (1 << 0), + f_hint = (1 << 0), + f_email = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_new_salt() const { return vflags.v & Flag::f_new_salt; } + bool has_new_password_hash() const { return vflags.v & Flag::f_new_password_hash; } + bool has_hint() const { return vflags.v & Flag::f_hint; } + bool has_email() const { return vflags.v & Flag::f_email; } + MTPDaccount_passwordInputSettings() { } - MTPDaccount_passwordInputSettings(MTPint _flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email) : vflags(_flags), vnew_salt(_new_salt), vnew_password_hash(_new_password_hash), vhint(_hint), vemail(_email) { + MTPDaccount_passwordInputSettings(const MTPflags &_flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email) : vflags(_flags), vnew_salt(_new_salt), vnew_password_hash(_new_password_hash), vhint(_hint), vemail(_email) { } - MTPint vflags; + MTPflags vflags; MTPbytes vnew_salt; MTPbytes vnew_password_hash; MTPstring vhint; MTPstring vemail; - - enum { - flag_new_salt = (1 << 0), - flag_new_password_hash = (1 << 0), - flag_hint = (1 << 0), - flag_email = (1 << 1), - }; - - bool has_new_salt() const { return vflags.v & flag_new_salt; } - bool has_new_password_hash() const { return vflags.v & flag_new_password_hash; } - bool has_hint() const { return vflags.v & flag_hint; } - bool has_email() const { return vflags.v & flag_email; } }; class MTPDauth_passwordRecovery : public mtpDataImpl { @@ -12553,25 +12636,29 @@ public: class MTPDchatInvite : public mtpDataImpl { public: + enum class Flag : int32 { + f_channel = (1 << 0), + f_broadcast = (1 << 1), + f_public = (1 << 2), + f_megagroup = (1 << 3), + + MAX_FIELD = (1 << 3), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_channel() const { return vflags.v & Flag::f_channel; } + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_public() const { return vflags.v & Flag::f_public; } + bool is_megagroup() const { return vflags.v & Flag::f_megagroup; } + MTPDchatInvite() { } - MTPDchatInvite(MTPint _flags, const MTPstring &_title) : vflags(_flags), vtitle(_title) { + MTPDchatInvite(const MTPflags &_flags, const MTPstring &_title) : vflags(_flags), vtitle(_title) { } - MTPint vflags; + MTPflags vflags; MTPstring vtitle; - - enum { - flag_channel = (1 << 0), - flag_broadcast = (1 << 1), - flag_public = (1 << 2), - flag_megagroup = (1 << 3), - }; - - bool is_channel() const { return vflags.v & flag_channel; } - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_public() const { return vflags.v & flag_public; } - bool is_megagroup() const { return vflags.v & flag_megagroup; } }; class MTPDinputStickerSetID : public mtpDataImpl { @@ -12597,28 +12684,32 @@ public: class MTPDstickerSet : public mtpDataImpl { public: + enum class Flag : int32 { + f_installed = (1 << 0), + f_disabled = (1 << 1), + f_official = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_installed() const { return vflags.v & Flag::f_installed; } + bool is_disabled() const { return vflags.v & Flag::f_disabled; } + bool is_official() const { return vflags.v & Flag::f_official; } + MTPDstickerSet() { } - MTPDstickerSet(MTPint _flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vtitle(_title), vshort_name(_short_name), vcount(_count), vhash(_hash) { + MTPDstickerSet(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash) : vflags(_flags), vid(_id), vaccess_hash(_access_hash), vtitle(_title), vshort_name(_short_name), vcount(_count), vhash(_hash) { } - MTPint vflags; + MTPflags vflags; MTPlong vid; MTPlong vaccess_hash; MTPstring vtitle; MTPstring vshort_name; MTPint vcount; MTPint vhash; - - enum { - flag_installed = (1 << 0), - flag_disabled = (1 << 1), - flag_official = (1 << 2), - }; - - bool is_installed() const { return vflags.v & flag_installed; } - bool is_disabled() const { return vflags.v & flag_disabled; } - bool is_official() const { return vflags.v & flag_official; } }; class MTPDmessages_stickerSet : public mtpDataImpl { @@ -12678,57 +12769,69 @@ public: class MTPDreplyKeyboardHide : public mtpDataImpl { public: + enum class Flag : int32 { + f_selective = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_selective() const { return vflags.v & Flag::f_selective; } + MTPDreplyKeyboardHide() { } - MTPDreplyKeyboardHide(MTPint _flags) : vflags(_flags) { + MTPDreplyKeyboardHide(const MTPflags &_flags) : vflags(_flags) { } - MTPint vflags; - - enum { - flag_selective = (1 << 2), - }; - - bool is_selective() const { return vflags.v & flag_selective; } + MTPflags vflags; }; class MTPDreplyKeyboardForceReply : public mtpDataImpl { public: + enum class Flag : int32 { + f_single_use = (1 << 1), + f_selective = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_single_use() const { return vflags.v & Flag::f_single_use; } + bool is_selective() const { return vflags.v & Flag::f_selective; } + MTPDreplyKeyboardForceReply() { } - MTPDreplyKeyboardForceReply(MTPint _flags) : vflags(_flags) { + MTPDreplyKeyboardForceReply(const MTPflags &_flags) : vflags(_flags) { } - MTPint vflags; - - enum { - flag_single_use = (1 << 1), - flag_selective = (1 << 2), - }; - - bool is_single_use() const { return vflags.v & flag_single_use; } - bool is_selective() const { return vflags.v & flag_selective; } + MTPflags vflags; }; class MTPDreplyKeyboardMarkup : public mtpDataImpl { public: + enum class Flag : int32 { + f_resize = (1 << 0), + f_single_use = (1 << 1), + f_selective = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_resize() const { return vflags.v & Flag::f_resize; } + bool is_single_use() const { return vflags.v & Flag::f_single_use; } + bool is_selective() const { return vflags.v & Flag::f_selective; } + MTPDreplyKeyboardMarkup() { } - MTPDreplyKeyboardMarkup(MTPint _flags, const MTPVector &_rows) : vflags(_flags), vrows(_rows) { + MTPDreplyKeyboardMarkup(const MTPflags &_flags, const MTPVector &_rows) : vflags(_flags), vrows(_rows) { } - MTPint vflags; + MTPflags vflags; MTPVector vrows; - - enum { - flag_resize = (1 << 0), - flag_single_use = (1 << 1), - flag_selective = (1 << 2), - }; - - bool is_resize() const { return vflags.v & flag_resize; } - bool is_single_use() const { return vflags.v & flag_single_use; } - bool is_selective() const { return vflags.v & flag_selective; } }; class MTPDhelp_appChangelog : public mtpDataImpl { @@ -12913,32 +13016,48 @@ public: class MTPDupdates_channelDifferenceEmpty : public mtpDataImpl { public: + enum class Flag : int32 { + f_final = (1 << 0), + f_timeout = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_final() const { return vflags.v & Flag::f_final; } + bool has_timeout() const { return vflags.v & Flag::f_timeout; } + MTPDupdates_channelDifferenceEmpty() { } - MTPDupdates_channelDifferenceEmpty(MTPint _flags, MTPint _pts, MTPint _timeout) : vflags(_flags), vpts(_pts), vtimeout(_timeout) { + MTPDupdates_channelDifferenceEmpty(const MTPflags &_flags, MTPint _pts, MTPint _timeout) : vflags(_flags), vpts(_pts), vtimeout(_timeout) { } - MTPint vflags; + MTPflags vflags; MTPint vpts; MTPint vtimeout; - - enum { - flag_final = (1 << 0), - flag_timeout = (1 << 1), - }; - - bool is_final() const { return vflags.v & flag_final; } - bool has_timeout() const { return vflags.v & flag_timeout; } }; class MTPDupdates_channelDifferenceTooLong : public mtpDataImpl { public: + enum class Flag : int32 { + f_final = (1 << 0), + f_timeout = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_final() const { return vflags.v & Flag::f_final; } + bool has_timeout() const { return vflags.v & Flag::f_timeout; } + MTPDupdates_channelDifferenceTooLong() { } - MTPDupdates_channelDifferenceTooLong(MTPint _flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vtimeout(_timeout), vtop_message(_top_message), vtop_important_message(_top_important_message), vread_inbox_max_id(_read_inbox_max_id), vunread_count(_unread_count), vunread_important_count(_unread_important_count), vmessages(_messages), vchats(_chats), vusers(_users) { + MTPDupdates_channelDifferenceTooLong(const MTPflags &_flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vtimeout(_timeout), vtop_message(_top_message), vtop_important_message(_top_important_message), vread_inbox_max_id(_read_inbox_max_id), vunread_count(_unread_count), vunread_important_count(_unread_important_count), vmessages(_messages), vchats(_chats), vusers(_users) { } - MTPint vflags; + MTPflags vflags; MTPint vpts; MTPint vtimeout; MTPint vtop_message; @@ -12949,57 +13068,57 @@ public: MTPVector vmessages; MTPVector vchats; MTPVector vusers; - - enum { - flag_final = (1 << 0), - flag_timeout = (1 << 1), - }; - - bool is_final() const { return vflags.v & flag_final; } - bool has_timeout() const { return vflags.v & flag_timeout; } }; class MTPDupdates_channelDifference : public mtpDataImpl { public: + enum class Flag : int32 { + f_final = (1 << 0), + f_timeout = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_final() const { return vflags.v & Flag::f_final; } + bool has_timeout() const { return vflags.v & Flag::f_timeout; } + MTPDupdates_channelDifference() { } - MTPDupdates_channelDifference(MTPint _flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vtimeout(_timeout), vnew_messages(_new_messages), vother_updates(_other_updates), vchats(_chats), vusers(_users) { + MTPDupdates_channelDifference(const MTPflags &_flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users) : vflags(_flags), vpts(_pts), vtimeout(_timeout), vnew_messages(_new_messages), vother_updates(_other_updates), vchats(_chats), vusers(_users) { } - MTPint vflags; + MTPflags vflags; MTPint vpts; MTPint vtimeout; MTPVector vnew_messages; MTPVector vother_updates; MTPVector vchats; MTPVector vusers; - - enum { - flag_final = (1 << 0), - flag_timeout = (1 << 1), - }; - - bool is_final() const { return vflags.v & flag_final; } - bool has_timeout() const { return vflags.v & flag_timeout; } }; class MTPDchannelMessagesFilter : public mtpDataImpl { public: + enum class Flag : int32 { + f_important_only = (1 << 0), + f_exclude_new_messages = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_important_only() const { return vflags.v & Flag::f_important_only; } + bool is_exclude_new_messages() const { return vflags.v & Flag::f_exclude_new_messages; } + MTPDchannelMessagesFilter() { } - MTPDchannelMessagesFilter(MTPint _flags, const MTPVector &_ranges) : vflags(_flags), vranges(_ranges) { + MTPDchannelMessagesFilter(const MTPflags &_flags, const MTPVector &_ranges) : vflags(_flags), vranges(_ranges) { } - MTPint vflags; + MTPflags vflags; MTPVector vranges; - - enum { - flag_important_only = (1 << 0), - flag_exclude_new_messages = (1 << 1), - }; - - bool is_important_only() const { return vflags.v & flag_important_only; } - bool is_exclude_new_messages() const { return vflags.v & flag_exclude_new_messages; } }; class MTPDchannelParticipant : public mtpDataImpl { @@ -13165,32 +13284,62 @@ public: class MTPDinputBotInlineMessageText : public mtpDataImpl { public: + enum class Flag : int32 { + f_no_webpage = (1 << 0), + f_entities = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + MTPDinputBotInlineMessageText() { } - MTPDinputBotInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { + MTPDinputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { } - MTPint vflags; + MTPflags vflags; MTPstring vmessage; MTPVector ventities; - - enum { - flag_no_webpage = (1 << 0), - flag_entities = (1 << 1), - }; - - bool is_no_webpage() const { return vflags.v & flag_no_webpage; } - bool has_entities() const { return vflags.v & flag_entities; } }; class MTPDinputBotInlineResult : public mtpDataImpl { public: + enum class Flag : int32 { + f_title = (1 << 1), + f_description = (1 << 2), + f_url = (1 << 3), + f_thumb_url = (1 << 4), + f_content_url = (1 << 5), + f_content_type = (1 << 5), + f_w = (1 << 6), + f_h = (1 << 6), + f_duration = (1 << 7), + + MAX_FIELD = (1 << 7), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_title() const { return vflags.v & Flag::f_title; } + bool has_description() const { return vflags.v & Flag::f_description; } + bool has_url() const { return vflags.v & Flag::f_url; } + bool has_thumb_url() const { return vflags.v & Flag::f_thumb_url; } + bool has_content_url() const { return vflags.v & Flag::f_content_url; } + bool has_content_type() const { return vflags.v & Flag::f_content_type; } + bool has_w() const { return vflags.v & Flag::f_w; } + bool has_h() const { return vflags.v & Flag::f_h; } + bool has_duration() const { return vflags.v & Flag::f_duration; } + MTPDinputBotInlineResult() { } - MTPDinputBotInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vtitle(_title), vdescription(_description), vurl(_url), vthumb_url(_thumb_url), vcontent_url(_content_url), vcontent_type(_content_type), vw(_w), vh(_h), vduration(_duration), vsend_message(_send_message) { + MTPDinputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vtitle(_title), vdescription(_description), vurl(_url), vthumb_url(_thumb_url), vcontent_url(_content_url), vcontent_type(_content_type), vw(_w), vh(_h), vduration(_duration), vsend_message(_send_message) { } - MTPint vflags; + MTPflags vflags; MTPstring vid; MTPstring vtype; MTPstring vtitle; @@ -13203,28 +13352,6 @@ public: MTPint vh; MTPint vduration; MTPInputBotInlineMessage vsend_message; - - enum { - flag_title = (1 << 1), - flag_description = (1 << 2), - flag_url = (1 << 3), - flag_thumb_url = (1 << 4), - flag_content_url = (1 << 5), - flag_content_type = (1 << 5), - flag_w = (1 << 6), - flag_h = (1 << 6), - flag_duration = (1 << 7), - }; - - bool has_title() const { return vflags.v & flag_title; } - bool has_description() const { return vflags.v & flag_description; } - bool has_url() const { return vflags.v & flag_url; } - bool has_thumb_url() const { return vflags.v & flag_thumb_url; } - bool has_content_url() const { return vflags.v & flag_content_url; } - bool has_content_type() const { return vflags.v & flag_content_type; } - bool has_w() const { return vflags.v & flag_w; } - bool has_h() const { return vflags.v & flag_h; } - bool has_duration() const { return vflags.v & flag_duration; } }; class MTPDbotInlineMessageMediaAuto : public mtpDataImpl { @@ -13239,22 +13366,26 @@ public: class MTPDbotInlineMessageText : public mtpDataImpl { public: + enum class Flag : int32 { + f_no_webpage = (1 << 0), + f_entities = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + MTPDbotInlineMessageText() { } - MTPDbotInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { + MTPDbotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vmessage(_message), ventities(_entities) { } - MTPint vflags; + MTPflags vflags; MTPstring vmessage; MTPVector ventities; - - enum { - flag_no_webpage = (1 << 0), - flag_entities = (1 << 1), - }; - - bool is_no_webpage() const { return vflags.v & flag_no_webpage; } - bool has_entities() const { return vflags.v & flag_entities; } }; class MTPDbotInlineMediaResultDocument : public mtpDataImpl { @@ -13285,12 +13416,38 @@ public: class MTPDbotInlineResult : public mtpDataImpl { public: + enum class Flag : int32 { + f_title = (1 << 1), + f_description = (1 << 2), + f_url = (1 << 3), + f_thumb_url = (1 << 4), + f_content_url = (1 << 5), + f_content_type = (1 << 5), + f_w = (1 << 6), + f_h = (1 << 6), + f_duration = (1 << 7), + + MAX_FIELD = (1 << 7), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_title() const { return vflags.v & Flag::f_title; } + bool has_description() const { return vflags.v & Flag::f_description; } + bool has_url() const { return vflags.v & Flag::f_url; } + bool has_thumb_url() const { return vflags.v & Flag::f_thumb_url; } + bool has_content_url() const { return vflags.v & Flag::f_content_url; } + bool has_content_type() const { return vflags.v & Flag::f_content_type; } + bool has_w() const { return vflags.v & Flag::f_w; } + bool has_h() const { return vflags.v & Flag::f_h; } + bool has_duration() const { return vflags.v & Flag::f_duration; } + MTPDbotInlineResult() { } - MTPDbotInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vtitle(_title), vdescription(_description), vurl(_url), vthumb_url(_thumb_url), vcontent_url(_content_url), vcontent_type(_content_type), vw(_w), vh(_h), vduration(_duration), vsend_message(_send_message) { + MTPDbotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) : vflags(_flags), vid(_id), vtype(_type), vtitle(_title), vdescription(_description), vurl(_url), vthumb_url(_thumb_url), vcontent_url(_content_url), vcontent_type(_content_type), vw(_w), vh(_h), vduration(_duration), vsend_message(_send_message) { } - MTPint vflags; + MTPflags vflags; MTPstring vid; MTPstring vtype; MTPstring vtitle; @@ -13303,49 +13460,31 @@ public: MTPint vh; MTPint vduration; MTPBotInlineMessage vsend_message; - - enum { - flag_title = (1 << 1), - flag_description = (1 << 2), - flag_url = (1 << 3), - flag_thumb_url = (1 << 4), - flag_content_url = (1 << 5), - flag_content_type = (1 << 5), - flag_w = (1 << 6), - flag_h = (1 << 6), - flag_duration = (1 << 7), - }; - - bool has_title() const { return vflags.v & flag_title; } - bool has_description() const { return vflags.v & flag_description; } - bool has_url() const { return vflags.v & flag_url; } - bool has_thumb_url() const { return vflags.v & flag_thumb_url; } - bool has_content_url() const { return vflags.v & flag_content_url; } - bool has_content_type() const { return vflags.v & flag_content_type; } - bool has_w() const { return vflags.v & flag_w; } - bool has_h() const { return vflags.v & flag_h; } - bool has_duration() const { return vflags.v & flag_duration; } }; class MTPDmessages_botResults : public mtpDataImpl { public: + enum class Flag : int32 { + f_gallery = (1 << 0), + f_next_offset = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_gallery() const { return vflags.v & Flag::f_gallery; } + bool has_next_offset() const { return vflags.v & Flag::f_next_offset; } + MTPDmessages_botResults() { } - MTPDmessages_botResults(MTPint _flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results) : vflags(_flags), vquery_id(_query_id), vnext_offset(_next_offset), vresults(_results) { + MTPDmessages_botResults(const MTPflags &_flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results) : vflags(_flags), vquery_id(_query_id), vnext_offset(_next_offset), vresults(_results) { } - MTPint vflags; + MTPflags vflags; MTPlong vquery_id; MTPstring vnext_offset; MTPVector vresults; - - enum { - flag_gallery = (1 << 0), - flag_next_offset = (1 << 1), - }; - - bool is_gallery() const { return vflags.v & flag_gallery; } - bool has_next_offset() const { return vflags.v & flag_next_offset; } }; class MTPDexportedMessageLink : public mtpDataImpl { @@ -13360,42 +13499,48 @@ public: class MTPDmessageFwdHeader : public mtpDataImpl { public: + enum class Flag : int32 { + f_from_id = (1 << 0), + f_channel_id = (1 << 1), + f_channel_post = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_from_id() const { return vflags.v & Flag::f_from_id; } + bool has_channel_id() const { return vflags.v & Flag::f_channel_id; } + bool has_channel_post() const { return vflags.v & Flag::f_channel_post; } + MTPDmessageFwdHeader() { } - MTPDmessageFwdHeader(MTPint _flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post) : vflags(_flags), vfrom_id(_from_id), vdate(_date), vchannel_id(_channel_id), vchannel_post(_channel_post) { + MTPDmessageFwdHeader(const MTPflags &_flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post) : vflags(_flags), vfrom_id(_from_id), vdate(_date), vchannel_id(_channel_id), vchannel_post(_channel_post) { } - MTPint vflags; + MTPflags vflags; MTPint vfrom_id; MTPint vdate; MTPint vchannel_id; MTPint vchannel_post; - - enum { - flag_from_id = (1 << 0), - flag_channel_id = (1 << 1), - flag_channel_post = (1 << 2), - }; - - bool has_from_id() const { return vflags.v & flag_from_id; } - bool has_channel_id() const { return vflags.v & flag_channel_id; } - bool has_channel_post() const { return vflags.v & flag_channel_post; } }; class MTPDchannels_messageEditData : public mtpDataImpl { public: + enum class Flag : int32 { + f_caption = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_caption() const { return vflags.v & Flag::f_caption; } + MTPDchannels_messageEditData() { } - MTPDchannels_messageEditData(MTPint _flags) : vflags(_flags) { + MTPDchannels_messageEditData(const MTPflags &_flags) : vflags(_flags) { } - MTPint vflags; - - enum { - flag_caption = (1 << 0), - }; - - bool is_caption() const { return vflags.v & flag_caption; } + MTPflags vflags; }; class MTPDauth_sentCodeTypeApp : public mtpDataImpl { @@ -14087,7 +14232,17 @@ public: class MTPauth_sendCode { // RPC method 'auth.sendCode' public: - MTPint vflags; + enum class Flag : int32 { + f_allow_flashcall = (1 << 0), + f_current_number = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_allow_flashcall() const { return vflags.v & Flag::f_allow_flashcall; } + bool has_current_number() const { return vflags.v & Flag::f_current_number; } + + MTPflags vflags; MTPstring vphone_number; MTPBool vcurrent_number; MTPint vapi_id; @@ -14099,17 +14254,9 @@ public: MTPauth_sendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCode) { read(from, end, cons); } - MTPauth_sendCode(MTPint _flags, const MTPstring &_phone_number, MTPBool _current_number, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : vflags(_flags), vphone_number(_phone_number), vcurrent_number(_current_number), vapi_id(_api_id), vapi_hash(_api_hash), vlang_code(_lang_code) { + MTPauth_sendCode(const MTPflags &_flags, const MTPstring &_phone_number, MTPBool _current_number, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : vflags(_flags), vphone_number(_phone_number), vcurrent_number(_current_number), vapi_id(_api_id), vapi_hash(_api_hash), vlang_code(_lang_code) { } - enum { - flag_allow_flashcall = (1 << 0), - flag_current_number = (1 << 0), - }; - - bool is_allow_flashcall() const { return vflags.v & flag_allow_flashcall; } - bool has_current_number() const { return vflags.v & flag_current_number; } - uint32 innerLength() const { return vflags.innerLength() + vphone_number.innerLength() + (has_current_number() ? vcurrent_number.innerLength() : 0) + vapi_id.innerLength() + vapi_hash.innerLength() + vlang_code.innerLength(); } @@ -14135,6 +14282,8 @@ public: typedef MTPauth_SentCode ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPauth_sendCode::Flags) + class MTPauth_SendCode : public MTPBoxed { public: MTPauth_SendCode() { @@ -14143,7 +14292,7 @@ public: } MTPauth_SendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPauth_SendCode(MTPint _flags, const MTPstring &_phone_number, MTPBool _current_number, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : MTPBoxed(MTPauth_sendCode(_flags, _phone_number, _current_number, _api_id, _api_hash, _lang_code)) { + MTPauth_SendCode(const MTPflags &_flags, const MTPstring &_phone_number, MTPBool _current_number, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : MTPBoxed(MTPauth_sendCode(_flags, _phone_number, _current_number, _api_id, _api_hash, _lang_code)) { } }; @@ -14930,7 +15079,21 @@ public: class MTPaccount_updateProfile { // RPC method 'account.updateProfile' public: - MTPint vflags; + enum class Flag : int32 { + f_first_name = (1 << 0), + f_last_name = (1 << 1), + f_about = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_first_name() const { return vflags.v & Flag::f_first_name; } + bool has_last_name() const { return vflags.v & Flag::f_last_name; } + bool has_about() const { return vflags.v & Flag::f_about; } + + MTPflags vflags; MTPstring vfirst_name; MTPstring vlast_name; MTPstring vabout; @@ -14940,19 +15103,9 @@ public: MTPaccount_updateProfile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateProfile) { read(from, end, cons); } - MTPaccount_updateProfile(MTPint _flags, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_about) : vflags(_flags), vfirst_name(_first_name), vlast_name(_last_name), vabout(_about) { + MTPaccount_updateProfile(const MTPflags &_flags, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_about) : vflags(_flags), vfirst_name(_first_name), vlast_name(_last_name), vabout(_about) { } - enum { - flag_first_name = (1 << 0), - flag_last_name = (1 << 1), - flag_about = (1 << 2), - }; - - bool has_first_name() const { return vflags.v & flag_first_name; } - bool has_last_name() const { return vflags.v & flag_last_name; } - bool has_about() const { return vflags.v & flag_about; } - uint32 innerLength() const { return vflags.innerLength() + (has_first_name() ? vfirst_name.innerLength() : 0) + (has_last_name() ? vlast_name.innerLength() : 0) + (has_about() ? vabout.innerLength() : 0); } @@ -14974,6 +15127,8 @@ public: typedef MTPUser ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPaccount_updateProfile::Flags) + class MTPaccount_UpdateProfile : public MTPBoxed { public: MTPaccount_UpdateProfile() { @@ -14982,7 +15137,7 @@ public: } MTPaccount_UpdateProfile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPaccount_UpdateProfile(MTPint _flags, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_about) : MTPBoxed(MTPaccount_updateProfile(_flags, _first_name, _last_name, _about)) { + MTPaccount_UpdateProfile(const MTPflags &_flags, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_about) : MTPBoxed(MTPaccount_updateProfile(_flags, _first_name, _last_name, _about)) { } }; @@ -15368,7 +15523,17 @@ public: class MTPaccount_sendChangePhoneCode { // RPC method 'account.sendChangePhoneCode' public: - MTPint vflags; + enum class Flag : int32 { + f_allow_flashcall = (1 << 0), + f_current_number = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_allow_flashcall() const { return vflags.v & Flag::f_allow_flashcall; } + bool has_current_number() const { return vflags.v & Flag::f_current_number; } + + MTPflags vflags; MTPstring vphone_number; MTPBool vcurrent_number; @@ -15377,17 +15542,9 @@ public: MTPaccount_sendChangePhoneCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sendChangePhoneCode) { read(from, end, cons); } - MTPaccount_sendChangePhoneCode(MTPint _flags, const MTPstring &_phone_number, MTPBool _current_number) : vflags(_flags), vphone_number(_phone_number), vcurrent_number(_current_number) { + MTPaccount_sendChangePhoneCode(const MTPflags &_flags, const MTPstring &_phone_number, MTPBool _current_number) : vflags(_flags), vphone_number(_phone_number), vcurrent_number(_current_number) { } - enum { - flag_allow_flashcall = (1 << 0), - flag_current_number = (1 << 0), - }; - - bool is_allow_flashcall() const { return vflags.v & flag_allow_flashcall; } - bool has_current_number() const { return vflags.v & flag_current_number; } - uint32 innerLength() const { return vflags.innerLength() + vphone_number.innerLength() + (has_current_number() ? vcurrent_number.innerLength() : 0); } @@ -15407,6 +15564,8 @@ public: typedef MTPauth_SentCode ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPaccount_sendChangePhoneCode::Flags) + class MTPaccount_SendChangePhoneCode : public MTPBoxed { public: MTPaccount_SendChangePhoneCode() { @@ -15415,7 +15574,7 @@ public: } MTPaccount_SendChangePhoneCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPaccount_SendChangePhoneCode(MTPint _flags, const MTPstring &_phone_number, MTPBool _current_number) : MTPBoxed(MTPaccount_sendChangePhoneCode(_flags, _phone_number, _current_number)) { + MTPaccount_SendChangePhoneCode(const MTPflags &_flags, const MTPstring &_phone_number, MTPBool _current_number) : MTPBoxed(MTPaccount_sendChangePhoneCode(_flags, _phone_number, _current_number)) { } }; @@ -16370,7 +16529,15 @@ public: class MTPmessages_search { // RPC method 'messages.search' public: - MTPint vflags; + enum class Flag : int32 { + f_important_only = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_important_only() const { return vflags.v & Flag::f_important_only; } + + MTPflags vflags; MTPInputPeer vpeer; MTPstring vq; MTPMessagesFilter vfilter; @@ -16385,15 +16552,9 @@ public: MTPmessages_search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_search) { read(from, end, cons); } - MTPmessages_search(MTPint _flags, const MTPInputPeer &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : vflags(_flags), vpeer(_peer), vq(_q), vfilter(_filter), vmin_date(_min_date), vmax_date(_max_date), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { + MTPmessages_search(const MTPflags &_flags, const MTPInputPeer &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : vflags(_flags), vpeer(_peer), vq(_q), vfilter(_filter), vmin_date(_min_date), vmax_date(_max_date), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { } - enum { - flag_important_only = (1 << 0), - }; - - bool is_important_only() const { return vflags.v & flag_important_only; } - uint32 innerLength() const { return vflags.innerLength() + vpeer.innerLength() + vq.innerLength() + vfilter.innerLength() + vmin_date.innerLength() + vmax_date.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength(); } @@ -16425,6 +16586,8 @@ public: typedef MTPmessages_Messages ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_search::Flags) + class MTPmessages_Search : public MTPBoxed { public: MTPmessages_Search() { @@ -16433,7 +16596,7 @@ public: } MTPmessages_Search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_Search(MTPint _flags, const MTPInputPeer &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : MTPBoxed(MTPmessages_search(_flags, _peer, _q, _filter, _min_date, _max_date, _offset, _max_id, _limit)) { + MTPmessages_Search(const MTPflags &_flags, const MTPInputPeer &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : MTPBoxed(MTPmessages_search(_flags, _peer, _q, _filter, _min_date, _max_date, _offset, _max_id, _limit)) { } }; @@ -16643,7 +16806,29 @@ public: class MTPmessages_sendMessage { // RPC method 'messages.sendMessage' public: - MTPint vflags; + enum class Flag : int32 { + f_no_webpage = (1 << 1), + f_broadcast = (1 << 4), + f_silent = (1 << 5), + f_background = (1 << 6), + f_reply_to_msg_id = (1 << 0), + f_reply_markup = (1 << 2), + f_entities = (1 << 3), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_background() const { return vflags.v & Flag::f_background; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + + MTPflags vflags; MTPInputPeer vpeer; MTPint vreply_to_msg_id; MTPstring vmessage; @@ -16656,27 +16841,9 @@ public: MTPmessages_sendMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendMessage) { read(from, end, cons); } - MTPmessages_sendMessage(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPstring &_message, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vmessage(_message), vrandom_id(_random_id), vreply_markup(_reply_markup), ventities(_entities) { + MTPmessages_sendMessage(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPstring &_message, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vmessage(_message), vrandom_id(_random_id), vreply_markup(_reply_markup), ventities(_entities) { } - enum { - flag_no_webpage = (1 << 1), - flag_broadcast = (1 << 4), - flag_silent = (1 << 5), - flag_background = (1 << 6), - flag_reply_to_msg_id = (1 << 0), - flag_reply_markup = (1 << 2), - flag_entities = (1 << 3), - }; - - bool is_no_webpage() const { return vflags.v & flag_no_webpage; } - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_background() const { return vflags.v & flag_background; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - bool has_reply_markup() const { return vflags.v & flag_reply_markup; } - bool has_entities() const { return vflags.v & flag_entities; } - uint32 innerLength() const { return vflags.innerLength() + vpeer.innerLength() + (has_reply_to_msg_id() ? vreply_to_msg_id.innerLength() : 0) + vmessage.innerLength() + vrandom_id.innerLength() + (has_reply_markup() ? vreply_markup.innerLength() : 0) + (has_entities() ? ventities.innerLength() : 0); } @@ -16704,6 +16871,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_sendMessage::Flags) + class MTPmessages_SendMessage : public MTPBoxed { public: MTPmessages_SendMessage() { @@ -16712,13 +16881,31 @@ public: } MTPmessages_SendMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_SendMessage(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPstring &_message, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities) : MTPBoxed(MTPmessages_sendMessage(_flags, _peer, _reply_to_msg_id, _message, _random_id, _reply_markup, _entities)) { + MTPmessages_SendMessage(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPstring &_message, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities) : MTPBoxed(MTPmessages_sendMessage(_flags, _peer, _reply_to_msg_id, _message, _random_id, _reply_markup, _entities)) { } }; class MTPmessages_sendMedia { // RPC method 'messages.sendMedia' public: - MTPint vflags; + enum class Flag : int32 { + f_broadcast = (1 << 4), + f_silent = (1 << 5), + f_background = (1 << 6), + f_reply_to_msg_id = (1 << 0), + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_background() const { return vflags.v & Flag::f_background; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + + MTPflags vflags; MTPInputPeer vpeer; MTPint vreply_to_msg_id; MTPInputMedia vmedia; @@ -16730,23 +16917,9 @@ public: MTPmessages_sendMedia(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendMedia) { read(from, end, cons); } - MTPmessages_sendMedia(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPInputMedia &_media, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vmedia(_media), vrandom_id(_random_id), vreply_markup(_reply_markup) { + MTPmessages_sendMedia(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPInputMedia &_media, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vmedia(_media), vrandom_id(_random_id), vreply_markup(_reply_markup) { } - enum { - flag_broadcast = (1 << 4), - flag_silent = (1 << 5), - flag_background = (1 << 6), - flag_reply_to_msg_id = (1 << 0), - flag_reply_markup = (1 << 2), - }; - - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_background() const { return vflags.v & flag_background; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - bool has_reply_markup() const { return vflags.v & flag_reply_markup; } - uint32 innerLength() const { return vflags.innerLength() + vpeer.innerLength() + (has_reply_to_msg_id() ? vreply_to_msg_id.innerLength() : 0) + vmedia.innerLength() + vrandom_id.innerLength() + (has_reply_markup() ? vreply_markup.innerLength() : 0); } @@ -16772,6 +16945,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_sendMedia::Flags) + class MTPmessages_SendMedia : public MTPBoxed { public: MTPmessages_SendMedia() { @@ -16780,13 +16955,27 @@ public: } MTPmessages_SendMedia(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_SendMedia(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPInputMedia &_media, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup) : MTPBoxed(MTPmessages_sendMedia(_flags, _peer, _reply_to_msg_id, _media, _random_id, _reply_markup)) { + MTPmessages_SendMedia(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPInputMedia &_media, const MTPlong &_random_id, const MTPReplyMarkup &_reply_markup) : MTPBoxed(MTPmessages_sendMedia(_flags, _peer, _reply_to_msg_id, _media, _random_id, _reply_markup)) { } }; class MTPmessages_forwardMessages { // RPC method 'messages.forwardMessages' public: - MTPint vflags; + enum class Flag : int32 { + f_broadcast = (1 << 4), + f_silent = (1 << 5), + f_background = (1 << 6), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_background() const { return vflags.v & Flag::f_background; } + + MTPflags vflags; MTPInputPeer vfrom_peer; MTPVector vid; MTPVector vrandom_id; @@ -16797,19 +16986,9 @@ public: MTPmessages_forwardMessages(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_forwardMessages) { read(from, end, cons); } - MTPmessages_forwardMessages(MTPint _flags, const MTPInputPeer &_from_peer, const MTPVector &_id, const MTPVector &_random_id, const MTPInputPeer &_to_peer) : vflags(_flags), vfrom_peer(_from_peer), vid(_id), vrandom_id(_random_id), vto_peer(_to_peer) { + MTPmessages_forwardMessages(const MTPflags &_flags, const MTPInputPeer &_from_peer, const MTPVector &_id, const MTPVector &_random_id, const MTPInputPeer &_to_peer) : vflags(_flags), vfrom_peer(_from_peer), vid(_id), vrandom_id(_random_id), vto_peer(_to_peer) { } - enum { - flag_broadcast = (1 << 4), - flag_silent = (1 << 5), - flag_background = (1 << 6), - }; - - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_background() const { return vflags.v & flag_background; } - uint32 innerLength() const { return vflags.innerLength() + vfrom_peer.innerLength() + vid.innerLength() + vrandom_id.innerLength() + vto_peer.innerLength(); } @@ -16833,6 +17012,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_forwardMessages::Flags) + class MTPmessages_ForwardMessages : public MTPBoxed { public: MTPmessages_ForwardMessages() { @@ -16841,7 +17022,7 @@ public: } MTPmessages_ForwardMessages(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_ForwardMessages(MTPint _flags, const MTPInputPeer &_from_peer, const MTPVector &_id, const MTPVector &_random_id, const MTPInputPeer &_to_peer) : MTPBoxed(MTPmessages_forwardMessages(_flags, _from_peer, _id, _random_id, _to_peer)) { + MTPmessages_ForwardMessages(const MTPflags &_flags, const MTPInputPeer &_from_peer, const MTPVector &_id, const MTPVector &_random_id, const MTPInputPeer &_to_peer) : MTPBoxed(MTPmessages_forwardMessages(_flags, _from_peer, _id, _random_id, _to_peer)) { } }; @@ -18698,7 +18879,21 @@ public: class MTPmessages_setInlineBotResults { // RPC method 'messages.setInlineBotResults' public: - MTPint vflags; + enum class Flag : int32 { + f_gallery = (1 << 0), + f_private = (1 << 1), + f_next_offset = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_gallery() const { return vflags.v & Flag::f_gallery; } + bool is_private() const { return vflags.v & Flag::f_private; } + bool has_next_offset() const { return vflags.v & Flag::f_next_offset; } + + MTPflags vflags; MTPlong vquery_id; MTPVector vresults; MTPint vcache_time; @@ -18709,19 +18904,9 @@ public: MTPmessages_setInlineBotResults(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_setInlineBotResults) { read(from, end, cons); } - MTPmessages_setInlineBotResults(MTPint _flags, const MTPlong &_query_id, const MTPVector &_results, MTPint _cache_time, const MTPstring &_next_offset) : vflags(_flags), vquery_id(_query_id), vresults(_results), vcache_time(_cache_time), vnext_offset(_next_offset) { + MTPmessages_setInlineBotResults(const MTPflags &_flags, const MTPlong &_query_id, const MTPVector &_results, MTPint _cache_time, const MTPstring &_next_offset) : vflags(_flags), vquery_id(_query_id), vresults(_results), vcache_time(_cache_time), vnext_offset(_next_offset) { } - enum { - flag_gallery = (1 << 0), - flag_private = (1 << 1), - flag_next_offset = (1 << 2), - }; - - bool is_gallery() const { return vflags.v & flag_gallery; } - bool is_private() const { return vflags.v & flag_private; } - bool has_next_offset() const { return vflags.v & flag_next_offset; } - uint32 innerLength() const { return vflags.innerLength() + vquery_id.innerLength() + vresults.innerLength() + vcache_time.innerLength() + (has_next_offset() ? vnext_offset.innerLength() : 0); } @@ -18745,6 +18930,8 @@ public: typedef MTPBool ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_setInlineBotResults::Flags) + class MTPmessages_SetInlineBotResults : public MTPBoxed { public: MTPmessages_SetInlineBotResults() { @@ -18753,13 +18940,29 @@ public: } MTPmessages_SetInlineBotResults(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_SetInlineBotResults(MTPint _flags, const MTPlong &_query_id, const MTPVector &_results, MTPint _cache_time, const MTPstring &_next_offset) : MTPBoxed(MTPmessages_setInlineBotResults(_flags, _query_id, _results, _cache_time, _next_offset)) { + MTPmessages_SetInlineBotResults(const MTPflags &_flags, const MTPlong &_query_id, const MTPVector &_results, MTPint _cache_time, const MTPstring &_next_offset) : MTPBoxed(MTPmessages_setInlineBotResults(_flags, _query_id, _results, _cache_time, _next_offset)) { } }; class MTPmessages_sendInlineBotResult { // RPC method 'messages.sendInlineBotResult' public: - MTPint vflags; + enum class Flag : int32 { + f_broadcast = (1 << 4), + f_silent = (1 << 5), + f_background = (1 << 6), + f_reply_to_msg_id = (1 << 0), + + MAX_FIELD = (1 << 6), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_silent() const { return vflags.v & Flag::f_silent; } + bool is_background() const { return vflags.v & Flag::f_background; } + bool has_reply_to_msg_id() const { return vflags.v & Flag::f_reply_to_msg_id; } + + MTPflags vflags; MTPInputPeer vpeer; MTPint vreply_to_msg_id; MTPlong vrandom_id; @@ -18771,21 +18974,9 @@ public: MTPmessages_sendInlineBotResult(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_sendInlineBotResult) { read(from, end, cons); } - MTPmessages_sendInlineBotResult(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPlong &_random_id, const MTPlong &_query_id, const MTPstring &_id) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vrandom_id(_random_id), vquery_id(_query_id), vid(_id) { + MTPmessages_sendInlineBotResult(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPlong &_random_id, const MTPlong &_query_id, const MTPstring &_id) : vflags(_flags), vpeer(_peer), vreply_to_msg_id(_reply_to_msg_id), vrandom_id(_random_id), vquery_id(_query_id), vid(_id) { } - enum { - flag_broadcast = (1 << 4), - flag_silent = (1 << 5), - flag_background = (1 << 6), - flag_reply_to_msg_id = (1 << 0), - }; - - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_silent() const { return vflags.v & flag_silent; } - bool is_background() const { return vflags.v & flag_background; } - bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } - uint32 innerLength() const { return vflags.innerLength() + vpeer.innerLength() + (has_reply_to_msg_id() ? vreply_to_msg_id.innerLength() : 0) + vrandom_id.innerLength() + vquery_id.innerLength() + vid.innerLength(); } @@ -18811,6 +19002,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPmessages_sendInlineBotResult::Flags) + class MTPmessages_SendInlineBotResult : public MTPBoxed { public: MTPmessages_SendInlineBotResult() { @@ -18819,7 +19012,7 @@ public: } MTPmessages_SendInlineBotResult(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_SendInlineBotResult(MTPint _flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPlong &_random_id, const MTPlong &_query_id, const MTPstring &_id) : MTPBoxed(MTPmessages_sendInlineBotResult(_flags, _peer, _reply_to_msg_id, _random_id, _query_id, _id)) { + MTPmessages_SendInlineBotResult(const MTPflags &_flags, const MTPInputPeer &_peer, MTPint _reply_to_msg_id, const MTPlong &_random_id, const MTPlong &_query_id, const MTPstring &_id) : MTPBoxed(MTPmessages_sendInlineBotResult(_flags, _peer, _reply_to_msg_id, _random_id, _query_id, _id)) { } }; @@ -20050,7 +20243,19 @@ public: class MTPchannels_createChannel { // RPC method 'channels.createChannel' public: - MTPint vflags; + enum class Flag : int32 { + f_broadcast = (1 << 0), + f_megagroup = (1 << 1), + + MAX_FIELD = (1 << 1), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_broadcast() const { return vflags.v & Flag::f_broadcast; } + bool is_megagroup() const { return vflags.v & Flag::f_megagroup; } + + MTPflags vflags; MTPstring vtitle; MTPstring vabout; @@ -20059,17 +20264,9 @@ public: MTPchannels_createChannel(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_createChannel) { read(from, end, cons); } - MTPchannels_createChannel(MTPint _flags, const MTPstring &_title, const MTPstring &_about) : vflags(_flags), vtitle(_title), vabout(_about) { + MTPchannels_createChannel(const MTPflags &_flags, const MTPstring &_title, const MTPstring &_about) : vflags(_flags), vtitle(_title), vabout(_about) { } - enum { - flag_broadcast = (1 << 0), - flag_megagroup = (1 << 1), - }; - - bool is_broadcast() const { return vflags.v & flag_broadcast; } - bool is_megagroup() const { return vflags.v & flag_megagroup; } - uint32 innerLength() const { return vflags.innerLength() + vtitle.innerLength() + vabout.innerLength(); } @@ -20089,6 +20286,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPchannels_createChannel::Flags) + class MTPchannels_CreateChannel : public MTPBoxed { public: MTPchannels_CreateChannel() { @@ -20097,7 +20296,7 @@ public: } MTPchannels_CreateChannel(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPchannels_CreateChannel(MTPint _flags, const MTPstring &_title, const MTPstring &_about) : MTPBoxed(MTPchannels_createChannel(_flags, _title, _about)) { + MTPchannels_CreateChannel(const MTPflags &_flags, const MTPstring &_title, const MTPstring &_about) : MTPBoxed(MTPchannels_createChannel(_flags, _title, _about)) { } }; @@ -20811,7 +21010,19 @@ public: class MTPchannels_editMessage { // RPC method 'channels.editMessage' public: - MTPint vflags; + enum class Flag : int32 { + f_no_webpage = (1 << 1), + f_entities = (1 << 3), + + MAX_FIELD = (1 << 3), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_no_webpage() const { return vflags.v & Flag::f_no_webpage; } + bool has_entities() const { return vflags.v & Flag::f_entities; } + + MTPflags vflags; MTPInputChannel vchannel; MTPint vid; MTPstring vmessage; @@ -20822,17 +21033,9 @@ public: MTPchannels_editMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_editMessage) { read(from, end, cons); } - MTPchannels_editMessage(MTPint _flags, const MTPInputChannel &_channel, MTPint _id, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vchannel(_channel), vid(_id), vmessage(_message), ventities(_entities) { + MTPchannels_editMessage(const MTPflags &_flags, const MTPInputChannel &_channel, MTPint _id, const MTPstring &_message, const MTPVector &_entities) : vflags(_flags), vchannel(_channel), vid(_id), vmessage(_message), ventities(_entities) { } - enum { - flag_no_webpage = (1 << 1), - flag_entities = (1 << 3), - }; - - bool is_no_webpage() const { return vflags.v & flag_no_webpage; } - bool has_entities() const { return vflags.v & flag_entities; } - uint32 innerLength() const { return vflags.innerLength() + vchannel.innerLength() + vid.innerLength() + vmessage.innerLength() + (has_entities() ? ventities.innerLength() : 0); } @@ -20856,6 +21059,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPchannels_editMessage::Flags) + class MTPchannels_EditMessage : public MTPBoxed { public: MTPchannels_EditMessage() { @@ -20864,13 +21069,21 @@ public: } MTPchannels_EditMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPchannels_EditMessage(MTPint _flags, const MTPInputChannel &_channel, MTPint _id, const MTPstring &_message, const MTPVector &_entities) : MTPBoxed(MTPchannels_editMessage(_flags, _channel, _id, _message, _entities)) { + MTPchannels_EditMessage(const MTPflags &_flags, const MTPInputChannel &_channel, MTPint _id, const MTPstring &_message, const MTPVector &_entities) : MTPBoxed(MTPchannels_editMessage(_flags, _channel, _id, _message, _entities)) { } }; class MTPchannels_updatePinnedMessage { // RPC method 'channels.updatePinnedMessage' public: - MTPint vflags; + enum class Flag : int32 { + f_silent = (1 << 0), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool is_silent() const { return vflags.v & Flag::f_silent; } + + MTPflags vflags; MTPInputChannel vchannel; MTPint vid; @@ -20879,15 +21092,9 @@ public: MTPchannels_updatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_updatePinnedMessage) { read(from, end, cons); } - MTPchannels_updatePinnedMessage(MTPint _flags, const MTPInputChannel &_channel, MTPint _id) : vflags(_flags), vchannel(_channel), vid(_id) { + MTPchannels_updatePinnedMessage(const MTPflags &_flags, const MTPInputChannel &_channel, MTPint _id) : vflags(_flags), vchannel(_channel), vid(_id) { } - enum { - flag_silent = (1 << 0), - }; - - bool is_silent() const { return vflags.v & flag_silent; } - uint32 innerLength() const { return vflags.innerLength() + vchannel.innerLength() + vid.innerLength(); } @@ -20907,6 +21114,8 @@ public: typedef MTPUpdates ResponseType; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPchannels_updatePinnedMessage::Flags) + class MTPchannels_UpdatePinnedMessage : public MTPBoxed { public: MTPchannels_UpdatePinnedMessage() { @@ -20915,10 +21124,1279 @@ public: } MTPchannels_UpdatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPchannels_UpdatePinnedMessage(MTPint _flags, const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_updatePinnedMessage(_flags, _channel, _id)) { + MTPchannels_UpdatePinnedMessage(const MTPflags &_flags, const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_updatePinnedMessage(_flags, _channel, _id)) { } }; +// Creator proxy class definition +namespace MTP { +namespace internal { + class TypeCreator { + public: + inline static MTPresPQ new_resPQ(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_pq, const MTPVector &_server_public_key_fingerprints) { + return MTPresPQ(new MTPDresPQ(_nonce, _server_nonce, _pq, _server_public_key_fingerprints)); + } + inline static MTPp_Q_inner_data new_p_q_inner_data(const MTPstring &_pq, const MTPstring &_p, const MTPstring &_q, const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint256 &_new_nonce) { + return MTPp_Q_inner_data(new MTPDp_q_inner_data(_pq, _p, _q, _nonce, _server_nonce, _new_nonce)); + } + inline static MTPserver_DH_Params new_server_DH_params_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash) { + return MTPserver_DH_Params(new MTPDserver_DH_params_fail(_nonce, _server_nonce, _new_nonce_hash)); + } + inline static MTPserver_DH_Params new_server_DH_params_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_encrypted_answer) { + return MTPserver_DH_Params(new MTPDserver_DH_params_ok(_nonce, _server_nonce, _encrypted_answer)); + } + inline static MTPserver_DH_inner_data new_server_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, MTPint _g, const MTPstring &_dh_prime, const MTPstring &_g_a, MTPint _server_time) { + return MTPserver_DH_inner_data(new MTPDserver_DH_inner_data(_nonce, _server_nonce, _g, _dh_prime, _g_a, _server_time)); + } + inline static MTPclient_DH_Inner_Data new_client_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPlong &_retry_id, const MTPstring &_g_b) { + return MTPclient_DH_Inner_Data(new MTPDclient_DH_inner_data(_nonce, _server_nonce, _retry_id, _g_b)); + } + inline static MTPset_client_DH_params_answer new_dh_gen_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash1) { + return MTPset_client_DH_params_answer(new MTPDdh_gen_ok(_nonce, _server_nonce, _new_nonce_hash1)); + } + inline static MTPset_client_DH_params_answer new_dh_gen_retry(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash2) { + return MTPset_client_DH_params_answer(new MTPDdh_gen_retry(_nonce, _server_nonce, _new_nonce_hash2)); + } + inline static MTPset_client_DH_params_answer new_dh_gen_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash3) { + return MTPset_client_DH_params_answer(new MTPDdh_gen_fail(_nonce, _server_nonce, _new_nonce_hash3)); + } + inline static MTPmsgsAck new_msgs_ack(const MTPVector &_msg_ids) { + return MTPmsgsAck(new MTPDmsgs_ack(_msg_ids)); + } + inline static MTPbadMsgNotification new_bad_msg_notification(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code) { + return MTPbadMsgNotification(new MTPDbad_msg_notification(_bad_msg_id, _bad_msg_seqno, _error_code)); + } + inline static MTPbadMsgNotification new_bad_server_salt(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code, const MTPlong &_new_server_salt) { + return MTPbadMsgNotification(new MTPDbad_server_salt(_bad_msg_id, _bad_msg_seqno, _error_code, _new_server_salt)); + } + inline static MTPmsgsStateReq new_msgs_state_req(const MTPVector &_msg_ids) { + return MTPmsgsStateReq(new MTPDmsgs_state_req(_msg_ids)); + } + inline static MTPmsgsStateInfo new_msgs_state_info(const MTPlong &_req_msg_id, const MTPstring &_info) { + return MTPmsgsStateInfo(new MTPDmsgs_state_info(_req_msg_id, _info)); + } + inline static MTPmsgsAllInfo new_msgs_all_info(const MTPVector &_msg_ids, const MTPstring &_info) { + return MTPmsgsAllInfo(new MTPDmsgs_all_info(_msg_ids, _info)); + } + inline static MTPmsgDetailedInfo new_msg_detailed_info(const MTPlong &_msg_id, const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status) { + return MTPmsgDetailedInfo(new MTPDmsg_detailed_info(_msg_id, _answer_msg_id, _bytes, _status)); + } + inline static MTPmsgDetailedInfo new_msg_new_detailed_info(const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status) { + return MTPmsgDetailedInfo(new MTPDmsg_new_detailed_info(_answer_msg_id, _bytes, _status)); + } + inline static MTPmsgResendReq new_msg_resend_req(const MTPVector &_msg_ids) { + return MTPmsgResendReq(new MTPDmsg_resend_req(_msg_ids)); + } + inline static MTPrpcError new_rpc_error(MTPint _error_code, const MTPstring &_error_message) { + return MTPrpcError(new MTPDrpc_error(_error_code, _error_message)); + } + inline static MTPrpcDropAnswer new_rpc_answer_unknown() { + return MTPrpcDropAnswer(mtpc_rpc_answer_unknown); + } + inline static MTPrpcDropAnswer new_rpc_answer_dropped_running() { + return MTPrpcDropAnswer(mtpc_rpc_answer_dropped_running); + } + inline static MTPrpcDropAnswer new_rpc_answer_dropped(const MTPlong &_msg_id, MTPint _seq_no, MTPint _bytes) { + return MTPrpcDropAnswer(new MTPDrpc_answer_dropped(_msg_id, _seq_no, _bytes)); + } + inline static MTPfutureSalt new_future_salt(MTPint _valid_since, MTPint _valid_until, const MTPlong &_salt) { + return MTPfutureSalt(new MTPDfuture_salt(_valid_since, _valid_until, _salt)); + } + inline static MTPfutureSalts new_future_salts(const MTPlong &_req_msg_id, MTPint _now, const MTPvector &_salts) { + return MTPfutureSalts(new MTPDfuture_salts(_req_msg_id, _now, _salts)); + } + inline static MTPpong new_pong(const MTPlong &_msg_id, const MTPlong &_ping_id) { + return MTPpong(new MTPDpong(_msg_id, _ping_id)); + } + inline static MTPdestroySessionRes new_destroy_session_ok(const MTPlong &_session_id) { + return MTPdestroySessionRes(new MTPDdestroy_session_ok(_session_id)); + } + inline static MTPdestroySessionRes new_destroy_session_none(const MTPlong &_session_id) { + return MTPdestroySessionRes(new MTPDdestroy_session_none(_session_id)); + } + inline static MTPnewSession new_new_session_created(const MTPlong &_first_msg_id, const MTPlong &_unique_id, const MTPlong &_server_salt) { + return MTPnewSession(new MTPDnew_session_created(_first_msg_id, _unique_id, _server_salt)); + } + inline static MTPhttpWait new_http_wait(MTPint _max_delay, MTPint _wait_after, MTPint _max_wait) { + return MTPhttpWait(new MTPDhttp_wait(_max_delay, _wait_after, _max_wait)); + } + inline static MTPbool new_boolFalse() { + return MTPbool(mtpc_boolFalse); + } + inline static MTPbool new_boolTrue() { + return MTPbool(mtpc_boolTrue); + } + inline static MTPtrue new_true() { + return MTPtrue(); + } + inline static MTPerror new_error(MTPint _code, const MTPstring &_text) { + return MTPerror(new MTPDerror(_code, _text)); + } + inline static MTPnull new_null() { + return MTPnull(); + } + inline static MTPinputPeer new_inputPeerEmpty() { + return MTPinputPeer(mtpc_inputPeerEmpty); + } + inline static MTPinputPeer new_inputPeerSelf() { + return MTPinputPeer(mtpc_inputPeerSelf); + } + inline static MTPinputPeer new_inputPeerChat(MTPint _chat_id) { + return MTPinputPeer(new MTPDinputPeerChat(_chat_id)); + } + inline static MTPinputPeer new_inputPeerUser(MTPint _user_id, const MTPlong &_access_hash) { + return MTPinputPeer(new MTPDinputPeerUser(_user_id, _access_hash)); + } + inline static MTPinputPeer new_inputPeerChannel(MTPint _channel_id, const MTPlong &_access_hash) { + return MTPinputPeer(new MTPDinputPeerChannel(_channel_id, _access_hash)); + } + inline static MTPinputUser new_inputUserEmpty() { + return MTPinputUser(mtpc_inputUserEmpty); + } + inline static MTPinputUser new_inputUserSelf() { + return MTPinputUser(mtpc_inputUserSelf); + } + inline static MTPinputUser new_inputUser(MTPint _user_id, const MTPlong &_access_hash) { + return MTPinputUser(new MTPDinputUser(_user_id, _access_hash)); + } + inline static MTPinputContact new_inputPhoneContact(const MTPlong &_client_id, const MTPstring &_phone, const MTPstring &_first_name, const MTPstring &_last_name) { + return MTPinputContact(new MTPDinputPhoneContact(_client_id, _phone, _first_name, _last_name)); + } + inline static MTPinputFile new_inputFile(const MTPlong &_id, MTPint _parts, const MTPstring &_name, const MTPstring &_md5_checksum) { + return MTPinputFile(new MTPDinputFile(_id, _parts, _name, _md5_checksum)); + } + inline static MTPinputFile new_inputFileBig(const MTPlong &_id, MTPint _parts, const MTPstring &_name) { + return MTPinputFile(new MTPDinputFileBig(_id, _parts, _name)); + } + inline static MTPinputMedia new_inputMediaEmpty() { + return MTPinputMedia(mtpc_inputMediaEmpty); + } + inline static MTPinputMedia new_inputMediaUploadedPhoto(const MTPInputFile &_file, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaUploadedPhoto(_file, _caption)); + } + inline static MTPinputMedia new_inputMediaPhoto(const MTPInputPhoto &_id, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaPhoto(_id, _caption)); + } + inline static MTPinputMedia new_inputMediaGeoPoint(const MTPInputGeoPoint &_geo_point) { + return MTPinputMedia(new MTPDinputMediaGeoPoint(_geo_point)); + } + inline static MTPinputMedia new_inputMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { + return MTPinputMedia(new MTPDinputMediaContact(_phone_number, _first_name, _last_name)); + } + inline static MTPinputMedia new_inputMediaUploadedDocument(const MTPInputFile &_file, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaUploadedDocument(_file, _mime_type, _attributes, _caption)); + } + inline static MTPinputMedia new_inputMediaUploadedThumbDocument(const MTPInputFile &_file, const MTPInputFile &_thumb, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaUploadedThumbDocument(_file, _thumb, _mime_type, _attributes, _caption)); + } + inline static MTPinputMedia new_inputMediaDocument(const MTPInputDocument &_id, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaDocument(_id, _caption)); + } + inline static MTPinputMedia new_inputMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { + return MTPinputMedia(new MTPDinputMediaVenue(_geo_point, _title, _address, _provider, _venue_id)); + } + inline static MTPinputMedia new_inputMediaGifExternal(const MTPstring &_url, const MTPstring &_q) { + return MTPinputMedia(new MTPDinputMediaGifExternal(_url, _q)); + } + inline static MTPinputChatPhoto new_inputChatPhotoEmpty() { + return MTPinputChatPhoto(mtpc_inputChatPhotoEmpty); + } + inline static MTPinputChatPhoto new_inputChatUploadedPhoto(const MTPInputFile &_file, const MTPInputPhotoCrop &_crop) { + return MTPinputChatPhoto(new MTPDinputChatUploadedPhoto(_file, _crop)); + } + inline static MTPinputChatPhoto new_inputChatPhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) { + return MTPinputChatPhoto(new MTPDinputChatPhoto(_id, _crop)); + } + inline static MTPinputGeoPoint new_inputGeoPointEmpty() { + return MTPinputGeoPoint(mtpc_inputGeoPointEmpty); + } + inline static MTPinputGeoPoint new_inputGeoPoint(const MTPdouble &_lat, const MTPdouble &_long) { + return MTPinputGeoPoint(new MTPDinputGeoPoint(_lat, _long)); + } + inline static MTPinputPhoto new_inputPhotoEmpty() { + return MTPinputPhoto(mtpc_inputPhotoEmpty); + } + inline static MTPinputPhoto new_inputPhoto(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputPhoto(new MTPDinputPhoto(_id, _access_hash)); + } + inline static MTPinputFileLocation new_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { + return MTPinputFileLocation(new MTPDinputFileLocation(_volume_id, _local_id, _secret)); + } + inline static MTPinputFileLocation new_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputFileLocation(new MTPDinputEncryptedFileLocation(_id, _access_hash)); + } + inline static MTPinputFileLocation new_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputFileLocation(new MTPDinputDocumentFileLocation(_id, _access_hash)); + } + inline static MTPinputPhotoCrop new_inputPhotoCropAuto() { + return MTPinputPhotoCrop(mtpc_inputPhotoCropAuto); + } + inline static MTPinputPhotoCrop new_inputPhotoCrop(const MTPdouble &_crop_left, const MTPdouble &_crop_top, const MTPdouble &_crop_width) { + return MTPinputPhotoCrop(new MTPDinputPhotoCrop(_crop_left, _crop_top, _crop_width)); + } + inline static MTPinputAppEvent new_inputAppEvent(const MTPdouble &_time, const MTPstring &_type, const MTPlong &_peer, const MTPstring &_data) { + return MTPinputAppEvent(new MTPDinputAppEvent(_time, _type, _peer, _data)); + } + inline static MTPpeer new_peerUser(MTPint _user_id) { + return MTPpeer(new MTPDpeerUser(_user_id)); + } + inline static MTPpeer new_peerChat(MTPint _chat_id) { + return MTPpeer(new MTPDpeerChat(_chat_id)); + } + inline static MTPpeer new_peerChannel(MTPint _channel_id) { + return MTPpeer(new MTPDpeerChannel(_channel_id)); + } + inline static MTPstorage_fileType new_storage_fileUnknown() { + return MTPstorage_fileType(mtpc_storage_fileUnknown); + } + inline static MTPstorage_fileType new_storage_fileJpeg() { + return MTPstorage_fileType(mtpc_storage_fileJpeg); + } + inline static MTPstorage_fileType new_storage_fileGif() { + return MTPstorage_fileType(mtpc_storage_fileGif); + } + inline static MTPstorage_fileType new_storage_filePng() { + return MTPstorage_fileType(mtpc_storage_filePng); + } + inline static MTPstorage_fileType new_storage_filePdf() { + return MTPstorage_fileType(mtpc_storage_filePdf); + } + inline static MTPstorage_fileType new_storage_fileMp3() { + return MTPstorage_fileType(mtpc_storage_fileMp3); + } + inline static MTPstorage_fileType new_storage_fileMov() { + return MTPstorage_fileType(mtpc_storage_fileMov); + } + inline static MTPstorage_fileType new_storage_filePartial() { + return MTPstorage_fileType(mtpc_storage_filePartial); + } + inline static MTPstorage_fileType new_storage_fileMp4() { + return MTPstorage_fileType(mtpc_storage_fileMp4); + } + inline static MTPstorage_fileType new_storage_fileWebp() { + return MTPstorage_fileType(mtpc_storage_fileWebp); + } + inline static MTPfileLocation new_fileLocationUnavailable(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { + return MTPfileLocation(new MTPDfileLocationUnavailable(_volume_id, _local_id, _secret)); + } + inline static MTPfileLocation new_fileLocation(MTPint _dc_id, const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { + return MTPfileLocation(new MTPDfileLocation(_dc_id, _volume_id, _local_id, _secret)); + } + inline static MTPuser new_userEmpty(MTPint _id) { + return MTPuser(new MTPDuserEmpty(_id)); + } + inline static MTPuser new_user(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder) { + return MTPuser(new MTPDuser(_flags, _id, _access_hash, _first_name, _last_name, _username, _phone, _photo, _status, _bot_info_version, _restriction_reason, _bot_inline_placeholder)); + } + inline static MTPuserProfilePhoto new_userProfilePhotoEmpty() { + return MTPuserProfilePhoto(mtpc_userProfilePhotoEmpty); + } + inline static MTPuserProfilePhoto new_userProfilePhoto(const MTPlong &_photo_id, const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big) { + return MTPuserProfilePhoto(new MTPDuserProfilePhoto(_photo_id, _photo_small, _photo_big)); + } + inline static MTPuserStatus new_userStatusEmpty() { + return MTPuserStatus(mtpc_userStatusEmpty); + } + inline static MTPuserStatus new_userStatusOnline(MTPint _expires) { + return MTPuserStatus(new MTPDuserStatusOnline(_expires)); + } + inline static MTPuserStatus new_userStatusOffline(MTPint _was_online) { + return MTPuserStatus(new MTPDuserStatusOffline(_was_online)); + } + inline static MTPuserStatus new_userStatusRecently() { + return MTPuserStatus(mtpc_userStatusRecently); + } + inline static MTPuserStatus new_userStatusLastWeek() { + return MTPuserStatus(mtpc_userStatusLastWeek); + } + inline static MTPuserStatus new_userStatusLastMonth() { + return MTPuserStatus(mtpc_userStatusLastMonth); + } + inline static MTPchat new_chatEmpty(MTPint _id) { + return MTPchat(new MTPDchatEmpty(_id)); + } + inline static MTPchat new_chat(const MTPflags &_flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to) { + return MTPchat(new MTPDchat(_flags, _id, _title, _photo, _participants_count, _date, _version, _migrated_to)); + } + inline static MTPchat new_chatForbidden(MTPint _id, const MTPstring &_title) { + return MTPchat(new MTPDchatForbidden(_id, _title)); + } + inline static MTPchat new_channel(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason) { + return MTPchat(new MTPDchannel(_flags, _id, _access_hash, _title, _username, _photo, _date, _version, _restriction_reason)); + } + inline static MTPchat new_channelForbidden(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title) { + return MTPchat(new MTPDchannelForbidden(_id, _access_hash, _title)); + } + inline static MTPchatFull new_chatFull(MTPint _id, const MTPChatParticipants &_participants, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info) { + return MTPchatFull(new MTPDchatFull(_id, _participants, _chat_photo, _notify_settings, _exported_invite, _bot_info)); + } + inline static MTPchatFull new_channelFull(const MTPflags &_flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id) { + return MTPchatFull(new MTPDchannelFull(_flags, _id, _about, _participants_count, _admins_count, _kicked_count, _read_inbox_max_id, _unread_count, _unread_important_count, _chat_photo, _notify_settings, _exported_invite, _bot_info, _migrated_from_chat_id, _migrated_from_max_id, _pinned_msg_id)); + } + inline static MTPchatParticipant new_chatParticipant(MTPint _user_id, MTPint _inviter_id, MTPint _date) { + return MTPchatParticipant(new MTPDchatParticipant(_user_id, _inviter_id, _date)); + } + inline static MTPchatParticipant new_chatParticipantCreator(MTPint _user_id) { + return MTPchatParticipant(new MTPDchatParticipantCreator(_user_id)); + } + inline static MTPchatParticipant new_chatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date) { + return MTPchatParticipant(new MTPDchatParticipantAdmin(_user_id, _inviter_id, _date)); + } + inline static MTPchatParticipants new_chatParticipantsForbidden(const MTPflags &_flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) { + return MTPchatParticipants(new MTPDchatParticipantsForbidden(_flags, _chat_id, _self_participant)); + } + inline static MTPchatParticipants new_chatParticipants(MTPint _chat_id, const MTPVector &_participants, MTPint _version) { + return MTPchatParticipants(new MTPDchatParticipants(_chat_id, _participants, _version)); + } + inline static MTPchatPhoto new_chatPhotoEmpty() { + return MTPchatPhoto(mtpc_chatPhotoEmpty); + } + inline static MTPchatPhoto new_chatPhoto(const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big) { + return MTPchatPhoto(new MTPDchatPhoto(_photo_small, _photo_big)); + } + inline static MTPmessage new_messageEmpty(MTPint _id) { + return MTPmessage(new MTPDmessageEmpty(_id)); + } + inline static MTPmessage new_message(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date) { + return MTPmessage(new MTPDmessage(_flags, _id, _from_id, _to_id, _fwd_from, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views, _edit_date)); + } + inline static MTPmessage new_messageService(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action) { + return MTPmessage(new MTPDmessageService(_flags, _id, _from_id, _to_id, _reply_to_msg_id, _date, _action)); + } + inline static MTPmessageMedia new_messageMediaEmpty() { + return MTPmessageMedia(mtpc_messageMediaEmpty); + } + inline static MTPmessageMedia new_messageMediaPhoto(const MTPPhoto &_photo, const MTPstring &_caption) { + return MTPmessageMedia(new MTPDmessageMediaPhoto(_photo, _caption)); + } + inline static MTPmessageMedia new_messageMediaGeo(const MTPGeoPoint &_geo) { + return MTPmessageMedia(new MTPDmessageMediaGeo(_geo)); + } + inline static MTPmessageMedia new_messageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, MTPint _user_id) { + return MTPmessageMedia(new MTPDmessageMediaContact(_phone_number, _first_name, _last_name, _user_id)); + } + inline static MTPmessageMedia new_messageMediaUnsupported() { + return MTPmessageMedia(mtpc_messageMediaUnsupported); + } + inline static MTPmessageMedia new_messageMediaDocument(const MTPDocument &_document, const MTPstring &_caption) { + return MTPmessageMedia(new MTPDmessageMediaDocument(_document, _caption)); + } + inline static MTPmessageMedia new_messageMediaWebPage(const MTPWebPage &_webpage) { + return MTPmessageMedia(new MTPDmessageMediaWebPage(_webpage)); + } + inline static MTPmessageMedia new_messageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { + return MTPmessageMedia(new MTPDmessageMediaVenue(_geo, _title, _address, _provider, _venue_id)); + } + inline static MTPmessageAction new_messageActionEmpty() { + return MTPmessageAction(mtpc_messageActionEmpty); + } + inline static MTPmessageAction new_messageActionChatCreate(const MTPstring &_title, const MTPVector &_users) { + return MTPmessageAction(new MTPDmessageActionChatCreate(_title, _users)); + } + inline static MTPmessageAction new_messageActionChatEditTitle(const MTPstring &_title) { + return MTPmessageAction(new MTPDmessageActionChatEditTitle(_title)); + } + inline static MTPmessageAction new_messageActionChatEditPhoto(const MTPPhoto &_photo) { + return MTPmessageAction(new MTPDmessageActionChatEditPhoto(_photo)); + } + inline static MTPmessageAction new_messageActionChatDeletePhoto() { + return MTPmessageAction(mtpc_messageActionChatDeletePhoto); + } + inline static MTPmessageAction new_messageActionChatAddUser(const MTPVector &_users) { + return MTPmessageAction(new MTPDmessageActionChatAddUser(_users)); + } + inline static MTPmessageAction new_messageActionChatDeleteUser(MTPint _user_id) { + return MTPmessageAction(new MTPDmessageActionChatDeleteUser(_user_id)); + } + inline static MTPmessageAction new_messageActionChatJoinedByLink(MTPint _inviter_id) { + return MTPmessageAction(new MTPDmessageActionChatJoinedByLink(_inviter_id)); + } + inline static MTPmessageAction new_messageActionChannelCreate(const MTPstring &_title) { + return MTPmessageAction(new MTPDmessageActionChannelCreate(_title)); + } + inline static MTPmessageAction new_messageActionChatMigrateTo(MTPint _channel_id) { + return MTPmessageAction(new MTPDmessageActionChatMigrateTo(_channel_id)); + } + inline static MTPmessageAction new_messageActionChannelMigrateFrom(const MTPstring &_title, MTPint _chat_id) { + return MTPmessageAction(new MTPDmessageActionChannelMigrateFrom(_title, _chat_id)); + } + inline static MTPmessageAction new_messageActionPinMessage() { + return MTPmessageAction(mtpc_messageActionPinMessage); + } + inline static MTPdialog new_dialog(const MTPPeer &_peer, MTPint _top_message, MTPint _read_inbox_max_id, MTPint _unread_count, const MTPPeerNotifySettings &_notify_settings) { + return MTPdialog(new MTPDdialog(_peer, _top_message, _read_inbox_max_id, _unread_count, _notify_settings)); + } + inline static MTPdialog new_dialogChannel(const MTPPeer &_peer, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPeerNotifySettings &_notify_settings, MTPint _pts) { + return MTPdialog(new MTPDdialogChannel(_peer, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _notify_settings, _pts)); + } + inline static MTPphoto new_photoEmpty(const MTPlong &_id) { + return MTPphoto(new MTPDphotoEmpty(_id)); + } + inline static MTPphoto new_photo(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPVector &_sizes) { + return MTPphoto(new MTPDphoto(_id, _access_hash, _date, _sizes)); + } + inline static MTPphotoSize new_photoSizeEmpty(const MTPstring &_type) { + return MTPphotoSize(new MTPDphotoSizeEmpty(_type)); + } + inline static MTPphotoSize new_photoSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, MTPint _size) { + return MTPphotoSize(new MTPDphotoSize(_type, _location, _w, _h, _size)); + } + inline static MTPphotoSize new_photoCachedSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, const MTPbytes &_bytes) { + return MTPphotoSize(new MTPDphotoCachedSize(_type, _location, _w, _h, _bytes)); + } + inline static MTPgeoPoint new_geoPointEmpty() { + return MTPgeoPoint(mtpc_geoPointEmpty); + } + inline static MTPgeoPoint new_geoPoint(const MTPdouble &_long, const MTPdouble &_lat) { + return MTPgeoPoint(new MTPDgeoPoint(_long, _lat)); + } + inline static MTPauth_checkedPhone new_auth_checkedPhone(MTPBool _phone_registered) { + return MTPauth_checkedPhone(new MTPDauth_checkedPhone(_phone_registered)); + } + inline static MTPauth_sentCode new_auth_sentCode(const MTPflags &_flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout) { + return MTPauth_sentCode(new MTPDauth_sentCode(_flags, _type, _phone_code_hash, _next_type, _timeout)); + } + inline static MTPauth_authorization new_auth_authorization(const MTPUser &_user) { + return MTPauth_authorization(new MTPDauth_authorization(_user)); + } + inline static MTPauth_exportedAuthorization new_auth_exportedAuthorization(MTPint _id, const MTPbytes &_bytes) { + return MTPauth_exportedAuthorization(new MTPDauth_exportedAuthorization(_id, _bytes)); + } + inline static MTPinputNotifyPeer new_inputNotifyPeer(const MTPInputPeer &_peer) { + return MTPinputNotifyPeer(new MTPDinputNotifyPeer(_peer)); + } + inline static MTPinputNotifyPeer new_inputNotifyUsers() { + return MTPinputNotifyPeer(mtpc_inputNotifyUsers); + } + inline static MTPinputNotifyPeer new_inputNotifyChats() { + return MTPinputNotifyPeer(mtpc_inputNotifyChats); + } + inline static MTPinputNotifyPeer new_inputNotifyAll() { + return MTPinputNotifyPeer(mtpc_inputNotifyAll); + } + inline static MTPinputPeerNotifyEvents new_inputPeerNotifyEventsEmpty() { + return MTPinputPeerNotifyEvents(mtpc_inputPeerNotifyEventsEmpty); + } + inline static MTPinputPeerNotifyEvents new_inputPeerNotifyEventsAll() { + return MTPinputPeerNotifyEvents(mtpc_inputPeerNotifyEventsAll); + } + inline static MTPinputPeerNotifySettings new_inputPeerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) { + return MTPinputPeerNotifySettings(new MTPDinputPeerNotifySettings(_flags, _mute_until, _sound)); + } + inline static MTPpeerNotifyEvents new_peerNotifyEventsEmpty() { + return MTPpeerNotifyEvents(mtpc_peerNotifyEventsEmpty); + } + inline static MTPpeerNotifyEvents new_peerNotifyEventsAll() { + return MTPpeerNotifyEvents(mtpc_peerNotifyEventsAll); + } + inline static MTPpeerNotifySettings new_peerNotifySettingsEmpty() { + return MTPpeerNotifySettings(mtpc_peerNotifySettingsEmpty); + } + inline static MTPpeerNotifySettings new_peerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) { + return MTPpeerNotifySettings(new MTPDpeerNotifySettings(_flags, _mute_until, _sound)); + } + inline static MTPpeerSettings new_peerSettings(const MTPflags &_flags) { + return MTPpeerSettings(new MTPDpeerSettings(_flags)); + } + inline static MTPwallPaper new_wallPaper(MTPint _id, const MTPstring &_title, const MTPVector &_sizes, MTPint _color) { + return MTPwallPaper(new MTPDwallPaper(_id, _title, _sizes, _color)); + } + inline static MTPwallPaper new_wallPaperSolid(MTPint _id, const MTPstring &_title, MTPint _bg_color, MTPint _color) { + return MTPwallPaper(new MTPDwallPaperSolid(_id, _title, _bg_color, _color)); + } + inline static MTPreportReason new_inputReportReasonSpam() { + return MTPreportReason(mtpc_inputReportReasonSpam); + } + inline static MTPreportReason new_inputReportReasonViolence() { + return MTPreportReason(mtpc_inputReportReasonViolence); + } + inline static MTPreportReason new_inputReportReasonPornography() { + return MTPreportReason(mtpc_inputReportReasonPornography); + } + inline static MTPreportReason new_inputReportReasonOther(const MTPstring &_text) { + return MTPreportReason(new MTPDinputReportReasonOther(_text)); + } + inline static MTPuserFull new_userFull(const MTPflags &_flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info) { + return MTPuserFull(new MTPDuserFull(_flags, _user, _about, _link, _profile_photo, _notify_settings, _bot_info)); + } + inline static MTPcontact new_contact(MTPint _user_id, MTPBool _mutual) { + return MTPcontact(new MTPDcontact(_user_id, _mutual)); + } + inline static MTPimportedContact new_importedContact(MTPint _user_id, const MTPlong &_client_id) { + return MTPimportedContact(new MTPDimportedContact(_user_id, _client_id)); + } + inline static MTPcontactBlocked new_contactBlocked(MTPint _user_id, MTPint _date) { + return MTPcontactBlocked(new MTPDcontactBlocked(_user_id, _date)); + } + inline static MTPcontactStatus new_contactStatus(MTPint _user_id, const MTPUserStatus &_status) { + return MTPcontactStatus(new MTPDcontactStatus(_user_id, _status)); + } + inline static MTPcontacts_link new_contacts_link(const MTPContactLink &_my_link, const MTPContactLink &_foreign_link, const MTPUser &_user) { + return MTPcontacts_link(new MTPDcontacts_link(_my_link, _foreign_link, _user)); + } + inline static MTPcontacts_contacts new_contacts_contactsNotModified() { + return MTPcontacts_contacts(mtpc_contacts_contactsNotModified); + } + inline static MTPcontacts_contacts new_contacts_contacts(const MTPVector &_contacts, const MTPVector &_users) { + return MTPcontacts_contacts(new MTPDcontacts_contacts(_contacts, _users)); + } + inline static MTPcontacts_importedContacts new_contacts_importedContacts(const MTPVector &_imported, const MTPVector &_retry_contacts, const MTPVector &_users) { + return MTPcontacts_importedContacts(new MTPDcontacts_importedContacts(_imported, _retry_contacts, _users)); + } + inline static MTPcontacts_blocked new_contacts_blocked(const MTPVector &_blocked, const MTPVector &_users) { + return MTPcontacts_blocked(new MTPDcontacts_blocked(_blocked, _users)); + } + inline static MTPcontacts_blocked new_contacts_blockedSlice(MTPint _count, const MTPVector &_blocked, const MTPVector &_users) { + return MTPcontacts_blocked(new MTPDcontacts_blockedSlice(_count, _blocked, _users)); + } + inline static MTPmessages_dialogs new_messages_dialogs(const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_dialogs(new MTPDmessages_dialogs(_dialogs, _messages, _chats, _users)); + } + inline static MTPmessages_dialogs new_messages_dialogsSlice(MTPint _count, const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_dialogs(new MTPDmessages_dialogsSlice(_count, _dialogs, _messages, _chats, _users)); + } + inline static MTPmessages_messages new_messages_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_messages(new MTPDmessages_messages(_messages, _chats, _users)); + } + inline static MTPmessages_messages new_messages_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_messages(new MTPDmessages_messagesSlice(_count, _messages, _chats, _users)); + } + inline static MTPmessages_messages new_messages_channelMessages(const MTPflags &_flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_messages(new MTPDmessages_channelMessages(_flags, _pts, _count, _messages, _collapsed, _chats, _users)); + } + inline static MTPmessages_chats new_messages_chats(const MTPVector &_chats) { + return MTPmessages_chats(new MTPDmessages_chats(_chats)); + } + inline static MTPmessages_chatFull new_messages_chatFull(const MTPChatFull &_full_chat, const MTPVector &_chats, const MTPVector &_users) { + return MTPmessages_chatFull(new MTPDmessages_chatFull(_full_chat, _chats, _users)); + } + inline static MTPmessages_affectedHistory new_messages_affectedHistory(MTPint _pts, MTPint _pts_count, MTPint _offset) { + return MTPmessages_affectedHistory(new MTPDmessages_affectedHistory(_pts, _pts_count, _offset)); + } + inline static MTPmessagesFilter new_inputMessagesFilterEmpty() { + return MTPmessagesFilter(mtpc_inputMessagesFilterEmpty); + } + inline static MTPmessagesFilter new_inputMessagesFilterPhotos() { + return MTPmessagesFilter(mtpc_inputMessagesFilterPhotos); + } + inline static MTPmessagesFilter new_inputMessagesFilterVideo() { + return MTPmessagesFilter(mtpc_inputMessagesFilterVideo); + } + inline static MTPmessagesFilter new_inputMessagesFilterPhotoVideo() { + return MTPmessagesFilter(mtpc_inputMessagesFilterPhotoVideo); + } + inline static MTPmessagesFilter new_inputMessagesFilterPhotoVideoDocuments() { + return MTPmessagesFilter(mtpc_inputMessagesFilterPhotoVideoDocuments); + } + inline static MTPmessagesFilter new_inputMessagesFilterDocument() { + return MTPmessagesFilter(mtpc_inputMessagesFilterDocument); + } + inline static MTPmessagesFilter new_inputMessagesFilterUrl() { + return MTPmessagesFilter(mtpc_inputMessagesFilterUrl); + } + inline static MTPmessagesFilter new_inputMessagesFilterGif() { + return MTPmessagesFilter(mtpc_inputMessagesFilterGif); + } + inline static MTPmessagesFilter new_inputMessagesFilterVoice() { + return MTPmessagesFilter(mtpc_inputMessagesFilterVoice); + } + inline static MTPmessagesFilter new_inputMessagesFilterMusic() { + return MTPmessagesFilter(mtpc_inputMessagesFilterMusic); + } + inline static MTPupdate new_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateNewMessage(_message, _pts, _pts_count)); + } + inline static MTPupdate new_updateMessageID(MTPint _id, const MTPlong &_random_id) { + return MTPupdate(new MTPDupdateMessageID(_id, _random_id)); + } + inline static MTPupdate new_updateDeleteMessages(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateDeleteMessages(_messages, _pts, _pts_count)); + } + inline static MTPupdate new_updateUserTyping(MTPint _user_id, const MTPSendMessageAction &_action) { + return MTPupdate(new MTPDupdateUserTyping(_user_id, _action)); + } + inline static MTPupdate new_updateChatUserTyping(MTPint _chat_id, MTPint _user_id, const MTPSendMessageAction &_action) { + return MTPupdate(new MTPDupdateChatUserTyping(_chat_id, _user_id, _action)); + } + inline static MTPupdate new_updateChatParticipants(const MTPChatParticipants &_participants) { + return MTPupdate(new MTPDupdateChatParticipants(_participants)); + } + inline static MTPupdate new_updateUserStatus(MTPint _user_id, const MTPUserStatus &_status) { + return MTPupdate(new MTPDupdateUserStatus(_user_id, _status)); + } + inline static MTPupdate new_updateUserName(MTPint _user_id, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username) { + return MTPupdate(new MTPDupdateUserName(_user_id, _first_name, _last_name, _username)); + } + inline static MTPupdate new_updateUserPhoto(MTPint _user_id, MTPint _date, const MTPUserProfilePhoto &_photo, MTPBool _previous) { + return MTPupdate(new MTPDupdateUserPhoto(_user_id, _date, _photo, _previous)); + } + inline static MTPupdate new_updateContactRegistered(MTPint _user_id, MTPint _date) { + return MTPupdate(new MTPDupdateContactRegistered(_user_id, _date)); + } + inline static MTPupdate new_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link) { + return MTPupdate(new MTPDupdateContactLink(_user_id, _my_link, _foreign_link)); + } + inline static MTPupdate new_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) { + return MTPupdate(new MTPDupdateNewAuthorization(_auth_key_id, _date, _device, _location)); + } + inline static MTPupdate new_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts) { + return MTPupdate(new MTPDupdateNewEncryptedMessage(_message, _qts)); + } + inline static MTPupdate new_updateEncryptedChatTyping(MTPint _chat_id) { + return MTPupdate(new MTPDupdateEncryptedChatTyping(_chat_id)); + } + inline static MTPupdate new_updateEncryption(const MTPEncryptedChat &_chat, MTPint _date) { + return MTPupdate(new MTPDupdateEncryption(_chat, _date)); + } + inline static MTPupdate new_updateEncryptedMessagesRead(MTPint _chat_id, MTPint _max_date, MTPint _date) { + return MTPupdate(new MTPDupdateEncryptedMessagesRead(_chat_id, _max_date, _date)); + } + inline static MTPupdate new_updateChatParticipantAdd(MTPint _chat_id, MTPint _user_id, MTPint _inviter_id, MTPint _date, MTPint _version) { + return MTPupdate(new MTPDupdateChatParticipantAdd(_chat_id, _user_id, _inviter_id, _date, _version)); + } + inline static MTPupdate new_updateChatParticipantDelete(MTPint _chat_id, MTPint _user_id, MTPint _version) { + return MTPupdate(new MTPDupdateChatParticipantDelete(_chat_id, _user_id, _version)); + } + inline static MTPupdate new_updateDcOptions(const MTPVector &_dc_options) { + return MTPupdate(new MTPDupdateDcOptions(_dc_options)); + } + inline static MTPupdate new_updateUserBlocked(MTPint _user_id, MTPBool _blocked) { + return MTPupdate(new MTPDupdateUserBlocked(_user_id, _blocked)); + } + inline static MTPupdate new_updateNotifySettings(const MTPNotifyPeer &_peer, const MTPPeerNotifySettings &_notify_settings) { + return MTPupdate(new MTPDupdateNotifySettings(_peer, _notify_settings)); + } + inline static MTPupdate new_updateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup) { + return MTPupdate(new MTPDupdateServiceNotification(_type, _message, _media, _popup)); + } + inline static MTPupdate new_updatePrivacy(const MTPPrivacyKey &_key, const MTPVector &_rules) { + return MTPupdate(new MTPDupdatePrivacy(_key, _rules)); + } + inline static MTPupdate new_updateUserPhone(MTPint _user_id, const MTPstring &_phone) { + return MTPupdate(new MTPDupdateUserPhone(_user_id, _phone)); + } + inline static MTPupdate new_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateReadHistoryInbox(_peer, _max_id, _pts, _pts_count)); + } + inline static MTPupdate new_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateReadHistoryOutbox(_peer, _max_id, _pts, _pts_count)); + } + inline static MTPupdate new_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateWebPage(_webpage, _pts, _pts_count)); + } + inline static MTPupdate new_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count)); + } + inline static MTPupdate new_updateChannelTooLong(const MTPflags &_flags, MTPint _channel_id, MTPint _pts) { + return MTPupdate(new MTPDupdateChannelTooLong(_flags, _channel_id, _pts)); + } + inline static MTPupdate new_updateChannel(MTPint _channel_id) { + return MTPupdate(new MTPDupdateChannel(_channel_id)); + } + inline static MTPupdate new_updateChannelGroup(MTPint _channel_id, const MTPMessageGroup &_group) { + return MTPupdate(new MTPDupdateChannelGroup(_channel_id, _group)); + } + inline static MTPupdate new_updateNewChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateNewChannelMessage(_message, _pts, _pts_count)); + } + inline static MTPupdate new_updateReadChannelInbox(MTPint _channel_id, MTPint _max_id) { + return MTPupdate(new MTPDupdateReadChannelInbox(_channel_id, _max_id)); + } + inline static MTPupdate new_updateDeleteChannelMessages(MTPint _channel_id, const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateDeleteChannelMessages(_channel_id, _messages, _pts, _pts_count)); + } + inline static MTPupdate new_updateChannelMessageViews(MTPint _channel_id, MTPint _id, MTPint _views) { + return MTPupdate(new MTPDupdateChannelMessageViews(_channel_id, _id, _views)); + } + inline static MTPupdate new_updateChatAdmins(MTPint _chat_id, MTPBool _enabled, MTPint _version) { + return MTPupdate(new MTPDupdateChatAdmins(_chat_id, _enabled, _version)); + } + inline static MTPupdate new_updateChatParticipantAdmin(MTPint _chat_id, MTPint _user_id, MTPBool _is_admin, MTPint _version) { + return MTPupdate(new MTPDupdateChatParticipantAdmin(_chat_id, _user_id, _is_admin, _version)); + } + inline static MTPupdate new_updateNewStickerSet(const MTPmessages_StickerSet &_stickerset) { + return MTPupdate(new MTPDupdateNewStickerSet(_stickerset)); + } + inline static MTPupdate new_updateStickerSetsOrder(const MTPVector &_order) { + return MTPupdate(new MTPDupdateStickerSetsOrder(_order)); + } + inline static MTPupdate new_updateStickerSets() { + return MTPupdate(mtpc_updateStickerSets); + } + inline static MTPupdate new_updateSavedGifs() { + return MTPupdate(mtpc_updateSavedGifs); + } + inline static MTPupdate new_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset) { + return MTPupdate(new MTPDupdateBotInlineQuery(_query_id, _user_id, _query, _offset)); + } + inline static MTPupdate new_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { + return MTPupdate(new MTPDupdateBotInlineSend(_user_id, _query, _id)); + } + inline static MTPupdate new_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); + } + inline static MTPupdate new_updateChannelPinnedMessage(MTPint _channel_id, MTPint _id) { + return MTPupdate(new MTPDupdateChannelPinnedMessage(_channel_id, _id)); + } + inline static MTPupdates_state new_updates_state(MTPint _pts, MTPint _qts, MTPint _date, MTPint _seq, MTPint _unread_count) { + return MTPupdates_state(new MTPDupdates_state(_pts, _qts, _date, _seq, _unread_count)); + } + inline static MTPupdates_difference new_updates_differenceEmpty(MTPint _date, MTPint _seq) { + return MTPupdates_difference(new MTPDupdates_differenceEmpty(_date, _seq)); + } + inline static MTPupdates_difference new_updates_difference(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_state) { + return MTPupdates_difference(new MTPDupdates_difference(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _state)); + } + inline static MTPupdates_difference new_updates_differenceSlice(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_intermediate_state) { + return MTPupdates_difference(new MTPDupdates_differenceSlice(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _intermediate_state)); + } + inline static MTPupdates new_updatesTooLong() { + return MTPupdates(mtpc_updatesTooLong); + } + inline static MTPupdates new_updateShortMessage(const MTPflags &_flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { + return MTPupdates(new MTPDupdateShortMessage(_flags, _id, _user_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities)); + } + inline static MTPupdates new_updateShortChatMessage(const MTPflags &_flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { + return MTPupdates(new MTPDupdateShortChatMessage(_flags, _id, _from_id, _chat_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities)); + } + inline static MTPupdates new_updateShort(const MTPUpdate &_update, MTPint _date) { + return MTPupdates(new MTPDupdateShort(_update, _date)); + } + inline static MTPupdates new_updatesCombined(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq_start, MTPint _seq) { + return MTPupdates(new MTPDupdatesCombined(_updates, _users, _chats, _date, _seq_start, _seq)); + } + inline static MTPupdates new_updates(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq) { + return MTPupdates(new MTPDupdates(_updates, _users, _chats, _date, _seq)); + } + inline static MTPupdates new_updateShortSentMessage(const MTPflags &_flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTPupdates(new MTPDupdateShortSentMessage(_flags, _id, _pts, _pts_count, _date, _media, _entities)); + } + inline static MTPphotos_photos new_photos_photos(const MTPVector &_photos, const MTPVector &_users) { + return MTPphotos_photos(new MTPDphotos_photos(_photos, _users)); + } + inline static MTPphotos_photos new_photos_photosSlice(MTPint _count, const MTPVector &_photos, const MTPVector &_users) { + return MTPphotos_photos(new MTPDphotos_photosSlice(_count, _photos, _users)); + } + inline static MTPphotos_photo new_photos_photo(const MTPPhoto &_photo, const MTPVector &_users) { + return MTPphotos_photo(new MTPDphotos_photo(_photo, _users)); + } + inline static MTPupload_file new_upload_file(const MTPstorage_FileType &_type, MTPint _mtime, const MTPbytes &_bytes) { + return MTPupload_file(new MTPDupload_file(_type, _mtime, _bytes)); + } + inline static MTPdcOption new_dcOption(const MTPflags &_flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) { + return MTPdcOption(new MTPDdcOption(_flags, _id, _ip_address, _port)); + } + inline static MTPconfig new_config(MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, const MTPVector &_disabled_features) { + return MTPconfig(new MTPDconfig(_date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _disabled_features)); + } + inline static MTPnearestDc new_nearestDc(const MTPstring &_country, MTPint _this_dc, MTPint _nearest_dc) { + return MTPnearestDc(new MTPDnearestDc(_country, _this_dc, _nearest_dc)); + } + inline static MTPhelp_appUpdate new_help_appUpdate(MTPint _id, MTPBool _critical, const MTPstring &_url, const MTPstring &_text) { + return MTPhelp_appUpdate(new MTPDhelp_appUpdate(_id, _critical, _url, _text)); + } + inline static MTPhelp_appUpdate new_help_noAppUpdate() { + return MTPhelp_appUpdate(mtpc_help_noAppUpdate); + } + inline static MTPhelp_inviteText new_help_inviteText(const MTPstring &_message) { + return MTPhelp_inviteText(new MTPDhelp_inviteText(_message)); + } + inline static MTPencryptedChat new_encryptedChatEmpty(MTPint _id) { + return MTPencryptedChat(new MTPDencryptedChatEmpty(_id)); + } + inline static MTPencryptedChat new_encryptedChatWaiting(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id) { + return MTPencryptedChat(new MTPDencryptedChatWaiting(_id, _access_hash, _date, _admin_id, _participant_id)); + } + inline static MTPencryptedChat new_encryptedChatRequested(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a) { + return MTPencryptedChat(new MTPDencryptedChatRequested(_id, _access_hash, _date, _admin_id, _participant_id, _g_a)); + } + inline static MTPencryptedChat new_encryptedChat(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint) { + return MTPencryptedChat(new MTPDencryptedChat(_id, _access_hash, _date, _admin_id, _participant_id, _g_a_or_b, _key_fingerprint)); + } + inline static MTPencryptedChat new_encryptedChatDiscarded(MTPint _id) { + return MTPencryptedChat(new MTPDencryptedChatDiscarded(_id)); + } + inline static MTPinputEncryptedChat new_inputEncryptedChat(MTPint _chat_id, const MTPlong &_access_hash) { + return MTPinputEncryptedChat(new MTPDinputEncryptedChat(_chat_id, _access_hash)); + } + inline static MTPencryptedFile new_encryptedFileEmpty() { + return MTPencryptedFile(mtpc_encryptedFileEmpty); + } + inline static MTPencryptedFile new_encryptedFile(const MTPlong &_id, const MTPlong &_access_hash, MTPint _size, MTPint _dc_id, MTPint _key_fingerprint) { + return MTPencryptedFile(new MTPDencryptedFile(_id, _access_hash, _size, _dc_id, _key_fingerprint)); + } + inline static MTPinputEncryptedFile new_inputEncryptedFileEmpty() { + return MTPinputEncryptedFile(mtpc_inputEncryptedFileEmpty); + } + inline static MTPinputEncryptedFile new_inputEncryptedFileUploaded(const MTPlong &_id, MTPint _parts, const MTPstring &_md5_checksum, MTPint _key_fingerprint) { + return MTPinputEncryptedFile(new MTPDinputEncryptedFileUploaded(_id, _parts, _md5_checksum, _key_fingerprint)); + } + inline static MTPinputEncryptedFile new_inputEncryptedFile(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputEncryptedFile(new MTPDinputEncryptedFile(_id, _access_hash)); + } + inline static MTPinputEncryptedFile new_inputEncryptedFileBigUploaded(const MTPlong &_id, MTPint _parts, MTPint _key_fingerprint) { + return MTPinputEncryptedFile(new MTPDinputEncryptedFileBigUploaded(_id, _parts, _key_fingerprint)); + } + inline static MTPencryptedMessage new_encryptedMessage(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes, const MTPEncryptedFile &_file) { + return MTPencryptedMessage(new MTPDencryptedMessage(_random_id, _chat_id, _date, _bytes, _file)); + } + inline static MTPencryptedMessage new_encryptedMessageService(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes) { + return MTPencryptedMessage(new MTPDencryptedMessageService(_random_id, _chat_id, _date, _bytes)); + } + inline static MTPmessages_dhConfig new_messages_dhConfigNotModified(const MTPbytes &_random) { + return MTPmessages_dhConfig(new MTPDmessages_dhConfigNotModified(_random)); + } + inline static MTPmessages_dhConfig new_messages_dhConfig(MTPint _g, const MTPbytes &_p, MTPint _version, const MTPbytes &_random) { + return MTPmessages_dhConfig(new MTPDmessages_dhConfig(_g, _p, _version, _random)); + } + inline static MTPmessages_sentEncryptedMessage new_messages_sentEncryptedMessage(MTPint _date) { + return MTPmessages_sentEncryptedMessage(new MTPDmessages_sentEncryptedMessage(_date)); + } + inline static MTPmessages_sentEncryptedMessage new_messages_sentEncryptedFile(MTPint _date, const MTPEncryptedFile &_file) { + return MTPmessages_sentEncryptedMessage(new MTPDmessages_sentEncryptedFile(_date, _file)); + } + inline static MTPinputDocument new_inputDocumentEmpty() { + return MTPinputDocument(mtpc_inputDocumentEmpty); + } + inline static MTPinputDocument new_inputDocument(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputDocument(new MTPDinputDocument(_id, _access_hash)); + } + inline static MTPdocument new_documentEmpty(const MTPlong &_id) { + return MTPdocument(new MTPDdocumentEmpty(_id)); + } + inline static MTPdocument new_document(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, const MTPVector &_attributes) { + return MTPdocument(new MTPDdocument(_id, _access_hash, _date, _mime_type, _size, _thumb, _dc_id, _attributes)); + } + inline static MTPhelp_support new_help_support(const MTPstring &_phone_number, const MTPUser &_user) { + return MTPhelp_support(new MTPDhelp_support(_phone_number, _user)); + } + inline static MTPnotifyPeer new_notifyPeer(const MTPPeer &_peer) { + return MTPnotifyPeer(new MTPDnotifyPeer(_peer)); + } + inline static MTPnotifyPeer new_notifyUsers() { + return MTPnotifyPeer(mtpc_notifyUsers); + } + inline static MTPnotifyPeer new_notifyChats() { + return MTPnotifyPeer(mtpc_notifyChats); + } + inline static MTPnotifyPeer new_notifyAll() { + return MTPnotifyPeer(mtpc_notifyAll); + } + inline static MTPsendMessageAction new_sendMessageTypingAction() { + return MTPsendMessageAction(mtpc_sendMessageTypingAction); + } + inline static MTPsendMessageAction new_sendMessageCancelAction() { + return MTPsendMessageAction(mtpc_sendMessageCancelAction); + } + inline static MTPsendMessageAction new_sendMessageRecordVideoAction() { + return MTPsendMessageAction(mtpc_sendMessageRecordVideoAction); + } + inline static MTPsendMessageAction new_sendMessageUploadVideoAction(MTPint _progress) { + return MTPsendMessageAction(new MTPDsendMessageUploadVideoAction(_progress)); + } + inline static MTPsendMessageAction new_sendMessageRecordAudioAction() { + return MTPsendMessageAction(mtpc_sendMessageRecordAudioAction); + } + inline static MTPsendMessageAction new_sendMessageUploadAudioAction(MTPint _progress) { + return MTPsendMessageAction(new MTPDsendMessageUploadAudioAction(_progress)); + } + inline static MTPsendMessageAction new_sendMessageUploadPhotoAction(MTPint _progress) { + return MTPsendMessageAction(new MTPDsendMessageUploadPhotoAction(_progress)); + } + inline static MTPsendMessageAction new_sendMessageUploadDocumentAction(MTPint _progress) { + return MTPsendMessageAction(new MTPDsendMessageUploadDocumentAction(_progress)); + } + inline static MTPsendMessageAction new_sendMessageGeoLocationAction() { + return MTPsendMessageAction(mtpc_sendMessageGeoLocationAction); + } + inline static MTPsendMessageAction new_sendMessageChooseContactAction() { + return MTPsendMessageAction(mtpc_sendMessageChooseContactAction); + } + inline static MTPcontacts_found new_contacts_found(const MTPVector &_results, const MTPVector &_chats, const MTPVector &_users) { + return MTPcontacts_found(new MTPDcontacts_found(_results, _chats, _users)); + } + inline static MTPinputPrivacyKey new_inputPrivacyKeyStatusTimestamp() { + return MTPinputPrivacyKey(mtpc_inputPrivacyKeyStatusTimestamp); + } + inline static MTPinputPrivacyKey new_inputPrivacyKeyChatInvite() { + return MTPinputPrivacyKey(mtpc_inputPrivacyKeyChatInvite); + } + inline static MTPprivacyKey new_privacyKeyStatusTimestamp() { + return MTPprivacyKey(mtpc_privacyKeyStatusTimestamp); + } + inline static MTPprivacyKey new_privacyKeyChatInvite() { + return MTPprivacyKey(mtpc_privacyKeyChatInvite); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueAllowContacts() { + return MTPinputPrivacyRule(mtpc_inputPrivacyValueAllowContacts); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueAllowAll() { + return MTPinputPrivacyRule(mtpc_inputPrivacyValueAllowAll); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueAllowUsers(const MTPVector &_users) { + return MTPinputPrivacyRule(new MTPDinputPrivacyValueAllowUsers(_users)); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueDisallowContacts() { + return MTPinputPrivacyRule(mtpc_inputPrivacyValueDisallowContacts); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueDisallowAll() { + return MTPinputPrivacyRule(mtpc_inputPrivacyValueDisallowAll); + } + inline static MTPinputPrivacyRule new_inputPrivacyValueDisallowUsers(const MTPVector &_users) { + return MTPinputPrivacyRule(new MTPDinputPrivacyValueDisallowUsers(_users)); + } + inline static MTPprivacyRule new_privacyValueAllowContacts() { + return MTPprivacyRule(mtpc_privacyValueAllowContacts); + } + inline static MTPprivacyRule new_privacyValueAllowAll() { + return MTPprivacyRule(mtpc_privacyValueAllowAll); + } + inline static MTPprivacyRule new_privacyValueAllowUsers(const MTPVector &_users) { + return MTPprivacyRule(new MTPDprivacyValueAllowUsers(_users)); + } + inline static MTPprivacyRule new_privacyValueDisallowContacts() { + return MTPprivacyRule(mtpc_privacyValueDisallowContacts); + } + inline static MTPprivacyRule new_privacyValueDisallowAll() { + return MTPprivacyRule(mtpc_privacyValueDisallowAll); + } + inline static MTPprivacyRule new_privacyValueDisallowUsers(const MTPVector &_users) { + return MTPprivacyRule(new MTPDprivacyValueDisallowUsers(_users)); + } + inline static MTPaccount_privacyRules new_account_privacyRules(const MTPVector &_rules, const MTPVector &_users) { + return MTPaccount_privacyRules(new MTPDaccount_privacyRules(_rules, _users)); + } + inline static MTPaccountDaysTTL new_accountDaysTTL(MTPint _days) { + return MTPaccountDaysTTL(new MTPDaccountDaysTTL(_days)); + } + inline static MTPdocumentAttribute new_documentAttributeImageSize(MTPint _w, MTPint _h) { + return MTPdocumentAttribute(new MTPDdocumentAttributeImageSize(_w, _h)); + } + inline static MTPdocumentAttribute new_documentAttributeAnimated() { + return MTPdocumentAttribute(mtpc_documentAttributeAnimated); + } + inline static MTPdocumentAttribute new_documentAttributeSticker(const MTPstring &_alt, const MTPInputStickerSet &_stickerset) { + return MTPdocumentAttribute(new MTPDdocumentAttributeSticker(_alt, _stickerset)); + } + inline static MTPdocumentAttribute new_documentAttributeVideo(MTPint _duration, MTPint _w, MTPint _h) { + return MTPdocumentAttribute(new MTPDdocumentAttributeVideo(_duration, _w, _h)); + } + inline static MTPdocumentAttribute new_documentAttributeAudio(const MTPflags &_flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform) { + return MTPdocumentAttribute(new MTPDdocumentAttributeAudio(_flags, _duration, _title, _performer, _waveform)); + } + inline static MTPdocumentAttribute new_documentAttributeFilename(const MTPstring &_file_name) { + return MTPdocumentAttribute(new MTPDdocumentAttributeFilename(_file_name)); + } + inline static MTPmessages_stickers new_messages_stickersNotModified() { + return MTPmessages_stickers(mtpc_messages_stickersNotModified); + } + inline static MTPmessages_stickers new_messages_stickers(const MTPstring &_hash, const MTPVector &_stickers) { + return MTPmessages_stickers(new MTPDmessages_stickers(_hash, _stickers)); + } + inline static MTPstickerPack new_stickerPack(const MTPstring &_emoticon, const MTPVector &_documents) { + return MTPstickerPack(new MTPDstickerPack(_emoticon, _documents)); + } + inline static MTPmessages_allStickers new_messages_allStickersNotModified() { + return MTPmessages_allStickers(mtpc_messages_allStickersNotModified); + } + inline static MTPmessages_allStickers new_messages_allStickers(MTPint _hash, const MTPVector &_sets) { + return MTPmessages_allStickers(new MTPDmessages_allStickers(_hash, _sets)); + } + inline static MTPdisabledFeature new_disabledFeature(const MTPstring &_feature, const MTPstring &_description) { + return MTPdisabledFeature(new MTPDdisabledFeature(_feature, _description)); + } + inline static MTPmessages_affectedMessages new_messages_affectedMessages(MTPint _pts, MTPint _pts_count) { + return MTPmessages_affectedMessages(new MTPDmessages_affectedMessages(_pts, _pts_count)); + } + inline static MTPcontactLink new_contactLinkUnknown() { + return MTPcontactLink(mtpc_contactLinkUnknown); + } + inline static MTPcontactLink new_contactLinkNone() { + return MTPcontactLink(mtpc_contactLinkNone); + } + inline static MTPcontactLink new_contactLinkHasPhone() { + return MTPcontactLink(mtpc_contactLinkHasPhone); + } + inline static MTPcontactLink new_contactLinkContact() { + return MTPcontactLink(mtpc_contactLinkContact); + } + inline static MTPwebPage new_webPageEmpty(const MTPlong &_id) { + return MTPwebPage(new MTPDwebPageEmpty(_id)); + } + inline static MTPwebPage new_webPagePending(const MTPlong &_id, MTPint _date) { + return MTPwebPage(new MTPDwebPagePending(_id, _date)); + } + inline static MTPwebPage new_webPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) { + return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document)); + } + inline static MTPauthorization new_authorization(const MTPlong &_hash, MTPint _flags, const MTPstring &_device_model, const MTPstring &_platform, const MTPstring &_system_version, MTPint _api_id, const MTPstring &_app_name, const MTPstring &_app_version, MTPint _date_created, MTPint _date_active, const MTPstring &_ip, const MTPstring &_country, const MTPstring &_region) { + return MTPauthorization(new MTPDauthorization(_hash, _flags, _device_model, _platform, _system_version, _api_id, _app_name, _app_version, _date_created, _date_active, _ip, _country, _region)); + } + inline static MTPaccount_authorizations new_account_authorizations(const MTPVector &_authorizations) { + return MTPaccount_authorizations(new MTPDaccount_authorizations(_authorizations)); + } + inline static MTPaccount_password new_account_noPassword(const MTPbytes &_new_salt, const MTPstring &_email_unconfirmed_pattern) { + return MTPaccount_password(new MTPDaccount_noPassword(_new_salt, _email_unconfirmed_pattern)); + } + inline static MTPaccount_password new_account_password(const MTPbytes &_current_salt, const MTPbytes &_new_salt, const MTPstring &_hint, MTPBool _has_recovery, const MTPstring &_email_unconfirmed_pattern) { + return MTPaccount_password(new MTPDaccount_password(_current_salt, _new_salt, _hint, _has_recovery, _email_unconfirmed_pattern)); + } + inline static MTPaccount_passwordSettings new_account_passwordSettings(const MTPstring &_email) { + return MTPaccount_passwordSettings(new MTPDaccount_passwordSettings(_email)); + } + inline static MTPaccount_passwordInputSettings new_account_passwordInputSettings(const MTPflags &_flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email) { + return MTPaccount_passwordInputSettings(new MTPDaccount_passwordInputSettings(_flags, _new_salt, _new_password_hash, _hint, _email)); + } + inline static MTPauth_passwordRecovery new_auth_passwordRecovery(const MTPstring &_email_pattern) { + return MTPauth_passwordRecovery(new MTPDauth_passwordRecovery(_email_pattern)); + } + inline static MTPreceivedNotifyMessage new_receivedNotifyMessage(MTPint _id, MTPint _flags) { + return MTPreceivedNotifyMessage(new MTPDreceivedNotifyMessage(_id, _flags)); + } + inline static MTPexportedChatInvite new_chatInviteEmpty() { + return MTPexportedChatInvite(mtpc_chatInviteEmpty); + } + inline static MTPexportedChatInvite new_chatInviteExported(const MTPstring &_link) { + return MTPexportedChatInvite(new MTPDchatInviteExported(_link)); + } + inline static MTPchatInvite new_chatInviteAlready(const MTPChat &_chat) { + return MTPchatInvite(new MTPDchatInviteAlready(_chat)); + } + inline static MTPchatInvite new_chatInvite(const MTPflags &_flags, const MTPstring &_title) { + return MTPchatInvite(new MTPDchatInvite(_flags, _title)); + } + inline static MTPinputStickerSet new_inputStickerSetEmpty() { + return MTPinputStickerSet(mtpc_inputStickerSetEmpty); + } + inline static MTPinputStickerSet new_inputStickerSetID(const MTPlong &_id, const MTPlong &_access_hash) { + return MTPinputStickerSet(new MTPDinputStickerSetID(_id, _access_hash)); + } + inline static MTPinputStickerSet new_inputStickerSetShortName(const MTPstring &_short_name) { + return MTPinputStickerSet(new MTPDinputStickerSetShortName(_short_name)); + } + inline static MTPstickerSet new_stickerSet(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash) { + return MTPstickerSet(new MTPDstickerSet(_flags, _id, _access_hash, _title, _short_name, _count, _hash)); + } + inline static MTPmessages_stickerSet new_messages_stickerSet(const MTPStickerSet &_set, const MTPVector &_packs, const MTPVector &_documents) { + return MTPmessages_stickerSet(new MTPDmessages_stickerSet(_set, _packs, _documents)); + } + inline static MTPbotCommand new_botCommand(const MTPstring &_command, const MTPstring &_description) { + return MTPbotCommand(new MTPDbotCommand(_command, _description)); + } + inline static MTPbotInfo new_botInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands) { + return MTPbotInfo(new MTPDbotInfo(_user_id, _description, _commands)); + } + inline static MTPkeyboardButton new_keyboardButton(const MTPstring &_text) { + return MTPkeyboardButton(new MTPDkeyboardButton(_text)); + } + inline static MTPkeyboardButtonRow new_keyboardButtonRow(const MTPVector &_buttons) { + return MTPkeyboardButtonRow(new MTPDkeyboardButtonRow(_buttons)); + } + inline static MTPreplyMarkup new_replyKeyboardHide(const MTPflags &_flags) { + return MTPreplyMarkup(new MTPDreplyKeyboardHide(_flags)); + } + inline static MTPreplyMarkup new_replyKeyboardForceReply(const MTPflags &_flags) { + return MTPreplyMarkup(new MTPDreplyKeyboardForceReply(_flags)); + } + inline static MTPreplyMarkup new_replyKeyboardMarkup(const MTPflags &_flags, const MTPVector &_rows) { + return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_flags, _rows)); + } + inline static MTPhelp_appChangelog new_help_appChangelogEmpty() { + return MTPhelp_appChangelog(mtpc_help_appChangelogEmpty); + } + inline static MTPhelp_appChangelog new_help_appChangelog(const MTPstring &_text) { + return MTPhelp_appChangelog(new MTPDhelp_appChangelog(_text)); + } + inline static MTPmessageEntity new_messageEntityUnknown(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityUnknown(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityMention(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityMention(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityHashtag(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityHashtag(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityBotCommand(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityBotCommand(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityUrl(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityUrl(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityEmail(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityEmail(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityBold(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityBold(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityItalic(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityItalic(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityCode(MTPint _offset, MTPint _length) { + return MTPmessageEntity(new MTPDmessageEntityCode(_offset, _length)); + } + inline static MTPmessageEntity new_messageEntityPre(MTPint _offset, MTPint _length, const MTPstring &_language) { + return MTPmessageEntity(new MTPDmessageEntityPre(_offset, _length, _language)); + } + inline static MTPmessageEntity new_messageEntityTextUrl(MTPint _offset, MTPint _length, const MTPstring &_url) { + return MTPmessageEntity(new MTPDmessageEntityTextUrl(_offset, _length, _url)); + } + inline static MTPinputChannel new_inputChannelEmpty() { + return MTPinputChannel(mtpc_inputChannelEmpty); + } + inline static MTPinputChannel new_inputChannel(MTPint _channel_id, const MTPlong &_access_hash) { + return MTPinputChannel(new MTPDinputChannel(_channel_id, _access_hash)); + } + inline static MTPcontacts_resolvedPeer new_contacts_resolvedPeer(const MTPPeer &_peer, const MTPVector &_chats, const MTPVector &_users) { + return MTPcontacts_resolvedPeer(new MTPDcontacts_resolvedPeer(_peer, _chats, _users)); + } + inline static MTPmessageRange new_messageRange(MTPint _min_id, MTPint _max_id) { + return MTPmessageRange(new MTPDmessageRange(_min_id, _max_id)); + } + inline static MTPmessageGroup new_messageGroup(MTPint _min_id, MTPint _max_id, MTPint _count, MTPint _date) { + return MTPmessageGroup(new MTPDmessageGroup(_min_id, _max_id, _count, _date)); + } + inline static MTPupdates_channelDifference new_updates_channelDifferenceEmpty(const MTPflags &_flags, MTPint _pts, MTPint _timeout) { + return MTPupdates_channelDifference(new MTPDupdates_channelDifferenceEmpty(_flags, _pts, _timeout)); + } + inline static MTPupdates_channelDifference new_updates_channelDifferenceTooLong(const MTPflags &_flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTPupdates_channelDifference(new MTPDupdates_channelDifferenceTooLong(_flags, _pts, _timeout, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _messages, _chats, _users)); + } + inline static MTPupdates_channelDifference new_updates_channelDifference(const MTPflags &_flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users) { + return MTPupdates_channelDifference(new MTPDupdates_channelDifference(_flags, _pts, _timeout, _new_messages, _other_updates, _chats, _users)); + } + inline static MTPchannelMessagesFilter new_channelMessagesFilterEmpty() { + return MTPchannelMessagesFilter(mtpc_channelMessagesFilterEmpty); + } + inline static MTPchannelMessagesFilter new_channelMessagesFilter(const MTPflags &_flags, const MTPVector &_ranges) { + return MTPchannelMessagesFilter(new MTPDchannelMessagesFilter(_flags, _ranges)); + } + inline static MTPchannelMessagesFilter new_channelMessagesFilterCollapsed() { + return MTPchannelMessagesFilter(mtpc_channelMessagesFilterCollapsed); + } + inline static MTPchannelParticipant new_channelParticipant(MTPint _user_id, MTPint _date) { + return MTPchannelParticipant(new MTPDchannelParticipant(_user_id, _date)); + } + inline static MTPchannelParticipant new_channelParticipantSelf(MTPint _user_id, MTPint _inviter_id, MTPint _date) { + return MTPchannelParticipant(new MTPDchannelParticipantSelf(_user_id, _inviter_id, _date)); + } + inline static MTPchannelParticipant new_channelParticipantModerator(MTPint _user_id, MTPint _inviter_id, MTPint _date) { + return MTPchannelParticipant(new MTPDchannelParticipantModerator(_user_id, _inviter_id, _date)); + } + inline static MTPchannelParticipant new_channelParticipantEditor(MTPint _user_id, MTPint _inviter_id, MTPint _date) { + return MTPchannelParticipant(new MTPDchannelParticipantEditor(_user_id, _inviter_id, _date)); + } + inline static MTPchannelParticipant new_channelParticipantKicked(MTPint _user_id, MTPint _kicked_by, MTPint _date) { + return MTPchannelParticipant(new MTPDchannelParticipantKicked(_user_id, _kicked_by, _date)); + } + inline static MTPchannelParticipant new_channelParticipantCreator(MTPint _user_id) { + return MTPchannelParticipant(new MTPDchannelParticipantCreator(_user_id)); + } + inline static MTPchannelParticipantsFilter new_channelParticipantsRecent() { + return MTPchannelParticipantsFilter(mtpc_channelParticipantsRecent); + } + inline static MTPchannelParticipantsFilter new_channelParticipantsAdmins() { + return MTPchannelParticipantsFilter(mtpc_channelParticipantsAdmins); + } + inline static MTPchannelParticipantsFilter new_channelParticipantsKicked() { + return MTPchannelParticipantsFilter(mtpc_channelParticipantsKicked); + } + inline static MTPchannelParticipantsFilter new_channelParticipantsBots() { + return MTPchannelParticipantsFilter(mtpc_channelParticipantsBots); + } + inline static MTPchannelParticipantRole new_channelRoleEmpty() { + return MTPchannelParticipantRole(mtpc_channelRoleEmpty); + } + inline static MTPchannelParticipantRole new_channelRoleModerator() { + return MTPchannelParticipantRole(mtpc_channelRoleModerator); + } + inline static MTPchannelParticipantRole new_channelRoleEditor() { + return MTPchannelParticipantRole(mtpc_channelRoleEditor); + } + inline static MTPchannels_channelParticipants new_channels_channelParticipants(MTPint _count, const MTPVector &_participants, const MTPVector &_users) { + return MTPchannels_channelParticipants(new MTPDchannels_channelParticipants(_count, _participants, _users)); + } + inline static MTPchannels_channelParticipant new_channels_channelParticipant(const MTPChannelParticipant &_participant, const MTPVector &_users) { + return MTPchannels_channelParticipant(new MTPDchannels_channelParticipant(_participant, _users)); + } + inline static MTPhelp_termsOfService new_help_termsOfService(const MTPstring &_text) { + return MTPhelp_termsOfService(new MTPDhelp_termsOfService(_text)); + } + inline static MTPfoundGif new_foundGif(const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h) { + return MTPfoundGif(new MTPDfoundGif(_url, _thumb_url, _content_url, _content_type, _w, _h)); + } + inline static MTPfoundGif new_foundGifCached(const MTPstring &_url, const MTPPhoto &_photo, const MTPDocument &_document) { + return MTPfoundGif(new MTPDfoundGifCached(_url, _photo, _document)); + } + inline static MTPmessages_foundGifs new_messages_foundGifs(MTPint _next_offset, const MTPVector &_results) { + return MTPmessages_foundGifs(new MTPDmessages_foundGifs(_next_offset, _results)); + } + inline static MTPmessages_savedGifs new_messages_savedGifsNotModified() { + return MTPmessages_savedGifs(mtpc_messages_savedGifsNotModified); + } + inline static MTPmessages_savedGifs new_messages_savedGifs(MTPint _hash, const MTPVector &_gifs) { + return MTPmessages_savedGifs(new MTPDmessages_savedGifs(_hash, _gifs)); + } + inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaAuto(const MTPstring &_caption) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaAuto(_caption)); + } + inline static MTPinputBotInlineMessage new_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageText(_flags, _message, _entities)); + } + inline static MTPinputBotInlineResult new_inputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { + return MTPinputBotInlineResult(new MTPDinputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); + } + inline static MTPbotInlineMessage new_botInlineMessageMediaAuto(const MTPstring &_caption) { + return MTPbotInlineMessage(new MTPDbotInlineMessageMediaAuto(_caption)); + } + inline static MTPbotInlineMessage new_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { + return MTPbotInlineMessage(new MTPDbotInlineMessageText(_flags, _message, _entities)); + } + inline static MTPbotInlineResult new_botInlineMediaResultDocument(const MTPstring &_id, const MTPstring &_type, const MTPDocument &_document, const MTPBotInlineMessage &_send_message) { + return MTPbotInlineResult(new MTPDbotInlineMediaResultDocument(_id, _type, _document, _send_message)); + } + inline static MTPbotInlineResult new_botInlineMediaResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPPhoto &_photo, const MTPBotInlineMessage &_send_message) { + return MTPbotInlineResult(new MTPDbotInlineMediaResultPhoto(_id, _type, _photo, _send_message)); + } + inline static MTPbotInlineResult new_botInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) { + return MTPbotInlineResult(new MTPDbotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); + } + inline static MTPmessages_botResults new_messages_botResults(const MTPflags &_flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results) { + return MTPmessages_botResults(new MTPDmessages_botResults(_flags, _query_id, _next_offset, _results)); + } + inline static MTPexportedMessageLink new_exportedMessageLink(const MTPstring &_link) { + return MTPexportedMessageLink(new MTPDexportedMessageLink(_link)); + } + inline static MTPmessageFwdHeader new_messageFwdHeader(const MTPflags &_flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post) { + return MTPmessageFwdHeader(new MTPDmessageFwdHeader(_flags, _from_id, _date, _channel_id, _channel_post)); + } + inline static MTPchannels_messageEditData new_channels_messageEditData(const MTPflags &_flags) { + return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags)); + } + inline static MTPauth_codeType new_auth_codeTypeSms() { + return MTPauth_codeType(mtpc_auth_codeTypeSms); + } + inline static MTPauth_codeType new_auth_codeTypeCall() { + return MTPauth_codeType(mtpc_auth_codeTypeCall); + } + inline static MTPauth_codeType new_auth_codeTypeFlashCall() { + return MTPauth_codeType(mtpc_auth_codeTypeFlashCall); + } + inline static MTPauth_sentCodeType new_auth_sentCodeTypeApp(MTPint _length) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeApp(_length)); + } + inline static MTPauth_sentCodeType new_auth_sentCodeTypeSms(MTPint _length) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeSms(_length)); + } + inline static MTPauth_sentCodeType new_auth_sentCodeTypeCall(MTPint _length) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeCall(_length)); + } + inline static MTPauth_sentCodeType new_auth_sentCodeTypeFlashCall(const MTPstring &_pattern) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeFlashCall(_pattern)); + } + }; +} +} + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -20951,7 +22429,7 @@ inline void MTPresPQ::write(mtpBuffer &to) const { inline MTPresPQ::MTPresPQ(MTPDresPQ *_data) : mtpDataOwner(_data) { } inline MTPresPQ MTP_resPQ(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_pq, const MTPVector &_server_public_key_fingerprints) { - return MTPresPQ(new MTPDresPQ(_nonce, _server_nonce, _pq, _server_public_key_fingerprints)); + return MTP::internal::TypeCreator::new_resPQ(_nonce, _server_nonce, _pq, _server_public_key_fingerprints); } inline MTPp_Q_inner_data::MTPp_Q_inner_data() : mtpDataOwner(new MTPDp_q_inner_data()) { @@ -20988,7 +22466,7 @@ inline void MTPp_Q_inner_data::write(mtpBuffer &to) const { inline MTPp_Q_inner_data::MTPp_Q_inner_data(MTPDp_q_inner_data *_data) : mtpDataOwner(_data) { } inline MTPp_Q_inner_data MTP_p_q_inner_data(const MTPstring &_pq, const MTPstring &_p, const MTPstring &_q, const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint256 &_new_nonce) { - return MTPp_Q_inner_data(new MTPDp_q_inner_data(_pq, _p, _q, _nonce, _server_nonce, _new_nonce)); + return MTP::internal::TypeCreator::new_p_q_inner_data(_pq, _p, _q, _nonce, _server_nonce, _new_nonce); } inline uint32 MTPserver_DH_Params::innerLength() const { @@ -21056,10 +22534,10 @@ inline MTPserver_DH_Params::MTPserver_DH_Params(MTPDserver_DH_params_fail *_data inline MTPserver_DH_Params::MTPserver_DH_Params(MTPDserver_DH_params_ok *_data) : mtpDataOwner(_data), _type(mtpc_server_DH_params_ok) { } inline MTPserver_DH_Params MTP_server_DH_params_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash) { - return MTPserver_DH_Params(new MTPDserver_DH_params_fail(_nonce, _server_nonce, _new_nonce_hash)); + return MTP::internal::TypeCreator::new_server_DH_params_fail(_nonce, _server_nonce, _new_nonce_hash); } inline MTPserver_DH_Params MTP_server_DH_params_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPstring &_encrypted_answer) { - return MTPserver_DH_Params(new MTPDserver_DH_params_ok(_nonce, _server_nonce, _encrypted_answer)); + return MTP::internal::TypeCreator::new_server_DH_params_ok(_nonce, _server_nonce, _encrypted_answer); } inline MTPserver_DH_inner_data::MTPserver_DH_inner_data() : mtpDataOwner(new MTPDserver_DH_inner_data()) { @@ -21096,7 +22574,7 @@ inline void MTPserver_DH_inner_data::write(mtpBuffer &to) const { inline MTPserver_DH_inner_data::MTPserver_DH_inner_data(MTPDserver_DH_inner_data *_data) : mtpDataOwner(_data) { } inline MTPserver_DH_inner_data MTP_server_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, MTPint _g, const MTPstring &_dh_prime, const MTPstring &_g_a, MTPint _server_time) { - return MTPserver_DH_inner_data(new MTPDserver_DH_inner_data(_nonce, _server_nonce, _g, _dh_prime, _g_a, _server_time)); + return MTP::internal::TypeCreator::new_server_DH_inner_data(_nonce, _server_nonce, _g, _dh_prime, _g_a, _server_time); } inline MTPclient_DH_Inner_Data::MTPclient_DH_Inner_Data() : mtpDataOwner(new MTPDclient_DH_inner_data()) { @@ -21129,7 +22607,7 @@ inline void MTPclient_DH_Inner_Data::write(mtpBuffer &to) const { inline MTPclient_DH_Inner_Data::MTPclient_DH_Inner_Data(MTPDclient_DH_inner_data *_data) : mtpDataOwner(_data) { } inline MTPclient_DH_Inner_Data MTP_client_DH_inner_data(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPlong &_retry_id, const MTPstring &_g_b) { - return MTPclient_DH_Inner_Data(new MTPDclient_DH_inner_data(_nonce, _server_nonce, _retry_id, _g_b)); + return MTP::internal::TypeCreator::new_client_DH_inner_data(_nonce, _server_nonce, _retry_id, _g_b); } inline uint32 MTPset_client_DH_params_answer::innerLength() const { @@ -21217,13 +22695,13 @@ inline MTPset_client_DH_params_answer::MTPset_client_DH_params_answer(MTPDdh_gen inline MTPset_client_DH_params_answer::MTPset_client_DH_params_answer(MTPDdh_gen_fail *_data) : mtpDataOwner(_data), _type(mtpc_dh_gen_fail) { } inline MTPset_client_DH_params_answer MTP_dh_gen_ok(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash1) { - return MTPset_client_DH_params_answer(new MTPDdh_gen_ok(_nonce, _server_nonce, _new_nonce_hash1)); + return MTP::internal::TypeCreator::new_dh_gen_ok(_nonce, _server_nonce, _new_nonce_hash1); } inline MTPset_client_DH_params_answer MTP_dh_gen_retry(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash2) { - return MTPset_client_DH_params_answer(new MTPDdh_gen_retry(_nonce, _server_nonce, _new_nonce_hash2)); + return MTP::internal::TypeCreator::new_dh_gen_retry(_nonce, _server_nonce, _new_nonce_hash2); } inline MTPset_client_DH_params_answer MTP_dh_gen_fail(const MTPint128 &_nonce, const MTPint128 &_server_nonce, const MTPint128 &_new_nonce_hash3) { - return MTPset_client_DH_params_answer(new MTPDdh_gen_fail(_nonce, _server_nonce, _new_nonce_hash3)); + return MTP::internal::TypeCreator::new_dh_gen_fail(_nonce, _server_nonce, _new_nonce_hash3); } inline MTPmsgsAck::MTPmsgsAck() : mtpDataOwner(new MTPDmsgs_ack()) { @@ -21250,7 +22728,7 @@ inline void MTPmsgsAck::write(mtpBuffer &to) const { inline MTPmsgsAck::MTPmsgsAck(MTPDmsgs_ack *_data) : mtpDataOwner(_data) { } inline MTPmsgsAck MTP_msgs_ack(const MTPVector &_msg_ids) { - return MTPmsgsAck(new MTPDmsgs_ack(_msg_ids)); + return MTP::internal::TypeCreator::new_msgs_ack(_msg_ids); } inline uint32 MTPbadMsgNotification::innerLength() const { @@ -21320,10 +22798,10 @@ inline MTPbadMsgNotification::MTPbadMsgNotification(MTPDbad_msg_notification *_d inline MTPbadMsgNotification::MTPbadMsgNotification(MTPDbad_server_salt *_data) : mtpDataOwner(_data), _type(mtpc_bad_server_salt) { } inline MTPbadMsgNotification MTP_bad_msg_notification(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code) { - return MTPbadMsgNotification(new MTPDbad_msg_notification(_bad_msg_id, _bad_msg_seqno, _error_code)); + return MTP::internal::TypeCreator::new_bad_msg_notification(_bad_msg_id, _bad_msg_seqno, _error_code); } inline MTPbadMsgNotification MTP_bad_server_salt(const MTPlong &_bad_msg_id, MTPint _bad_msg_seqno, MTPint _error_code, const MTPlong &_new_server_salt) { - return MTPbadMsgNotification(new MTPDbad_server_salt(_bad_msg_id, _bad_msg_seqno, _error_code, _new_server_salt)); + return MTP::internal::TypeCreator::new_bad_server_salt(_bad_msg_id, _bad_msg_seqno, _error_code, _new_server_salt); } inline MTPmsgsStateReq::MTPmsgsStateReq() : mtpDataOwner(new MTPDmsgs_state_req()) { @@ -21350,7 +22828,7 @@ inline void MTPmsgsStateReq::write(mtpBuffer &to) const { inline MTPmsgsStateReq::MTPmsgsStateReq(MTPDmsgs_state_req *_data) : mtpDataOwner(_data) { } inline MTPmsgsStateReq MTP_msgs_state_req(const MTPVector &_msg_ids) { - return MTPmsgsStateReq(new MTPDmsgs_state_req(_msg_ids)); + return MTP::internal::TypeCreator::new_msgs_state_req(_msg_ids); } inline MTPmsgsStateInfo::MTPmsgsStateInfo() : mtpDataOwner(new MTPDmsgs_state_info()) { @@ -21379,7 +22857,7 @@ inline void MTPmsgsStateInfo::write(mtpBuffer &to) const { inline MTPmsgsStateInfo::MTPmsgsStateInfo(MTPDmsgs_state_info *_data) : mtpDataOwner(_data) { } inline MTPmsgsStateInfo MTP_msgs_state_info(const MTPlong &_req_msg_id, const MTPstring &_info) { - return MTPmsgsStateInfo(new MTPDmsgs_state_info(_req_msg_id, _info)); + return MTP::internal::TypeCreator::new_msgs_state_info(_req_msg_id, _info); } inline MTPmsgsAllInfo::MTPmsgsAllInfo() : mtpDataOwner(new MTPDmsgs_all_info()) { @@ -21408,7 +22886,7 @@ inline void MTPmsgsAllInfo::write(mtpBuffer &to) const { inline MTPmsgsAllInfo::MTPmsgsAllInfo(MTPDmsgs_all_info *_data) : mtpDataOwner(_data) { } inline MTPmsgsAllInfo MTP_msgs_all_info(const MTPVector &_msg_ids, const MTPstring &_info) { - return MTPmsgsAllInfo(new MTPDmsgs_all_info(_msg_ids, _info)); + return MTP::internal::TypeCreator::new_msgs_all_info(_msg_ids, _info); } inline uint32 MTPmsgDetailedInfo::innerLength() const { @@ -21478,10 +22956,10 @@ inline MTPmsgDetailedInfo::MTPmsgDetailedInfo(MTPDmsg_detailed_info *_data) : mt inline MTPmsgDetailedInfo::MTPmsgDetailedInfo(MTPDmsg_new_detailed_info *_data) : mtpDataOwner(_data), _type(mtpc_msg_new_detailed_info) { } inline MTPmsgDetailedInfo MTP_msg_detailed_info(const MTPlong &_msg_id, const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status) { - return MTPmsgDetailedInfo(new MTPDmsg_detailed_info(_msg_id, _answer_msg_id, _bytes, _status)); + return MTP::internal::TypeCreator::new_msg_detailed_info(_msg_id, _answer_msg_id, _bytes, _status); } inline MTPmsgDetailedInfo MTP_msg_new_detailed_info(const MTPlong &_answer_msg_id, MTPint _bytes, MTPint _status) { - return MTPmsgDetailedInfo(new MTPDmsg_new_detailed_info(_answer_msg_id, _bytes, _status)); + return MTP::internal::TypeCreator::new_msg_new_detailed_info(_answer_msg_id, _bytes, _status); } inline MTPmsgResendReq::MTPmsgResendReq() : mtpDataOwner(new MTPDmsg_resend_req()) { @@ -21508,7 +22986,7 @@ inline void MTPmsgResendReq::write(mtpBuffer &to) const { inline MTPmsgResendReq::MTPmsgResendReq(MTPDmsg_resend_req *_data) : mtpDataOwner(_data) { } inline MTPmsgResendReq MTP_msg_resend_req(const MTPVector &_msg_ids) { - return MTPmsgResendReq(new MTPDmsg_resend_req(_msg_ids)); + return MTP::internal::TypeCreator::new_msg_resend_req(_msg_ids); } inline MTPrpcError::MTPrpcError() : mtpDataOwner(new MTPDrpc_error()) { @@ -21537,7 +23015,7 @@ inline void MTPrpcError::write(mtpBuffer &to) const { inline MTPrpcError::MTPrpcError(MTPDrpc_error *_data) : mtpDataOwner(_data) { } inline MTPrpcError MTP_rpc_error(MTPint _error_code, const MTPstring &_error_message) { - return MTPrpcError(new MTPDrpc_error(_error_code, _error_message)); + return MTP::internal::TypeCreator::new_rpc_error(_error_code, _error_message); } inline uint32 MTPrpcDropAnswer::innerLength() const { @@ -21589,13 +23067,13 @@ inline MTPrpcDropAnswer::MTPrpcDropAnswer(mtpTypeId type) : mtpDataOwner(0), _ty inline MTPrpcDropAnswer::MTPrpcDropAnswer(MTPDrpc_answer_dropped *_data) : mtpDataOwner(_data), _type(mtpc_rpc_answer_dropped) { } inline MTPrpcDropAnswer MTP_rpc_answer_unknown() { - return MTPrpcDropAnswer(mtpc_rpc_answer_unknown); + return MTP::internal::TypeCreator::new_rpc_answer_unknown(); } inline MTPrpcDropAnswer MTP_rpc_answer_dropped_running() { - return MTPrpcDropAnswer(mtpc_rpc_answer_dropped_running); + return MTP::internal::TypeCreator::new_rpc_answer_dropped_running(); } inline MTPrpcDropAnswer MTP_rpc_answer_dropped(const MTPlong &_msg_id, MTPint _seq_no, MTPint _bytes) { - return MTPrpcDropAnswer(new MTPDrpc_answer_dropped(_msg_id, _seq_no, _bytes)); + return MTP::internal::TypeCreator::new_rpc_answer_dropped(_msg_id, _seq_no, _bytes); } inline MTPfutureSalt::MTPfutureSalt() : mtpDataOwner(new MTPDfuture_salt()) { @@ -21626,7 +23104,7 @@ inline void MTPfutureSalt::write(mtpBuffer &to) const { inline MTPfutureSalt::MTPfutureSalt(MTPDfuture_salt *_data) : mtpDataOwner(_data) { } inline MTPfutureSalt MTP_future_salt(MTPint _valid_since, MTPint _valid_until, const MTPlong &_salt) { - return MTPfutureSalt(new MTPDfuture_salt(_valid_since, _valid_until, _salt)); + return MTP::internal::TypeCreator::new_future_salt(_valid_since, _valid_until, _salt); } inline MTPfutureSalts::MTPfutureSalts() : mtpDataOwner(new MTPDfuture_salts()) { @@ -21657,7 +23135,7 @@ inline void MTPfutureSalts::write(mtpBuffer &to) const { inline MTPfutureSalts::MTPfutureSalts(MTPDfuture_salts *_data) : mtpDataOwner(_data) { } inline MTPfutureSalts MTP_future_salts(const MTPlong &_req_msg_id, MTPint _now, const MTPvector &_salts) { - return MTPfutureSalts(new MTPDfuture_salts(_req_msg_id, _now, _salts)); + return MTP::internal::TypeCreator::new_future_salts(_req_msg_id, _now, _salts); } inline MTPpong::MTPpong() : mtpDataOwner(new MTPDpong()) { @@ -21686,7 +23164,7 @@ inline void MTPpong::write(mtpBuffer &to) const { inline MTPpong::MTPpong(MTPDpong *_data) : mtpDataOwner(_data) { } inline MTPpong MTP_pong(const MTPlong &_msg_id, const MTPlong &_ping_id) { - return MTPpong(new MTPDpong(_msg_id, _ping_id)); + return MTP::internal::TypeCreator::new_pong(_msg_id, _ping_id); } inline uint32 MTPdestroySessionRes::innerLength() const { @@ -21746,10 +23224,10 @@ inline MTPdestroySessionRes::MTPdestroySessionRes(MTPDdestroy_session_ok *_data) inline MTPdestroySessionRes::MTPdestroySessionRes(MTPDdestroy_session_none *_data) : mtpDataOwner(_data), _type(mtpc_destroy_session_none) { } inline MTPdestroySessionRes MTP_destroy_session_ok(const MTPlong &_session_id) { - return MTPdestroySessionRes(new MTPDdestroy_session_ok(_session_id)); + return MTP::internal::TypeCreator::new_destroy_session_ok(_session_id); } inline MTPdestroySessionRes MTP_destroy_session_none(const MTPlong &_session_id) { - return MTPdestroySessionRes(new MTPDdestroy_session_none(_session_id)); + return MTP::internal::TypeCreator::new_destroy_session_none(_session_id); } inline MTPnewSession::MTPnewSession() : mtpDataOwner(new MTPDnew_session_created()) { @@ -21780,7 +23258,7 @@ inline void MTPnewSession::write(mtpBuffer &to) const { inline MTPnewSession::MTPnewSession(MTPDnew_session_created *_data) : mtpDataOwner(_data) { } inline MTPnewSession MTP_new_session_created(const MTPlong &_first_msg_id, const MTPlong &_unique_id, const MTPlong &_server_salt) { - return MTPnewSession(new MTPDnew_session_created(_first_msg_id, _unique_id, _server_salt)); + return MTP::internal::TypeCreator::new_new_session_created(_first_msg_id, _unique_id, _server_salt); } inline MTPhttpWait::MTPhttpWait() : mtpDataOwner(new MTPDhttp_wait()) { @@ -21811,7 +23289,7 @@ inline void MTPhttpWait::write(mtpBuffer &to) const { inline MTPhttpWait::MTPhttpWait(MTPDhttp_wait *_data) : mtpDataOwner(_data) { } inline MTPhttpWait MTP_http_wait(MTPint _max_delay, MTPint _wait_after, MTPint _max_wait) { - return MTPhttpWait(new MTPDhttp_wait(_max_delay, _wait_after, _max_wait)); + return MTP::internal::TypeCreator::new_http_wait(_max_delay, _wait_after, _max_wait); } inline uint32 MTPbool::innerLength() const { @@ -21840,10 +23318,10 @@ inline MTPbool::MTPbool(mtpTypeId type) : _type(type) { } } inline MTPbool MTP_boolFalse() { - return MTPbool(mtpc_boolFalse); + return MTP::internal::TypeCreator::new_boolFalse(); } inline MTPbool MTP_boolTrue() { - return MTPbool(mtpc_boolTrue); + return MTP::internal::TypeCreator::new_boolTrue(); } inline uint32 MTPtrue::innerLength() const { @@ -21857,7 +23335,7 @@ inline void MTPtrue::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId inline void MTPtrue::write(mtpBuffer &to) const { } inline MTPtrue MTP_true() { - return MTPtrue(); + return MTP::internal::TypeCreator::new_true(); } inline MTPerror::MTPerror() : mtpDataOwner(new MTPDerror()) { @@ -21886,7 +23364,7 @@ inline void MTPerror::write(mtpBuffer &to) const { inline MTPerror::MTPerror(MTPDerror *_data) : mtpDataOwner(_data) { } inline MTPerror MTP_error(MTPint _code, const MTPstring &_text) { - return MTPerror(new MTPDerror(_code, _text)); + return MTP::internal::TypeCreator::new_error(_code, _text); } inline uint32 MTPnull::innerLength() const { @@ -21900,7 +23378,7 @@ inline void MTPnull::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId inline void MTPnull::write(mtpBuffer &to) const { } inline MTPnull MTP_null() { - return MTPnull(); + return MTP::internal::TypeCreator::new_null(); } inline uint32 MTPinputPeer::innerLength() const { @@ -21984,19 +23462,19 @@ inline MTPinputPeer::MTPinputPeer(MTPDinputPeerUser *_data) : mtpDataOwner(_data inline MTPinputPeer::MTPinputPeer(MTPDinputPeerChannel *_data) : mtpDataOwner(_data), _type(mtpc_inputPeerChannel) { } inline MTPinputPeer MTP_inputPeerEmpty() { - return MTPinputPeer(mtpc_inputPeerEmpty); + return MTP::internal::TypeCreator::new_inputPeerEmpty(); } inline MTPinputPeer MTP_inputPeerSelf() { - return MTPinputPeer(mtpc_inputPeerSelf); + return MTP::internal::TypeCreator::new_inputPeerSelf(); } inline MTPinputPeer MTP_inputPeerChat(MTPint _chat_id) { - return MTPinputPeer(new MTPDinputPeerChat(_chat_id)); + return MTP::internal::TypeCreator::new_inputPeerChat(_chat_id); } inline MTPinputPeer MTP_inputPeerUser(MTPint _user_id, const MTPlong &_access_hash) { - return MTPinputPeer(new MTPDinputPeerUser(_user_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputPeerUser(_user_id, _access_hash); } inline MTPinputPeer MTP_inputPeerChannel(MTPint _channel_id, const MTPlong &_access_hash) { - return MTPinputPeer(new MTPDinputPeerChannel(_channel_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputPeerChannel(_channel_id, _access_hash); } inline uint32 MTPinputUser::innerLength() const { @@ -22046,13 +23524,13 @@ inline MTPinputUser::MTPinputUser(mtpTypeId type) : mtpDataOwner(0), _type(type) inline MTPinputUser::MTPinputUser(MTPDinputUser *_data) : mtpDataOwner(_data), _type(mtpc_inputUser) { } inline MTPinputUser MTP_inputUserEmpty() { - return MTPinputUser(mtpc_inputUserEmpty); + return MTP::internal::TypeCreator::new_inputUserEmpty(); } inline MTPinputUser MTP_inputUserSelf() { - return MTPinputUser(mtpc_inputUserSelf); + return MTP::internal::TypeCreator::new_inputUserSelf(); } inline MTPinputUser MTP_inputUser(MTPint _user_id, const MTPlong &_access_hash) { - return MTPinputUser(new MTPDinputUser(_user_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputUser(_user_id, _access_hash); } inline MTPinputContact::MTPinputContact() : mtpDataOwner(new MTPDinputPhoneContact()) { @@ -22085,7 +23563,7 @@ inline void MTPinputContact::write(mtpBuffer &to) const { inline MTPinputContact::MTPinputContact(MTPDinputPhoneContact *_data) : mtpDataOwner(_data) { } inline MTPinputContact MTP_inputPhoneContact(const MTPlong &_client_id, const MTPstring &_phone, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTPinputContact(new MTPDinputPhoneContact(_client_id, _phone, _first_name, _last_name)); + return MTP::internal::TypeCreator::new_inputPhoneContact(_client_id, _phone, _first_name, _last_name); } inline uint32 MTPinputFile::innerLength() const { @@ -22155,10 +23633,10 @@ inline MTPinputFile::MTPinputFile(MTPDinputFile *_data) : mtpDataOwner(_data), _ inline MTPinputFile::MTPinputFile(MTPDinputFileBig *_data) : mtpDataOwner(_data), _type(mtpc_inputFileBig) { } inline MTPinputFile MTP_inputFile(const MTPlong &_id, MTPint _parts, const MTPstring &_name, const MTPstring &_md5_checksum) { - return MTPinputFile(new MTPDinputFile(_id, _parts, _name, _md5_checksum)); + return MTP::internal::TypeCreator::new_inputFile(_id, _parts, _name, _md5_checksum); } inline MTPinputFile MTP_inputFileBig(const MTPlong &_id, MTPint _parts, const MTPstring &_name) { - return MTPinputFile(new MTPDinputFileBig(_id, _parts, _name)); + return MTP::internal::TypeCreator::new_inputFileBig(_id, _parts, _name); } inline uint32 MTPinputMedia::innerLength() const { @@ -22366,34 +23844,34 @@ inline MTPinputMedia::MTPinputMedia(MTPDinputMediaVenue *_data) : mtpDataOwner(_ inline MTPinputMedia::MTPinputMedia(MTPDinputMediaGifExternal *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaGifExternal) { } inline MTPinputMedia MTP_inputMediaEmpty() { - return MTPinputMedia(mtpc_inputMediaEmpty); + return MTP::internal::TypeCreator::new_inputMediaEmpty(); } inline MTPinputMedia MTP_inputMediaUploadedPhoto(const MTPInputFile &_file, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedPhoto(_file, _caption)); + return MTP::internal::TypeCreator::new_inputMediaUploadedPhoto(_file, _caption); } inline MTPinputMedia MTP_inputMediaPhoto(const MTPInputPhoto &_id, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaPhoto(_id, _caption)); + return MTP::internal::TypeCreator::new_inputMediaPhoto(_id, _caption); } inline MTPinputMedia MTP_inputMediaGeoPoint(const MTPInputGeoPoint &_geo_point) { - return MTPinputMedia(new MTPDinputMediaGeoPoint(_geo_point)); + return MTP::internal::TypeCreator::new_inputMediaGeoPoint(_geo_point); } inline MTPinputMedia MTP_inputMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { - return MTPinputMedia(new MTPDinputMediaContact(_phone_number, _first_name, _last_name)); + return MTP::internal::TypeCreator::new_inputMediaContact(_phone_number, _first_name, _last_name); } inline MTPinputMedia MTP_inputMediaUploadedDocument(const MTPInputFile &_file, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedDocument(_file, _mime_type, _attributes, _caption)); + return MTP::internal::TypeCreator::new_inputMediaUploadedDocument(_file, _mime_type, _attributes, _caption); } inline MTPinputMedia MTP_inputMediaUploadedThumbDocument(const MTPInputFile &_file, const MTPInputFile &_thumb, const MTPstring &_mime_type, const MTPVector &_attributes, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedThumbDocument(_file, _thumb, _mime_type, _attributes, _caption)); + return MTP::internal::TypeCreator::new_inputMediaUploadedThumbDocument(_file, _thumb, _mime_type, _attributes, _caption); } inline MTPinputMedia MTP_inputMediaDocument(const MTPInputDocument &_id, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaDocument(_id, _caption)); + return MTP::internal::TypeCreator::new_inputMediaDocument(_id, _caption); } inline MTPinputMedia MTP_inputMediaVenue(const MTPInputGeoPoint &_geo_point, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTPinputMedia(new MTPDinputMediaVenue(_geo_point, _title, _address, _provider, _venue_id)); + return MTP::internal::TypeCreator::new_inputMediaVenue(_geo_point, _title, _address, _provider, _venue_id); } inline MTPinputMedia MTP_inputMediaGifExternal(const MTPstring &_url, const MTPstring &_q) { - return MTPinputMedia(new MTPDinputMediaGifExternal(_url, _q)); + return MTP::internal::TypeCreator::new_inputMediaGifExternal(_url, _q); } inline uint32 MTPinputChatPhoto::innerLength() const { @@ -22459,13 +23937,13 @@ inline MTPinputChatPhoto::MTPinputChatPhoto(MTPDinputChatUploadedPhoto *_data) : inline MTPinputChatPhoto::MTPinputChatPhoto(MTPDinputChatPhoto *_data) : mtpDataOwner(_data), _type(mtpc_inputChatPhoto) { } inline MTPinputChatPhoto MTP_inputChatPhotoEmpty() { - return MTPinputChatPhoto(mtpc_inputChatPhotoEmpty); + return MTP::internal::TypeCreator::new_inputChatPhotoEmpty(); } inline MTPinputChatPhoto MTP_inputChatUploadedPhoto(const MTPInputFile &_file, const MTPInputPhotoCrop &_crop) { - return MTPinputChatPhoto(new MTPDinputChatUploadedPhoto(_file, _crop)); + return MTP::internal::TypeCreator::new_inputChatUploadedPhoto(_file, _crop); } inline MTPinputChatPhoto MTP_inputChatPhoto(const MTPInputPhoto &_id, const MTPInputPhotoCrop &_crop) { - return MTPinputChatPhoto(new MTPDinputChatPhoto(_id, _crop)); + return MTP::internal::TypeCreator::new_inputChatPhoto(_id, _crop); } inline uint32 MTPinputGeoPoint::innerLength() const { @@ -22513,10 +23991,10 @@ inline MTPinputGeoPoint::MTPinputGeoPoint(mtpTypeId type) : mtpDataOwner(0), _ty inline MTPinputGeoPoint::MTPinputGeoPoint(MTPDinputGeoPoint *_data) : mtpDataOwner(_data), _type(mtpc_inputGeoPoint) { } inline MTPinputGeoPoint MTP_inputGeoPointEmpty() { - return MTPinputGeoPoint(mtpc_inputGeoPointEmpty); + return MTP::internal::TypeCreator::new_inputGeoPointEmpty(); } inline MTPinputGeoPoint MTP_inputGeoPoint(const MTPdouble &_lat, const MTPdouble &_long) { - return MTPinputGeoPoint(new MTPDinputGeoPoint(_lat, _long)); + return MTP::internal::TypeCreator::new_inputGeoPoint(_lat, _long); } inline uint32 MTPinputPhoto::innerLength() const { @@ -22564,10 +24042,10 @@ inline MTPinputPhoto::MTPinputPhoto(mtpTypeId type) : mtpDataOwner(0), _type(typ inline MTPinputPhoto::MTPinputPhoto(MTPDinputPhoto *_data) : mtpDataOwner(_data), _type(mtpc_inputPhoto) { } inline MTPinputPhoto MTP_inputPhotoEmpty() { - return MTPinputPhoto(mtpc_inputPhotoEmpty); + return MTP::internal::TypeCreator::new_inputPhotoEmpty(); } inline MTPinputPhoto MTP_inputPhoto(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputPhoto(new MTPDinputPhoto(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputPhoto(_id, _access_hash); } inline uint32 MTPinputFileLocation::innerLength() const { @@ -22651,13 +24129,13 @@ inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputEncryptedFileLocation inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputDocumentFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputDocumentFileLocation) { } inline MTPinputFileLocation MTP_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { - return MTPinputFileLocation(new MTPDinputFileLocation(_volume_id, _local_id, _secret)); + return MTP::internal::TypeCreator::new_inputFileLocation(_volume_id, _local_id, _secret); } inline MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputFileLocation(new MTPDinputEncryptedFileLocation(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputEncryptedFileLocation(_id, _access_hash); } inline MTPinputFileLocation MTP_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputFileLocation(new MTPDinputDocumentFileLocation(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputDocumentFileLocation(_id, _access_hash); } inline uint32 MTPinputPhotoCrop::innerLength() const { @@ -22707,10 +24185,10 @@ inline MTPinputPhotoCrop::MTPinputPhotoCrop(mtpTypeId type) : mtpDataOwner(0), _ inline MTPinputPhotoCrop::MTPinputPhotoCrop(MTPDinputPhotoCrop *_data) : mtpDataOwner(_data), _type(mtpc_inputPhotoCrop) { } inline MTPinputPhotoCrop MTP_inputPhotoCropAuto() { - return MTPinputPhotoCrop(mtpc_inputPhotoCropAuto); + return MTP::internal::TypeCreator::new_inputPhotoCropAuto(); } inline MTPinputPhotoCrop MTP_inputPhotoCrop(const MTPdouble &_crop_left, const MTPdouble &_crop_top, const MTPdouble &_crop_width) { - return MTPinputPhotoCrop(new MTPDinputPhotoCrop(_crop_left, _crop_top, _crop_width)); + return MTP::internal::TypeCreator::new_inputPhotoCrop(_crop_left, _crop_top, _crop_width); } inline MTPinputAppEvent::MTPinputAppEvent() : mtpDataOwner(new MTPDinputAppEvent()) { @@ -22743,7 +24221,7 @@ inline void MTPinputAppEvent::write(mtpBuffer &to) const { inline MTPinputAppEvent::MTPinputAppEvent(MTPDinputAppEvent *_data) : mtpDataOwner(_data) { } inline MTPinputAppEvent MTP_inputAppEvent(const MTPdouble &_time, const MTPstring &_type, const MTPlong &_peer, const MTPstring &_data) { - return MTPinputAppEvent(new MTPDinputAppEvent(_time, _type, _peer, _data)); + return MTP::internal::TypeCreator::new_inputAppEvent(_time, _type, _peer, _data); } inline uint32 MTPpeer::innerLength() const { @@ -22819,13 +24297,13 @@ inline MTPpeer::MTPpeer(MTPDpeerChat *_data) : mtpDataOwner(_data), _type(mtpc_p inline MTPpeer::MTPpeer(MTPDpeerChannel *_data) : mtpDataOwner(_data), _type(mtpc_peerChannel) { } inline MTPpeer MTP_peerUser(MTPint _user_id) { - return MTPpeer(new MTPDpeerUser(_user_id)); + return MTP::internal::TypeCreator::new_peerUser(_user_id); } inline MTPpeer MTP_peerChat(MTPint _chat_id) { - return MTPpeer(new MTPDpeerChat(_chat_id)); + return MTP::internal::TypeCreator::new_peerChat(_chat_id); } inline MTPpeer MTP_peerChannel(MTPint _channel_id) { - return MTPpeer(new MTPDpeerChannel(_channel_id)); + return MTP::internal::TypeCreator::new_peerChannel(_channel_id); } inline uint32 MTPstorage_fileType::innerLength() const { @@ -22870,34 +24348,34 @@ inline MTPstorage_fileType::MTPstorage_fileType(mtpTypeId type) : _type(type) { } } inline MTPstorage_fileType MTP_storage_fileUnknown() { - return MTPstorage_fileType(mtpc_storage_fileUnknown); + return MTP::internal::TypeCreator::new_storage_fileUnknown(); } inline MTPstorage_fileType MTP_storage_fileJpeg() { - return MTPstorage_fileType(mtpc_storage_fileJpeg); + return MTP::internal::TypeCreator::new_storage_fileJpeg(); } inline MTPstorage_fileType MTP_storage_fileGif() { - return MTPstorage_fileType(mtpc_storage_fileGif); + return MTP::internal::TypeCreator::new_storage_fileGif(); } inline MTPstorage_fileType MTP_storage_filePng() { - return MTPstorage_fileType(mtpc_storage_filePng); + return MTP::internal::TypeCreator::new_storage_filePng(); } inline MTPstorage_fileType MTP_storage_filePdf() { - return MTPstorage_fileType(mtpc_storage_filePdf); + return MTP::internal::TypeCreator::new_storage_filePdf(); } inline MTPstorage_fileType MTP_storage_fileMp3() { - return MTPstorage_fileType(mtpc_storage_fileMp3); + return MTP::internal::TypeCreator::new_storage_fileMp3(); } inline MTPstorage_fileType MTP_storage_fileMov() { - return MTPstorage_fileType(mtpc_storage_fileMov); + return MTP::internal::TypeCreator::new_storage_fileMov(); } inline MTPstorage_fileType MTP_storage_filePartial() { - return MTPstorage_fileType(mtpc_storage_filePartial); + return MTP::internal::TypeCreator::new_storage_filePartial(); } inline MTPstorage_fileType MTP_storage_fileMp4() { - return MTPstorage_fileType(mtpc_storage_fileMp4); + return MTP::internal::TypeCreator::new_storage_fileMp4(); } inline MTPstorage_fileType MTP_storage_fileWebp() { - return MTPstorage_fileType(mtpc_storage_fileWebp); + return MTP::internal::TypeCreator::new_storage_fileWebp(); } inline uint32 MTPfileLocation::innerLength() const { @@ -22967,10 +24445,10 @@ inline MTPfileLocation::MTPfileLocation(MTPDfileLocationUnavailable *_data) : mt inline MTPfileLocation::MTPfileLocation(MTPDfileLocation *_data) : mtpDataOwner(_data), _type(mtpc_fileLocation) { } inline MTPfileLocation MTP_fileLocationUnavailable(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { - return MTPfileLocation(new MTPDfileLocationUnavailable(_volume_id, _local_id, _secret)); + return MTP::internal::TypeCreator::new_fileLocationUnavailable(_volume_id, _local_id, _secret); } inline MTPfileLocation MTP_fileLocation(MTPint _dc_id, const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { - return MTPfileLocation(new MTPDfileLocation(_dc_id, _volume_id, _local_id, _secret)); + return MTP::internal::TypeCreator::new_fileLocation(_dc_id, _volume_id, _local_id, _secret); } inline uint32 MTPuser::innerLength() const { @@ -23052,10 +24530,11 @@ inline MTPuser::MTPuser(MTPDuserEmpty *_data) : mtpDataOwner(_data), _type(mtpc_ inline MTPuser::MTPuser(MTPDuser *_data) : mtpDataOwner(_data), _type(mtpc_user) { } inline MTPuser MTP_userEmpty(MTPint _id) { - return MTPuser(new MTPDuserEmpty(_id)); + return MTP::internal::TypeCreator::new_userEmpty(_id); } -inline MTPuser MTP_user(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder) { - return MTPuser(new MTPDuser(_flags, _id, _access_hash, _first_name, _last_name, _username, _phone, _photo, _status, _bot_info_version, _restriction_reason, _bot_inline_placeholder)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDuser::Flags) +inline MTPuser MTP_user(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username, const MTPstring &_phone, const MTPUserProfilePhoto &_photo, const MTPUserStatus &_status, MTPint _bot_info_version, const MTPstring &_restriction_reason, const MTPstring &_bot_inline_placeholder) { + return MTP::internal::TypeCreator::new_user(_flags, _id, _access_hash, _first_name, _last_name, _username, _phone, _photo, _status, _bot_info_version, _restriction_reason, _bot_inline_placeholder); } inline uint32 MTPuserProfilePhoto::innerLength() const { @@ -23105,10 +24584,10 @@ inline MTPuserProfilePhoto::MTPuserProfilePhoto(mtpTypeId type) : mtpDataOwner(0 inline MTPuserProfilePhoto::MTPuserProfilePhoto(MTPDuserProfilePhoto *_data) : mtpDataOwner(_data), _type(mtpc_userProfilePhoto) { } inline MTPuserProfilePhoto MTP_userProfilePhotoEmpty() { - return MTPuserProfilePhoto(mtpc_userProfilePhotoEmpty); + return MTP::internal::TypeCreator::new_userProfilePhotoEmpty(); } inline MTPuserProfilePhoto MTP_userProfilePhoto(const MTPlong &_photo_id, const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big) { - return MTPuserProfilePhoto(new MTPDuserProfilePhoto(_photo_id, _photo_small, _photo_big)); + return MTP::internal::TypeCreator::new_userProfilePhoto(_photo_id, _photo_small, _photo_big); } inline uint32 MTPuserStatus::innerLength() const { @@ -23176,22 +24655,22 @@ inline MTPuserStatus::MTPuserStatus(MTPDuserStatusOnline *_data) : mtpDataOwner( inline MTPuserStatus::MTPuserStatus(MTPDuserStatusOffline *_data) : mtpDataOwner(_data), _type(mtpc_userStatusOffline) { } inline MTPuserStatus MTP_userStatusEmpty() { - return MTPuserStatus(mtpc_userStatusEmpty); + return MTP::internal::TypeCreator::new_userStatusEmpty(); } inline MTPuserStatus MTP_userStatusOnline(MTPint _expires) { - return MTPuserStatus(new MTPDuserStatusOnline(_expires)); + return MTP::internal::TypeCreator::new_userStatusOnline(_expires); } inline MTPuserStatus MTP_userStatusOffline(MTPint _was_online) { - return MTPuserStatus(new MTPDuserStatusOffline(_was_online)); + return MTP::internal::TypeCreator::new_userStatusOffline(_was_online); } inline MTPuserStatus MTP_userStatusRecently() { - return MTPuserStatus(mtpc_userStatusRecently); + return MTP::internal::TypeCreator::new_userStatusRecently(); } inline MTPuserStatus MTP_userStatusLastWeek() { - return MTPuserStatus(mtpc_userStatusLastWeek); + return MTP::internal::TypeCreator::new_userStatusLastWeek(); } inline MTPuserStatus MTP_userStatusLastMonth() { - return MTPuserStatus(mtpc_userStatusLastMonth); + return MTP::internal::TypeCreator::new_userStatusLastMonth(); } inline uint32 MTPchat::innerLength() const { @@ -23335,19 +24814,21 @@ inline MTPchat::MTPchat(MTPDchannel *_data) : mtpDataOwner(_data), _type(mtpc_ch inline MTPchat::MTPchat(MTPDchannelForbidden *_data) : mtpDataOwner(_data), _type(mtpc_channelForbidden) { } inline MTPchat MTP_chatEmpty(MTPint _id) { - return MTPchat(new MTPDchatEmpty(_id)); + return MTP::internal::TypeCreator::new_chatEmpty(_id); } -inline MTPchat MTP_chat(MTPint _flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to) { - return MTPchat(new MTPDchat(_flags, _id, _title, _photo, _participants_count, _date, _version, _migrated_to)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchat::Flags) +inline MTPchat MTP_chat(const MTPflags &_flags, MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPint _version, const MTPInputChannel &_migrated_to) { + return MTP::internal::TypeCreator::new_chat(_flags, _id, _title, _photo, _participants_count, _date, _version, _migrated_to); } inline MTPchat MTP_chatForbidden(MTPint _id, const MTPstring &_title) { - return MTPchat(new MTPDchatForbidden(_id, _title)); + return MTP::internal::TypeCreator::new_chatForbidden(_id, _title); } -inline MTPchat MTP_channel(MTPint _flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason) { - return MTPchat(new MTPDchannel(_flags, _id, _access_hash, _title, _username, _photo, _date, _version, _restriction_reason)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchannel::Flags) +inline MTPchat MTP_channel(const MTPflags &_flags, MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_username, const MTPChatPhoto &_photo, MTPint _date, MTPint _version, const MTPstring &_restriction_reason) { + return MTP::internal::TypeCreator::new_channel(_flags, _id, _access_hash, _title, _username, _photo, _date, _version, _restriction_reason); } inline MTPchat MTP_channelForbidden(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title) { - return MTPchat(new MTPDchannelForbidden(_id, _access_hash, _title)); + return MTP::internal::TypeCreator::new_channelForbidden(_id, _access_hash, _title); } inline uint32 MTPchatFull::innerLength() const { @@ -23447,10 +24928,11 @@ inline MTPchatFull::MTPchatFull(MTPDchatFull *_data) : mtpDataOwner(_data), _typ inline MTPchatFull::MTPchatFull(MTPDchannelFull *_data) : mtpDataOwner(_data), _type(mtpc_channelFull) { } inline MTPchatFull MTP_chatFull(MTPint _id, const MTPChatParticipants &_participants, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info) { - return MTPchatFull(new MTPDchatFull(_id, _participants, _chat_photo, _notify_settings, _exported_invite, _bot_info)); + return MTP::internal::TypeCreator::new_chatFull(_id, _participants, _chat_photo, _notify_settings, _exported_invite, _bot_info); } -inline MTPchatFull MTP_channelFull(MTPint _flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id) { - return MTPchatFull(new MTPDchannelFull(_flags, _id, _about, _participants_count, _admins_count, _kicked_count, _read_inbox_max_id, _unread_count, _unread_important_count, _chat_photo, _notify_settings, _exported_invite, _bot_info, _migrated_from_chat_id, _migrated_from_max_id, _pinned_msg_id)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchannelFull::Flags) +inline MTPchatFull MTP_channelFull(const MTPflags &_flags, MTPint _id, const MTPstring &_about, MTPint _participants_count, MTPint _admins_count, MTPint _kicked_count, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPhoto &_chat_photo, const MTPPeerNotifySettings &_notify_settings, const MTPExportedChatInvite &_exported_invite, const MTPVector &_bot_info, MTPint _migrated_from_chat_id, MTPint _migrated_from_max_id, MTPint _pinned_msg_id) { + return MTP::internal::TypeCreator::new_channelFull(_flags, _id, _about, _participants_count, _admins_count, _kicked_count, _read_inbox_max_id, _unread_count, _unread_important_count, _chat_photo, _notify_settings, _exported_invite, _bot_info, _migrated_from_chat_id, _migrated_from_max_id, _pinned_msg_id); } inline uint32 MTPchatParticipant::innerLength() const { @@ -23534,13 +25016,13 @@ inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipantCreator *_data) inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipantAdmin *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipantAdmin) { } inline MTPchatParticipant MTP_chatParticipant(MTPint _user_id, MTPint _inviter_id, MTPint _date) { - return MTPchatParticipant(new MTPDchatParticipant(_user_id, _inviter_id, _date)); + return MTP::internal::TypeCreator::new_chatParticipant(_user_id, _inviter_id, _date); } inline MTPchatParticipant MTP_chatParticipantCreator(MTPint _user_id) { - return MTPchatParticipant(new MTPDchatParticipantCreator(_user_id)); + return MTP::internal::TypeCreator::new_chatParticipantCreator(_user_id); } inline MTPchatParticipant MTP_chatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date) { - return MTPchatParticipant(new MTPDchatParticipantAdmin(_user_id, _inviter_id, _date)); + return MTP::internal::TypeCreator::new_chatParticipantAdmin(_user_id, _inviter_id, _date); } inline uint32 MTPchatParticipants::innerLength() const { @@ -23607,11 +25089,12 @@ inline MTPchatParticipants::MTPchatParticipants(MTPDchatParticipantsForbidden *_ } inline MTPchatParticipants::MTPchatParticipants(MTPDchatParticipants *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipants) { } -inline MTPchatParticipants MTP_chatParticipantsForbidden(MTPint _flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) { - return MTPchatParticipants(new MTPDchatParticipantsForbidden(_flags, _chat_id, _self_participant)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchatParticipantsForbidden::Flags) +inline MTPchatParticipants MTP_chatParticipantsForbidden(const MTPflags &_flags, MTPint _chat_id, const MTPChatParticipant &_self_participant) { + return MTP::internal::TypeCreator::new_chatParticipantsForbidden(_flags, _chat_id, _self_participant); } inline MTPchatParticipants MTP_chatParticipants(MTPint _chat_id, const MTPVector &_participants, MTPint _version) { - return MTPchatParticipants(new MTPDchatParticipants(_chat_id, _participants, _version)); + return MTP::internal::TypeCreator::new_chatParticipants(_chat_id, _participants, _version); } inline uint32 MTPchatPhoto::innerLength() const { @@ -23659,10 +25142,10 @@ inline MTPchatPhoto::MTPchatPhoto(mtpTypeId type) : mtpDataOwner(0), _type(type) inline MTPchatPhoto::MTPchatPhoto(MTPDchatPhoto *_data) : mtpDataOwner(_data), _type(mtpc_chatPhoto) { } inline MTPchatPhoto MTP_chatPhotoEmpty() { - return MTPchatPhoto(mtpc_chatPhotoEmpty); + return MTP::internal::TypeCreator::new_chatPhotoEmpty(); } inline MTPchatPhoto MTP_chatPhoto(const MTPFileLocation &_photo_small, const MTPFileLocation &_photo_big) { - return MTPchatPhoto(new MTPDchatPhoto(_photo_small, _photo_big)); + return MTP::internal::TypeCreator::new_chatPhoto(_photo_small, _photo_big); } inline uint32 MTPmessage::innerLength() const { @@ -23776,13 +25259,15 @@ inline MTPmessage::MTPmessage(MTPDmessage *_data) : mtpDataOwner(_data), _type(m inline MTPmessage::MTPmessage(MTPDmessageService *_data) : mtpDataOwner(_data), _type(mtpc_messageService) { } inline MTPmessage MTP_messageEmpty(MTPint _id) { - return MTPmessage(new MTPDmessageEmpty(_id)); + return MTP::internal::TypeCreator::new_messageEmpty(_id); } -inline MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date) { - return MTPmessage(new MTPDmessage(_flags, _id, _from_id, _to_id, _fwd_from, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views, _edit_date)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessage::Flags) +inline MTPmessage MTP_message(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media, const MTPReplyMarkup &_reply_markup, const MTPVector &_entities, MTPint _views, MTPint _edit_date) { + return MTP::internal::TypeCreator::new_message(_flags, _id, _from_id, _to_id, _fwd_from, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views, _edit_date); } -inline MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action) { - return MTPmessage(new MTPDmessageService(_flags, _id, _from_id, _to_id, _reply_to_msg_id, _date, _action)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessageService::Flags) +inline MTPmessage MTP_messageService(const MTPflags &_flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _reply_to_msg_id, MTPint _date, const MTPMessageAction &_action) { + return MTP::internal::TypeCreator::new_messageService(_flags, _id, _from_id, _to_id, _reply_to_msg_id, _date, _action); } inline uint32 MTPmessageMedia::innerLength() const { @@ -23928,28 +25413,28 @@ inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaWebPage *_data) : mtpDat inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaVenue *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaVenue) { } inline MTPmessageMedia MTP_messageMediaEmpty() { - return MTPmessageMedia(mtpc_messageMediaEmpty); + return MTP::internal::TypeCreator::new_messageMediaEmpty(); } inline MTPmessageMedia MTP_messageMediaPhoto(const MTPPhoto &_photo, const MTPstring &_caption) { - return MTPmessageMedia(new MTPDmessageMediaPhoto(_photo, _caption)); + return MTP::internal::TypeCreator::new_messageMediaPhoto(_photo, _caption); } inline MTPmessageMedia MTP_messageMediaGeo(const MTPGeoPoint &_geo) { - return MTPmessageMedia(new MTPDmessageMediaGeo(_geo)); + return MTP::internal::TypeCreator::new_messageMediaGeo(_geo); } inline MTPmessageMedia MTP_messageMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, MTPint _user_id) { - return MTPmessageMedia(new MTPDmessageMediaContact(_phone_number, _first_name, _last_name, _user_id)); + return MTP::internal::TypeCreator::new_messageMediaContact(_phone_number, _first_name, _last_name, _user_id); } inline MTPmessageMedia MTP_messageMediaUnsupported() { - return MTPmessageMedia(mtpc_messageMediaUnsupported); + return MTP::internal::TypeCreator::new_messageMediaUnsupported(); } inline MTPmessageMedia MTP_messageMediaDocument(const MTPDocument &_document, const MTPstring &_caption) { - return MTPmessageMedia(new MTPDmessageMediaDocument(_document, _caption)); + return MTP::internal::TypeCreator::new_messageMediaDocument(_document, _caption); } inline MTPmessageMedia MTP_messageMediaWebPage(const MTPWebPage &_webpage) { - return MTPmessageMedia(new MTPDmessageMediaWebPage(_webpage)); + return MTP::internal::TypeCreator::new_messageMediaWebPage(_webpage); } inline MTPmessageMedia MTP_messageMediaVenue(const MTPGeoPoint &_geo, const MTPstring &_title, const MTPstring &_address, const MTPstring &_provider, const MTPstring &_venue_id) { - return MTPmessageMedia(new MTPDmessageMediaVenue(_geo, _title, _address, _provider, _venue_id)); + return MTP::internal::TypeCreator::new_messageMediaVenue(_geo, _title, _address, _provider, _venue_id); } inline uint32 MTPmessageAction::innerLength() const { @@ -24131,40 +25616,40 @@ inline MTPmessageAction::MTPmessageAction(MTPDmessageActionChatMigrateTo *_data) inline MTPmessageAction::MTPmessageAction(MTPDmessageActionChannelMigrateFrom *_data) : mtpDataOwner(_data), _type(mtpc_messageActionChannelMigrateFrom) { } inline MTPmessageAction MTP_messageActionEmpty() { - return MTPmessageAction(mtpc_messageActionEmpty); + return MTP::internal::TypeCreator::new_messageActionEmpty(); } inline MTPmessageAction MTP_messageActionChatCreate(const MTPstring &_title, const MTPVector &_users) { - return MTPmessageAction(new MTPDmessageActionChatCreate(_title, _users)); + return MTP::internal::TypeCreator::new_messageActionChatCreate(_title, _users); } inline MTPmessageAction MTP_messageActionChatEditTitle(const MTPstring &_title) { - return MTPmessageAction(new MTPDmessageActionChatEditTitle(_title)); + return MTP::internal::TypeCreator::new_messageActionChatEditTitle(_title); } inline MTPmessageAction MTP_messageActionChatEditPhoto(const MTPPhoto &_photo) { - return MTPmessageAction(new MTPDmessageActionChatEditPhoto(_photo)); + return MTP::internal::TypeCreator::new_messageActionChatEditPhoto(_photo); } inline MTPmessageAction MTP_messageActionChatDeletePhoto() { - return MTPmessageAction(mtpc_messageActionChatDeletePhoto); + return MTP::internal::TypeCreator::new_messageActionChatDeletePhoto(); } inline MTPmessageAction MTP_messageActionChatAddUser(const MTPVector &_users) { - return MTPmessageAction(new MTPDmessageActionChatAddUser(_users)); + return MTP::internal::TypeCreator::new_messageActionChatAddUser(_users); } inline MTPmessageAction MTP_messageActionChatDeleteUser(MTPint _user_id) { - return MTPmessageAction(new MTPDmessageActionChatDeleteUser(_user_id)); + return MTP::internal::TypeCreator::new_messageActionChatDeleteUser(_user_id); } inline MTPmessageAction MTP_messageActionChatJoinedByLink(MTPint _inviter_id) { - return MTPmessageAction(new MTPDmessageActionChatJoinedByLink(_inviter_id)); + return MTP::internal::TypeCreator::new_messageActionChatJoinedByLink(_inviter_id); } inline MTPmessageAction MTP_messageActionChannelCreate(const MTPstring &_title) { - return MTPmessageAction(new MTPDmessageActionChannelCreate(_title)); + return MTP::internal::TypeCreator::new_messageActionChannelCreate(_title); } inline MTPmessageAction MTP_messageActionChatMigrateTo(MTPint _channel_id) { - return MTPmessageAction(new MTPDmessageActionChatMigrateTo(_channel_id)); + return MTP::internal::TypeCreator::new_messageActionChatMigrateTo(_channel_id); } inline MTPmessageAction MTP_messageActionChannelMigrateFrom(const MTPstring &_title, MTPint _chat_id) { - return MTPmessageAction(new MTPDmessageActionChannelMigrateFrom(_title, _chat_id)); + return MTP::internal::TypeCreator::new_messageActionChannelMigrateFrom(_title, _chat_id); } inline MTPmessageAction MTP_messageActionPinMessage() { - return MTPmessageAction(mtpc_messageActionPinMessage); + return MTP::internal::TypeCreator::new_messageActionPinMessage(); } inline uint32 MTPdialog::innerLength() const { @@ -24246,10 +25731,10 @@ inline MTPdialog::MTPdialog(MTPDdialog *_data) : mtpDataOwner(_data), _type(mtpc inline MTPdialog::MTPdialog(MTPDdialogChannel *_data) : mtpDataOwner(_data), _type(mtpc_dialogChannel) { } inline MTPdialog MTP_dialog(const MTPPeer &_peer, MTPint _top_message, MTPint _read_inbox_max_id, MTPint _unread_count, const MTPPeerNotifySettings &_notify_settings) { - return MTPdialog(new MTPDdialog(_peer, _top_message, _read_inbox_max_id, _unread_count, _notify_settings)); + return MTP::internal::TypeCreator::new_dialog(_peer, _top_message, _read_inbox_max_id, _unread_count, _notify_settings); } inline MTPdialog MTP_dialogChannel(const MTPPeer &_peer, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPPeerNotifySettings &_notify_settings, MTPint _pts) { - return MTPdialog(new MTPDdialogChannel(_peer, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _notify_settings, _pts)); + return MTP::internal::TypeCreator::new_dialogChannel(_peer, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _notify_settings, _pts); } inline uint32 MTPphoto::innerLength() const { @@ -24315,10 +25800,10 @@ inline MTPphoto::MTPphoto(MTPDphotoEmpty *_data) : mtpDataOwner(_data), _type(mt inline MTPphoto::MTPphoto(MTPDphoto *_data) : mtpDataOwner(_data), _type(mtpc_photo) { } inline MTPphoto MTP_photoEmpty(const MTPlong &_id) { - return MTPphoto(new MTPDphotoEmpty(_id)); + return MTP::internal::TypeCreator::new_photoEmpty(_id); } inline MTPphoto MTP_photo(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPVector &_sizes) { - return MTPphoto(new MTPDphoto(_id, _access_hash, _date, _sizes)); + return MTP::internal::TypeCreator::new_photo(_id, _access_hash, _date, _sizes); } inline uint32 MTPphotoSize::innerLength() const { @@ -24410,13 +25895,13 @@ inline MTPphotoSize::MTPphotoSize(MTPDphotoSize *_data) : mtpDataOwner(_data), _ inline MTPphotoSize::MTPphotoSize(MTPDphotoCachedSize *_data) : mtpDataOwner(_data), _type(mtpc_photoCachedSize) { } inline MTPphotoSize MTP_photoSizeEmpty(const MTPstring &_type) { - return MTPphotoSize(new MTPDphotoSizeEmpty(_type)); + return MTP::internal::TypeCreator::new_photoSizeEmpty(_type); } inline MTPphotoSize MTP_photoSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, MTPint _size) { - return MTPphotoSize(new MTPDphotoSize(_type, _location, _w, _h, _size)); + return MTP::internal::TypeCreator::new_photoSize(_type, _location, _w, _h, _size); } inline MTPphotoSize MTP_photoCachedSize(const MTPstring &_type, const MTPFileLocation &_location, MTPint _w, MTPint _h, const MTPbytes &_bytes) { - return MTPphotoSize(new MTPDphotoCachedSize(_type, _location, _w, _h, _bytes)); + return MTP::internal::TypeCreator::new_photoCachedSize(_type, _location, _w, _h, _bytes); } inline uint32 MTPgeoPoint::innerLength() const { @@ -24464,10 +25949,10 @@ inline MTPgeoPoint::MTPgeoPoint(mtpTypeId type) : mtpDataOwner(0), _type(type) { inline MTPgeoPoint::MTPgeoPoint(MTPDgeoPoint *_data) : mtpDataOwner(_data), _type(mtpc_geoPoint) { } inline MTPgeoPoint MTP_geoPointEmpty() { - return MTPgeoPoint(mtpc_geoPointEmpty); + return MTP::internal::TypeCreator::new_geoPointEmpty(); } inline MTPgeoPoint MTP_geoPoint(const MTPdouble &_long, const MTPdouble &_lat) { - return MTPgeoPoint(new MTPDgeoPoint(_long, _lat)); + return MTP::internal::TypeCreator::new_geoPoint(_long, _lat); } inline MTPauth_checkedPhone::MTPauth_checkedPhone() : mtpDataOwner(new MTPDauth_checkedPhone()) { @@ -24494,7 +25979,7 @@ inline void MTPauth_checkedPhone::write(mtpBuffer &to) const { inline MTPauth_checkedPhone::MTPauth_checkedPhone(MTPDauth_checkedPhone *_data) : mtpDataOwner(_data) { } inline MTPauth_checkedPhone MTP_auth_checkedPhone(MTPBool _phone_registered) { - return MTPauth_checkedPhone(new MTPDauth_checkedPhone(_phone_registered)); + return MTP::internal::TypeCreator::new_auth_checkedPhone(_phone_registered); } inline MTPauth_sentCode::MTPauth_sentCode() : mtpDataOwner(new MTPDauth_sentCode()) { @@ -24528,8 +26013,9 @@ inline void MTPauth_sentCode::write(mtpBuffer &to) const { } inline MTPauth_sentCode::MTPauth_sentCode(MTPDauth_sentCode *_data) : mtpDataOwner(_data) { } -inline MTPauth_sentCode MTP_auth_sentCode(MTPint _flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout) { - return MTPauth_sentCode(new MTPDauth_sentCode(_flags, _type, _phone_code_hash, _next_type, _timeout)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDauth_sentCode::Flags) +inline MTPauth_sentCode MTP_auth_sentCode(const MTPflags &_flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout) { + return MTP::internal::TypeCreator::new_auth_sentCode(_flags, _type, _phone_code_hash, _next_type, _timeout); } inline MTPauth_authorization::MTPauth_authorization() : mtpDataOwner(new MTPDauth_authorization()) { @@ -24556,7 +26042,7 @@ inline void MTPauth_authorization::write(mtpBuffer &to) const { inline MTPauth_authorization::MTPauth_authorization(MTPDauth_authorization *_data) : mtpDataOwner(_data) { } inline MTPauth_authorization MTP_auth_authorization(const MTPUser &_user) { - return MTPauth_authorization(new MTPDauth_authorization(_user)); + return MTP::internal::TypeCreator::new_auth_authorization(_user); } inline MTPauth_exportedAuthorization::MTPauth_exportedAuthorization() : mtpDataOwner(new MTPDauth_exportedAuthorization()) { @@ -24585,7 +26071,7 @@ inline void MTPauth_exportedAuthorization::write(mtpBuffer &to) const { inline MTPauth_exportedAuthorization::MTPauth_exportedAuthorization(MTPDauth_exportedAuthorization *_data) : mtpDataOwner(_data) { } inline MTPauth_exportedAuthorization MTP_auth_exportedAuthorization(MTPint _id, const MTPbytes &_bytes) { - return MTPauth_exportedAuthorization(new MTPDauth_exportedAuthorization(_id, _bytes)); + return MTP::internal::TypeCreator::new_auth_exportedAuthorization(_id, _bytes); } inline uint32 MTPinputNotifyPeer::innerLength() const { @@ -24635,16 +26121,16 @@ inline MTPinputNotifyPeer::MTPinputNotifyPeer(mtpTypeId type) : mtpDataOwner(0), inline MTPinputNotifyPeer::MTPinputNotifyPeer(MTPDinputNotifyPeer *_data) : mtpDataOwner(_data), _type(mtpc_inputNotifyPeer) { } inline MTPinputNotifyPeer MTP_inputNotifyPeer(const MTPInputPeer &_peer) { - return MTPinputNotifyPeer(new MTPDinputNotifyPeer(_peer)); + return MTP::internal::TypeCreator::new_inputNotifyPeer(_peer); } inline MTPinputNotifyPeer MTP_inputNotifyUsers() { - return MTPinputNotifyPeer(mtpc_inputNotifyUsers); + return MTP::internal::TypeCreator::new_inputNotifyUsers(); } inline MTPinputNotifyPeer MTP_inputNotifyChats() { - return MTPinputNotifyPeer(mtpc_inputNotifyChats); + return MTP::internal::TypeCreator::new_inputNotifyChats(); } inline MTPinputNotifyPeer MTP_inputNotifyAll() { - return MTPinputNotifyPeer(mtpc_inputNotifyAll); + return MTP::internal::TypeCreator::new_inputNotifyAll(); } inline uint32 MTPinputPeerNotifyEvents::innerLength() const { @@ -24673,10 +26159,10 @@ inline MTPinputPeerNotifyEvents::MTPinputPeerNotifyEvents(mtpTypeId type) : _typ } } inline MTPinputPeerNotifyEvents MTP_inputPeerNotifyEventsEmpty() { - return MTPinputPeerNotifyEvents(mtpc_inputPeerNotifyEventsEmpty); + return MTP::internal::TypeCreator::new_inputPeerNotifyEventsEmpty(); } inline MTPinputPeerNotifyEvents MTP_inputPeerNotifyEventsAll() { - return MTPinputPeerNotifyEvents(mtpc_inputPeerNotifyEventsAll); + return MTP::internal::TypeCreator::new_inputPeerNotifyEventsAll(); } inline MTPinputPeerNotifySettings::MTPinputPeerNotifySettings() : mtpDataOwner(new MTPDinputPeerNotifySettings()) { @@ -24706,8 +26192,9 @@ inline void MTPinputPeerNotifySettings::write(mtpBuffer &to) const { } inline MTPinputPeerNotifySettings::MTPinputPeerNotifySettings(MTPDinputPeerNotifySettings *_data) : mtpDataOwner(_data) { } -inline MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) { - return MTPinputPeerNotifySettings(new MTPDinputPeerNotifySettings(_flags, _mute_until, _sound)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputPeerNotifySettings::Flags) +inline MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) { + return MTP::internal::TypeCreator::new_inputPeerNotifySettings(_flags, _mute_until, _sound); } inline uint32 MTPpeerNotifyEvents::innerLength() const { @@ -24736,10 +26223,10 @@ inline MTPpeerNotifyEvents::MTPpeerNotifyEvents(mtpTypeId type) : _type(type) { } } inline MTPpeerNotifyEvents MTP_peerNotifyEventsEmpty() { - return MTPpeerNotifyEvents(mtpc_peerNotifyEventsEmpty); + return MTP::internal::TypeCreator::new_peerNotifyEventsEmpty(); } inline MTPpeerNotifyEvents MTP_peerNotifyEventsAll() { - return MTPpeerNotifyEvents(mtpc_peerNotifyEventsAll); + return MTP::internal::TypeCreator::new_peerNotifyEventsAll(); } inline uint32 MTPpeerNotifySettings::innerLength() const { @@ -24789,10 +26276,11 @@ inline MTPpeerNotifySettings::MTPpeerNotifySettings(mtpTypeId type) : mtpDataOwn inline MTPpeerNotifySettings::MTPpeerNotifySettings(MTPDpeerNotifySettings *_data) : mtpDataOwner(_data), _type(mtpc_peerNotifySettings) { } inline MTPpeerNotifySettings MTP_peerNotifySettingsEmpty() { - return MTPpeerNotifySettings(mtpc_peerNotifySettingsEmpty); + return MTP::internal::TypeCreator::new_peerNotifySettingsEmpty(); } -inline MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) { - return MTPpeerNotifySettings(new MTPDpeerNotifySettings(_flags, _mute_until, _sound)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDpeerNotifySettings::Flags) +inline MTPpeerNotifySettings MTP_peerNotifySettings(const MTPflags &_flags, MTPint _mute_until, const MTPstring &_sound) { + return MTP::internal::TypeCreator::new_peerNotifySettings(_flags, _mute_until, _sound); } inline MTPpeerSettings::MTPpeerSettings() : mtpDataOwner(new MTPDpeerSettings()) { @@ -24818,8 +26306,9 @@ inline void MTPpeerSettings::write(mtpBuffer &to) const { } inline MTPpeerSettings::MTPpeerSettings(MTPDpeerSettings *_data) : mtpDataOwner(_data) { } -inline MTPpeerSettings MTP_peerSettings(MTPint _flags) { - return MTPpeerSettings(new MTPDpeerSettings(_flags)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDpeerSettings::Flags) +inline MTPpeerSettings MTP_peerSettings(const MTPflags &_flags) { + return MTP::internal::TypeCreator::new_peerSettings(_flags); } inline uint32 MTPwallPaper::innerLength() const { @@ -24891,10 +26380,10 @@ inline MTPwallPaper::MTPwallPaper(MTPDwallPaper *_data) : mtpDataOwner(_data), _ inline MTPwallPaper::MTPwallPaper(MTPDwallPaperSolid *_data) : mtpDataOwner(_data), _type(mtpc_wallPaperSolid) { } inline MTPwallPaper MTP_wallPaper(MTPint _id, const MTPstring &_title, const MTPVector &_sizes, MTPint _color) { - return MTPwallPaper(new MTPDwallPaper(_id, _title, _sizes, _color)); + return MTP::internal::TypeCreator::new_wallPaper(_id, _title, _sizes, _color); } inline MTPwallPaper MTP_wallPaperSolid(MTPint _id, const MTPstring &_title, MTPint _bg_color, MTPint _color) { - return MTPwallPaper(new MTPDwallPaperSolid(_id, _title, _bg_color, _color)); + return MTP::internal::TypeCreator::new_wallPaperSolid(_id, _title, _bg_color, _color); } inline uint32 MTPreportReason::innerLength() const { @@ -24944,16 +26433,16 @@ inline MTPreportReason::MTPreportReason(mtpTypeId type) : mtpDataOwner(0), _type inline MTPreportReason::MTPreportReason(MTPDinputReportReasonOther *_data) : mtpDataOwner(_data), _type(mtpc_inputReportReasonOther) { } inline MTPreportReason MTP_inputReportReasonSpam() { - return MTPreportReason(mtpc_inputReportReasonSpam); + return MTP::internal::TypeCreator::new_inputReportReasonSpam(); } inline MTPreportReason MTP_inputReportReasonViolence() { - return MTPreportReason(mtpc_inputReportReasonViolence); + return MTP::internal::TypeCreator::new_inputReportReasonViolence(); } inline MTPreportReason MTP_inputReportReasonPornography() { - return MTPreportReason(mtpc_inputReportReasonPornography); + return MTP::internal::TypeCreator::new_inputReportReasonPornography(); } inline MTPreportReason MTP_inputReportReasonOther(const MTPstring &_text) { - return MTPreportReason(new MTPDinputReportReasonOther(_text)); + return MTP::internal::TypeCreator::new_inputReportReasonOther(_text); } inline MTPuserFull::MTPuserFull() : mtpDataOwner(new MTPDuserFull()) { @@ -24991,8 +26480,9 @@ inline void MTPuserFull::write(mtpBuffer &to) const { } inline MTPuserFull::MTPuserFull(MTPDuserFull *_data) : mtpDataOwner(_data) { } -inline MTPuserFull MTP_userFull(MTPint _flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info) { - return MTPuserFull(new MTPDuserFull(_flags, _user, _about, _link, _profile_photo, _notify_settings, _bot_info)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDuserFull::Flags) +inline MTPuserFull MTP_userFull(const MTPflags &_flags, const MTPUser &_user, const MTPstring &_about, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, const MTPBotInfo &_bot_info) { + return MTP::internal::TypeCreator::new_userFull(_flags, _user, _about, _link, _profile_photo, _notify_settings, _bot_info); } inline MTPcontact::MTPcontact() : mtpDataOwner(new MTPDcontact()) { @@ -25021,7 +26511,7 @@ inline void MTPcontact::write(mtpBuffer &to) const { inline MTPcontact::MTPcontact(MTPDcontact *_data) : mtpDataOwner(_data) { } inline MTPcontact MTP_contact(MTPint _user_id, MTPBool _mutual) { - return MTPcontact(new MTPDcontact(_user_id, _mutual)); + return MTP::internal::TypeCreator::new_contact(_user_id, _mutual); } inline MTPimportedContact::MTPimportedContact() : mtpDataOwner(new MTPDimportedContact()) { @@ -25050,7 +26540,7 @@ inline void MTPimportedContact::write(mtpBuffer &to) const { inline MTPimportedContact::MTPimportedContact(MTPDimportedContact *_data) : mtpDataOwner(_data) { } inline MTPimportedContact MTP_importedContact(MTPint _user_id, const MTPlong &_client_id) { - return MTPimportedContact(new MTPDimportedContact(_user_id, _client_id)); + return MTP::internal::TypeCreator::new_importedContact(_user_id, _client_id); } inline MTPcontactBlocked::MTPcontactBlocked() : mtpDataOwner(new MTPDcontactBlocked()) { @@ -25079,7 +26569,7 @@ inline void MTPcontactBlocked::write(mtpBuffer &to) const { inline MTPcontactBlocked::MTPcontactBlocked(MTPDcontactBlocked *_data) : mtpDataOwner(_data) { } inline MTPcontactBlocked MTP_contactBlocked(MTPint _user_id, MTPint _date) { - return MTPcontactBlocked(new MTPDcontactBlocked(_user_id, _date)); + return MTP::internal::TypeCreator::new_contactBlocked(_user_id, _date); } inline MTPcontactStatus::MTPcontactStatus() : mtpDataOwner(new MTPDcontactStatus()) { @@ -25108,7 +26598,7 @@ inline void MTPcontactStatus::write(mtpBuffer &to) const { inline MTPcontactStatus::MTPcontactStatus(MTPDcontactStatus *_data) : mtpDataOwner(_data) { } inline MTPcontactStatus MTP_contactStatus(MTPint _user_id, const MTPUserStatus &_status) { - return MTPcontactStatus(new MTPDcontactStatus(_user_id, _status)); + return MTP::internal::TypeCreator::new_contactStatus(_user_id, _status); } inline MTPcontacts_link::MTPcontacts_link() : mtpDataOwner(new MTPDcontacts_link()) { @@ -25139,7 +26629,7 @@ inline void MTPcontacts_link::write(mtpBuffer &to) const { inline MTPcontacts_link::MTPcontacts_link(MTPDcontacts_link *_data) : mtpDataOwner(_data) { } inline MTPcontacts_link MTP_contacts_link(const MTPContactLink &_my_link, const MTPContactLink &_foreign_link, const MTPUser &_user) { - return MTPcontacts_link(new MTPDcontacts_link(_my_link, _foreign_link, _user)); + return MTP::internal::TypeCreator::new_contacts_link(_my_link, _foreign_link, _user); } inline uint32 MTPcontacts_contacts::innerLength() const { @@ -25187,10 +26677,10 @@ inline MTPcontacts_contacts::MTPcontacts_contacts(mtpTypeId type) : mtpDataOwner inline MTPcontacts_contacts::MTPcontacts_contacts(MTPDcontacts_contacts *_data) : mtpDataOwner(_data), _type(mtpc_contacts_contacts) { } inline MTPcontacts_contacts MTP_contacts_contactsNotModified() { - return MTPcontacts_contacts(mtpc_contacts_contactsNotModified); + return MTP::internal::TypeCreator::new_contacts_contactsNotModified(); } inline MTPcontacts_contacts MTP_contacts_contacts(const MTPVector &_contacts, const MTPVector &_users) { - return MTPcontacts_contacts(new MTPDcontacts_contacts(_contacts, _users)); + return MTP::internal::TypeCreator::new_contacts_contacts(_contacts, _users); } inline MTPcontacts_importedContacts::MTPcontacts_importedContacts() : mtpDataOwner(new MTPDcontacts_importedContacts()) { @@ -25221,7 +26711,7 @@ inline void MTPcontacts_importedContacts::write(mtpBuffer &to) const { inline MTPcontacts_importedContacts::MTPcontacts_importedContacts(MTPDcontacts_importedContacts *_data) : mtpDataOwner(_data) { } inline MTPcontacts_importedContacts MTP_contacts_importedContacts(const MTPVector &_imported, const MTPVector &_retry_contacts, const MTPVector &_users) { - return MTPcontacts_importedContacts(new MTPDcontacts_importedContacts(_imported, _retry_contacts, _users)); + return MTP::internal::TypeCreator::new_contacts_importedContacts(_imported, _retry_contacts, _users); } inline uint32 MTPcontacts_blocked::innerLength() const { @@ -25287,10 +26777,10 @@ inline MTPcontacts_blocked::MTPcontacts_blocked(MTPDcontacts_blocked *_data) : m inline MTPcontacts_blocked::MTPcontacts_blocked(MTPDcontacts_blockedSlice *_data) : mtpDataOwner(_data), _type(mtpc_contacts_blockedSlice) { } inline MTPcontacts_blocked MTP_contacts_blocked(const MTPVector &_blocked, const MTPVector &_users) { - return MTPcontacts_blocked(new MTPDcontacts_blocked(_blocked, _users)); + return MTP::internal::TypeCreator::new_contacts_blocked(_blocked, _users); } inline MTPcontacts_blocked MTP_contacts_blockedSlice(MTPint _count, const MTPVector &_blocked, const MTPVector &_users) { - return MTPcontacts_blocked(new MTPDcontacts_blockedSlice(_count, _blocked, _users)); + return MTP::internal::TypeCreator::new_contacts_blockedSlice(_count, _blocked, _users); } inline uint32 MTPmessages_dialogs::innerLength() const { @@ -25364,10 +26854,10 @@ inline MTPmessages_dialogs::MTPmessages_dialogs(MTPDmessages_dialogs *_data) : m inline MTPmessages_dialogs::MTPmessages_dialogs(MTPDmessages_dialogsSlice *_data) : mtpDataOwner(_data), _type(mtpc_messages_dialogsSlice) { } inline MTPmessages_dialogs MTP_messages_dialogs(const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_dialogs(new MTPDmessages_dialogs(_dialogs, _messages, _chats, _users)); + return MTP::internal::TypeCreator::new_messages_dialogs(_dialogs, _messages, _chats, _users); } inline MTPmessages_dialogs MTP_messages_dialogsSlice(MTPint _count, const MTPVector &_dialogs, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_dialogs(new MTPDmessages_dialogsSlice(_count, _dialogs, _messages, _chats, _users)); + return MTP::internal::TypeCreator::new_messages_dialogsSlice(_count, _dialogs, _messages, _chats, _users); } inline uint32 MTPmessages_messages::innerLength() const { @@ -25465,13 +26955,14 @@ inline MTPmessages_messages::MTPmessages_messages(MTPDmessages_messagesSlice *_d inline MTPmessages_messages::MTPmessages_messages(MTPDmessages_channelMessages *_data) : mtpDataOwner(_data), _type(mtpc_messages_channelMessages) { } inline MTPmessages_messages MTP_messages_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_messages(new MTPDmessages_messages(_messages, _chats, _users)); + return MTP::internal::TypeCreator::new_messages_messages(_messages, _chats, _users); } inline MTPmessages_messages MTP_messages_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_messages(new MTPDmessages_messagesSlice(_count, _messages, _chats, _users)); + return MTP::internal::TypeCreator::new_messages_messagesSlice(_count, _messages, _chats, _users); } -inline MTPmessages_messages MTP_messages_channelMessages(MTPint _flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_messages(new MTPDmessages_channelMessages(_flags, _pts, _count, _messages, _collapsed, _chats, _users)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessages_channelMessages::Flags) +inline MTPmessages_messages MTP_messages_channelMessages(const MTPflags &_flags, MTPint _pts, MTPint _count, const MTPVector &_messages, const MTPVector &_collapsed, const MTPVector &_chats, const MTPVector &_users) { + return MTP::internal::TypeCreator::new_messages_channelMessages(_flags, _pts, _count, _messages, _collapsed, _chats, _users); } inline MTPmessages_chats::MTPmessages_chats() : mtpDataOwner(new MTPDmessages_chats()) { @@ -25498,7 +26989,7 @@ inline void MTPmessages_chats::write(mtpBuffer &to) const { inline MTPmessages_chats::MTPmessages_chats(MTPDmessages_chats *_data) : mtpDataOwner(_data) { } inline MTPmessages_chats MTP_messages_chats(const MTPVector &_chats) { - return MTPmessages_chats(new MTPDmessages_chats(_chats)); + return MTP::internal::TypeCreator::new_messages_chats(_chats); } inline MTPmessages_chatFull::MTPmessages_chatFull() : mtpDataOwner(new MTPDmessages_chatFull()) { @@ -25529,7 +27020,7 @@ inline void MTPmessages_chatFull::write(mtpBuffer &to) const { inline MTPmessages_chatFull::MTPmessages_chatFull(MTPDmessages_chatFull *_data) : mtpDataOwner(_data) { } inline MTPmessages_chatFull MTP_messages_chatFull(const MTPChatFull &_full_chat, const MTPVector &_chats, const MTPVector &_users) { - return MTPmessages_chatFull(new MTPDmessages_chatFull(_full_chat, _chats, _users)); + return MTP::internal::TypeCreator::new_messages_chatFull(_full_chat, _chats, _users); } inline MTPmessages_affectedHistory::MTPmessages_affectedHistory() : mtpDataOwner(new MTPDmessages_affectedHistory()) { @@ -25560,7 +27051,7 @@ inline void MTPmessages_affectedHistory::write(mtpBuffer &to) const { inline MTPmessages_affectedHistory::MTPmessages_affectedHistory(MTPDmessages_affectedHistory *_data) : mtpDataOwner(_data) { } inline MTPmessages_affectedHistory MTP_messages_affectedHistory(MTPint _pts, MTPint _pts_count, MTPint _offset) { - return MTPmessages_affectedHistory(new MTPDmessages_affectedHistory(_pts, _pts_count, _offset)); + return MTP::internal::TypeCreator::new_messages_affectedHistory(_pts, _pts_count, _offset); } inline uint32 MTPmessagesFilter::innerLength() const { @@ -25605,34 +27096,34 @@ inline MTPmessagesFilter::MTPmessagesFilter(mtpTypeId type) : _type(type) { } } inline MTPmessagesFilter MTP_inputMessagesFilterEmpty() { - return MTPmessagesFilter(mtpc_inputMessagesFilterEmpty); + return MTP::internal::TypeCreator::new_inputMessagesFilterEmpty(); } inline MTPmessagesFilter MTP_inputMessagesFilterPhotos() { - return MTPmessagesFilter(mtpc_inputMessagesFilterPhotos); + return MTP::internal::TypeCreator::new_inputMessagesFilterPhotos(); } inline MTPmessagesFilter MTP_inputMessagesFilterVideo() { - return MTPmessagesFilter(mtpc_inputMessagesFilterVideo); + return MTP::internal::TypeCreator::new_inputMessagesFilterVideo(); } inline MTPmessagesFilter MTP_inputMessagesFilterPhotoVideo() { - return MTPmessagesFilter(mtpc_inputMessagesFilterPhotoVideo); + return MTP::internal::TypeCreator::new_inputMessagesFilterPhotoVideo(); } inline MTPmessagesFilter MTP_inputMessagesFilterPhotoVideoDocuments() { - return MTPmessagesFilter(mtpc_inputMessagesFilterPhotoVideoDocuments); + return MTP::internal::TypeCreator::new_inputMessagesFilterPhotoVideoDocuments(); } inline MTPmessagesFilter MTP_inputMessagesFilterDocument() { - return MTPmessagesFilter(mtpc_inputMessagesFilterDocument); + return MTP::internal::TypeCreator::new_inputMessagesFilterDocument(); } inline MTPmessagesFilter MTP_inputMessagesFilterUrl() { - return MTPmessagesFilter(mtpc_inputMessagesFilterUrl); + return MTP::internal::TypeCreator::new_inputMessagesFilterUrl(); } inline MTPmessagesFilter MTP_inputMessagesFilterGif() { - return MTPmessagesFilter(mtpc_inputMessagesFilterGif); + return MTP::internal::TypeCreator::new_inputMessagesFilterGif(); } inline MTPmessagesFilter MTP_inputMessagesFilterVoice() { - return MTPmessagesFilter(mtpc_inputMessagesFilterVoice); + return MTP::internal::TypeCreator::new_inputMessagesFilterVoice(); } inline MTPmessagesFilter MTP_inputMessagesFilterMusic() { - return MTPmessagesFilter(mtpc_inputMessagesFilterMusic); + return MTP::internal::TypeCreator::new_inputMessagesFilterMusic(); } inline uint32 MTPupdate::innerLength() const { @@ -26496,139 +27987,140 @@ inline MTPupdate::MTPupdate(MTPDupdateEditChannelMessage *_data) : mtpDataOwner( inline MTPupdate::MTPupdate(MTPDupdateChannelPinnedMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateChannelPinnedMessage) { } inline MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateNewMessage(_message, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateNewMessage(_message, _pts, _pts_count); } inline MTPupdate MTP_updateMessageID(MTPint _id, const MTPlong &_random_id) { - return MTPupdate(new MTPDupdateMessageID(_id, _random_id)); + return MTP::internal::TypeCreator::new_updateMessageID(_id, _random_id); } inline MTPupdate MTP_updateDeleteMessages(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateDeleteMessages(_messages, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateDeleteMessages(_messages, _pts, _pts_count); } inline MTPupdate MTP_updateUserTyping(MTPint _user_id, const MTPSendMessageAction &_action) { - return MTPupdate(new MTPDupdateUserTyping(_user_id, _action)); + return MTP::internal::TypeCreator::new_updateUserTyping(_user_id, _action); } inline MTPupdate MTP_updateChatUserTyping(MTPint _chat_id, MTPint _user_id, const MTPSendMessageAction &_action) { - return MTPupdate(new MTPDupdateChatUserTyping(_chat_id, _user_id, _action)); + return MTP::internal::TypeCreator::new_updateChatUserTyping(_chat_id, _user_id, _action); } inline MTPupdate MTP_updateChatParticipants(const MTPChatParticipants &_participants) { - return MTPupdate(new MTPDupdateChatParticipants(_participants)); + return MTP::internal::TypeCreator::new_updateChatParticipants(_participants); } inline MTPupdate MTP_updateUserStatus(MTPint _user_id, const MTPUserStatus &_status) { - return MTPupdate(new MTPDupdateUserStatus(_user_id, _status)); + return MTP::internal::TypeCreator::new_updateUserStatus(_user_id, _status); } inline MTPupdate MTP_updateUserName(MTPint _user_id, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_username) { - return MTPupdate(new MTPDupdateUserName(_user_id, _first_name, _last_name, _username)); + return MTP::internal::TypeCreator::new_updateUserName(_user_id, _first_name, _last_name, _username); } inline MTPupdate MTP_updateUserPhoto(MTPint _user_id, MTPint _date, const MTPUserProfilePhoto &_photo, MTPBool _previous) { - return MTPupdate(new MTPDupdateUserPhoto(_user_id, _date, _photo, _previous)); + return MTP::internal::TypeCreator::new_updateUserPhoto(_user_id, _date, _photo, _previous); } inline MTPupdate MTP_updateContactRegistered(MTPint _user_id, MTPint _date) { - return MTPupdate(new MTPDupdateContactRegistered(_user_id, _date)); + return MTP::internal::TypeCreator::new_updateContactRegistered(_user_id, _date); } inline MTPupdate MTP_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link) { - return MTPupdate(new MTPDupdateContactLink(_user_id, _my_link, _foreign_link)); + return MTP::internal::TypeCreator::new_updateContactLink(_user_id, _my_link, _foreign_link); } inline MTPupdate MTP_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) { - return MTPupdate(new MTPDupdateNewAuthorization(_auth_key_id, _date, _device, _location)); + return MTP::internal::TypeCreator::new_updateNewAuthorization(_auth_key_id, _date, _device, _location); } inline MTPupdate MTP_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts) { - return MTPupdate(new MTPDupdateNewEncryptedMessage(_message, _qts)); + return MTP::internal::TypeCreator::new_updateNewEncryptedMessage(_message, _qts); } inline MTPupdate MTP_updateEncryptedChatTyping(MTPint _chat_id) { - return MTPupdate(new MTPDupdateEncryptedChatTyping(_chat_id)); + return MTP::internal::TypeCreator::new_updateEncryptedChatTyping(_chat_id); } inline MTPupdate MTP_updateEncryption(const MTPEncryptedChat &_chat, MTPint _date) { - return MTPupdate(new MTPDupdateEncryption(_chat, _date)); + return MTP::internal::TypeCreator::new_updateEncryption(_chat, _date); } inline MTPupdate MTP_updateEncryptedMessagesRead(MTPint _chat_id, MTPint _max_date, MTPint _date) { - return MTPupdate(new MTPDupdateEncryptedMessagesRead(_chat_id, _max_date, _date)); + return MTP::internal::TypeCreator::new_updateEncryptedMessagesRead(_chat_id, _max_date, _date); } inline MTPupdate MTP_updateChatParticipantAdd(MTPint _chat_id, MTPint _user_id, MTPint _inviter_id, MTPint _date, MTPint _version) { - return MTPupdate(new MTPDupdateChatParticipantAdd(_chat_id, _user_id, _inviter_id, _date, _version)); + return MTP::internal::TypeCreator::new_updateChatParticipantAdd(_chat_id, _user_id, _inviter_id, _date, _version); } inline MTPupdate MTP_updateChatParticipantDelete(MTPint _chat_id, MTPint _user_id, MTPint _version) { - return MTPupdate(new MTPDupdateChatParticipantDelete(_chat_id, _user_id, _version)); + return MTP::internal::TypeCreator::new_updateChatParticipantDelete(_chat_id, _user_id, _version); } inline MTPupdate MTP_updateDcOptions(const MTPVector &_dc_options) { - return MTPupdate(new MTPDupdateDcOptions(_dc_options)); + return MTP::internal::TypeCreator::new_updateDcOptions(_dc_options); } inline MTPupdate MTP_updateUserBlocked(MTPint _user_id, MTPBool _blocked) { - return MTPupdate(new MTPDupdateUserBlocked(_user_id, _blocked)); + return MTP::internal::TypeCreator::new_updateUserBlocked(_user_id, _blocked); } inline MTPupdate MTP_updateNotifySettings(const MTPNotifyPeer &_peer, const MTPPeerNotifySettings &_notify_settings) { - return MTPupdate(new MTPDupdateNotifySettings(_peer, _notify_settings)); + return MTP::internal::TypeCreator::new_updateNotifySettings(_peer, _notify_settings); } inline MTPupdate MTP_updateServiceNotification(const MTPstring &_type, const MTPstring &_message, const MTPMessageMedia &_media, MTPBool _popup) { - return MTPupdate(new MTPDupdateServiceNotification(_type, _message, _media, _popup)); + return MTP::internal::TypeCreator::new_updateServiceNotification(_type, _message, _media, _popup); } inline MTPupdate MTP_updatePrivacy(const MTPPrivacyKey &_key, const MTPVector &_rules) { - return MTPupdate(new MTPDupdatePrivacy(_key, _rules)); + return MTP::internal::TypeCreator::new_updatePrivacy(_key, _rules); } inline MTPupdate MTP_updateUserPhone(MTPint _user_id, const MTPstring &_phone) { - return MTPupdate(new MTPDupdateUserPhone(_user_id, _phone)); + return MTP::internal::TypeCreator::new_updateUserPhone(_user_id, _phone); } inline MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateReadHistoryInbox(_peer, _max_id, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateReadHistoryInbox(_peer, _max_id, _pts, _pts_count); } inline MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateReadHistoryOutbox(_peer, _max_id, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateReadHistoryOutbox(_peer, _max_id, _pts, _pts_count); } inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateWebPage(_webpage, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateWebPage(_webpage, _pts, _pts_count); } inline MTPupdate MTP_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateReadMessagesContents(_messages, _pts, _pts_count); } -inline MTPupdate MTP_updateChannelTooLong(MTPint _flags, MTPint _channel_id, MTPint _pts) { - return MTPupdate(new MTPDupdateChannelTooLong(_flags, _channel_id, _pts)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateChannelTooLong::Flags) +inline MTPupdate MTP_updateChannelTooLong(const MTPflags &_flags, MTPint _channel_id, MTPint _pts) { + return MTP::internal::TypeCreator::new_updateChannelTooLong(_flags, _channel_id, _pts); } inline MTPupdate MTP_updateChannel(MTPint _channel_id) { - return MTPupdate(new MTPDupdateChannel(_channel_id)); + return MTP::internal::TypeCreator::new_updateChannel(_channel_id); } inline MTPupdate MTP_updateChannelGroup(MTPint _channel_id, const MTPMessageGroup &_group) { - return MTPupdate(new MTPDupdateChannelGroup(_channel_id, _group)); + return MTP::internal::TypeCreator::new_updateChannelGroup(_channel_id, _group); } inline MTPupdate MTP_updateNewChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateNewChannelMessage(_message, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateNewChannelMessage(_message, _pts, _pts_count); } inline MTPupdate MTP_updateReadChannelInbox(MTPint _channel_id, MTPint _max_id) { - return MTPupdate(new MTPDupdateReadChannelInbox(_channel_id, _max_id)); + return MTP::internal::TypeCreator::new_updateReadChannelInbox(_channel_id, _max_id); } inline MTPupdate MTP_updateDeleteChannelMessages(MTPint _channel_id, const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateDeleteChannelMessages(_channel_id, _messages, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateDeleteChannelMessages(_channel_id, _messages, _pts, _pts_count); } inline MTPupdate MTP_updateChannelMessageViews(MTPint _channel_id, MTPint _id, MTPint _views) { - return MTPupdate(new MTPDupdateChannelMessageViews(_channel_id, _id, _views)); + return MTP::internal::TypeCreator::new_updateChannelMessageViews(_channel_id, _id, _views); } inline MTPupdate MTP_updateChatAdmins(MTPint _chat_id, MTPBool _enabled, MTPint _version) { - return MTPupdate(new MTPDupdateChatAdmins(_chat_id, _enabled, _version)); + return MTP::internal::TypeCreator::new_updateChatAdmins(_chat_id, _enabled, _version); } inline MTPupdate MTP_updateChatParticipantAdmin(MTPint _chat_id, MTPint _user_id, MTPBool _is_admin, MTPint _version) { - return MTPupdate(new MTPDupdateChatParticipantAdmin(_chat_id, _user_id, _is_admin, _version)); + return MTP::internal::TypeCreator::new_updateChatParticipantAdmin(_chat_id, _user_id, _is_admin, _version); } inline MTPupdate MTP_updateNewStickerSet(const MTPmessages_StickerSet &_stickerset) { - return MTPupdate(new MTPDupdateNewStickerSet(_stickerset)); + return MTP::internal::TypeCreator::new_updateNewStickerSet(_stickerset); } inline MTPupdate MTP_updateStickerSetsOrder(const MTPVector &_order) { - return MTPupdate(new MTPDupdateStickerSetsOrder(_order)); + return MTP::internal::TypeCreator::new_updateStickerSetsOrder(_order); } inline MTPupdate MTP_updateStickerSets() { - return MTPupdate(mtpc_updateStickerSets); + return MTP::internal::TypeCreator::new_updateStickerSets(); } inline MTPupdate MTP_updateSavedGifs() { - return MTPupdate(mtpc_updateSavedGifs); + return MTP::internal::TypeCreator::new_updateSavedGifs(); } inline MTPupdate MTP_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user_id, const MTPstring &_query, const MTPstring &_offset) { - return MTPupdate(new MTPDupdateBotInlineQuery(_query_id, _user_id, _query, _offset)); + return MTP::internal::TypeCreator::new_updateBotInlineQuery(_query_id, _user_id, _query, _offset); } inline MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { - return MTPupdate(new MTPDupdateBotInlineSend(_user_id, _query, _id)); + return MTP::internal::TypeCreator::new_updateBotInlineSend(_user_id, _query, _id); } inline MTPupdate MTP_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { - return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); + return MTP::internal::TypeCreator::new_updateEditChannelMessage(_message, _pts, _pts_count); } inline MTPupdate MTP_updateChannelPinnedMessage(MTPint _channel_id, MTPint _id) { - return MTPupdate(new MTPDupdateChannelPinnedMessage(_channel_id, _id)); + return MTP::internal::TypeCreator::new_updateChannelPinnedMessage(_channel_id, _id); } inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { @@ -26663,7 +28155,7 @@ inline void MTPupdates_state::write(mtpBuffer &to) const { inline MTPupdates_state::MTPupdates_state(MTPDupdates_state *_data) : mtpDataOwner(_data) { } inline MTPupdates_state MTP_updates_state(MTPint _pts, MTPint _qts, MTPint _date, MTPint _seq, MTPint _unread_count) { - return MTPupdates_state(new MTPDupdates_state(_pts, _qts, _date, _seq, _unread_count)); + return MTP::internal::TypeCreator::new_updates_state(_pts, _qts, _date, _seq, _unread_count); } inline uint32 MTPupdates_difference::innerLength() const { @@ -26761,13 +28253,13 @@ inline MTPupdates_difference::MTPupdates_difference(MTPDupdates_difference *_dat inline MTPupdates_difference::MTPupdates_difference(MTPDupdates_differenceSlice *_data) : mtpDataOwner(_data), _type(mtpc_updates_differenceSlice) { } inline MTPupdates_difference MTP_updates_differenceEmpty(MTPint _date, MTPint _seq) { - return MTPupdates_difference(new MTPDupdates_differenceEmpty(_date, _seq)); + return MTP::internal::TypeCreator::new_updates_differenceEmpty(_date, _seq); } inline MTPupdates_difference MTP_updates_difference(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_state) { - return MTPupdates_difference(new MTPDupdates_difference(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _state)); + return MTP::internal::TypeCreator::new_updates_difference(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _state); } inline MTPupdates_difference MTP_updates_differenceSlice(const MTPVector &_new_messages, const MTPVector &_new_encrypted_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users, const MTPupdates_State &_intermediate_state) { - return MTPupdates_difference(new MTPDupdates_differenceSlice(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _intermediate_state)); + return MTP::internal::TypeCreator::new_updates_differenceSlice(_new_messages, _new_encrypted_messages, _other_updates, _chats, _users, _intermediate_state); } inline uint32 MTPupdates::innerLength() const { @@ -26967,25 +28459,28 @@ inline MTPupdates::MTPupdates(MTPDupdates *_data) : mtpDataOwner(_data), _type(m inline MTPupdates::MTPupdates(MTPDupdateShortSentMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateShortSentMessage) { } inline MTPupdates MTP_updatesTooLong() { - return MTPupdates(mtpc_updatesTooLong); + return MTP::internal::TypeCreator::new_updatesTooLong(); } -inline MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { - return MTPupdates(new MTPDupdateShortMessage(_flags, _id, _user_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateShortMessage::Flags) +inline MTPupdates MTP_updateShortMessage(const MTPflags &_flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_updateShortMessage(_flags, _id, _user_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities); } -inline MTPupdates MTP_updateShortChatMessage(MTPint _flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { - return MTPupdates(new MTPDupdateShortChatMessage(_flags, _id, _from_id, _chat_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateShortChatMessage::Flags) +inline MTPupdates MTP_updateShortChatMessage(const MTPflags &_flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageFwdHeader &_fwd_from, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_updateShortChatMessage(_flags, _id, _from_id, _chat_id, _message, _pts, _pts_count, _date, _fwd_from, _via_bot_id, _reply_to_msg_id, _entities); } inline MTPupdates MTP_updateShort(const MTPUpdate &_update, MTPint _date) { - return MTPupdates(new MTPDupdateShort(_update, _date)); + return MTP::internal::TypeCreator::new_updateShort(_update, _date); } inline MTPupdates MTP_updatesCombined(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq_start, MTPint _seq) { - return MTPupdates(new MTPDupdatesCombined(_updates, _users, _chats, _date, _seq_start, _seq)); + return MTP::internal::TypeCreator::new_updatesCombined(_updates, _users, _chats, _date, _seq_start, _seq); } inline MTPupdates MTP_updates(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq) { - return MTPupdates(new MTPDupdates(_updates, _users, _chats, _date, _seq)); + return MTP::internal::TypeCreator::new_updates(_updates, _users, _chats, _date, _seq); } -inline MTPupdates MTP_updateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) { - return MTPupdates(new MTPDupdateShortSentMessage(_flags, _id, _pts, _pts_count, _date, _media, _entities)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdateShortSentMessage::Flags) +inline MTPupdates MTP_updateShortSentMessage(const MTPflags &_flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_updateShortSentMessage(_flags, _id, _pts, _pts_count, _date, _media, _entities); } inline uint32 MTPphotos_photos::innerLength() const { @@ -27051,10 +28546,10 @@ inline MTPphotos_photos::MTPphotos_photos(MTPDphotos_photos *_data) : mtpDataOwn inline MTPphotos_photos::MTPphotos_photos(MTPDphotos_photosSlice *_data) : mtpDataOwner(_data), _type(mtpc_photos_photosSlice) { } inline MTPphotos_photos MTP_photos_photos(const MTPVector &_photos, const MTPVector &_users) { - return MTPphotos_photos(new MTPDphotos_photos(_photos, _users)); + return MTP::internal::TypeCreator::new_photos_photos(_photos, _users); } inline MTPphotos_photos MTP_photos_photosSlice(MTPint _count, const MTPVector &_photos, const MTPVector &_users) { - return MTPphotos_photos(new MTPDphotos_photosSlice(_count, _photos, _users)); + return MTP::internal::TypeCreator::new_photos_photosSlice(_count, _photos, _users); } inline MTPphotos_photo::MTPphotos_photo() : mtpDataOwner(new MTPDphotos_photo()) { @@ -27083,7 +28578,7 @@ inline void MTPphotos_photo::write(mtpBuffer &to) const { inline MTPphotos_photo::MTPphotos_photo(MTPDphotos_photo *_data) : mtpDataOwner(_data) { } inline MTPphotos_photo MTP_photos_photo(const MTPPhoto &_photo, const MTPVector &_users) { - return MTPphotos_photo(new MTPDphotos_photo(_photo, _users)); + return MTP::internal::TypeCreator::new_photos_photo(_photo, _users); } inline MTPupload_file::MTPupload_file() : mtpDataOwner(new MTPDupload_file()) { @@ -27114,7 +28609,7 @@ inline void MTPupload_file::write(mtpBuffer &to) const { inline MTPupload_file::MTPupload_file(MTPDupload_file *_data) : mtpDataOwner(_data) { } inline MTPupload_file MTP_upload_file(const MTPstorage_FileType &_type, MTPint _mtime, const MTPbytes &_bytes) { - return MTPupload_file(new MTPDupload_file(_type, _mtime, _bytes)); + return MTP::internal::TypeCreator::new_upload_file(_type, _mtime, _bytes); } inline MTPdcOption::MTPdcOption() : mtpDataOwner(new MTPDdcOption()) { @@ -27146,8 +28641,9 @@ inline void MTPdcOption::write(mtpBuffer &to) const { } inline MTPdcOption::MTPdcOption(MTPDdcOption *_data) : mtpDataOwner(_data) { } -inline MTPdcOption MTP_dcOption(MTPint _flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) { - return MTPdcOption(new MTPDdcOption(_flags, _id, _ip_address, _port)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDdcOption::Flags) +inline MTPdcOption MTP_dcOption(const MTPflags &_flags, MTPint _id, const MTPstring &_ip_address, MTPint _port) { + return MTP::internal::TypeCreator::new_dcOption(_flags, _id, _ip_address, _port); } inline MTPconfig::MTPconfig() : mtpDataOwner(new MTPDconfig()) { @@ -27212,7 +28708,7 @@ inline void MTPconfig::write(mtpBuffer &to) const { inline MTPconfig::MTPconfig(MTPDconfig *_data) : mtpDataOwner(_data) { } inline MTPconfig MTP_config(MTPint _date, MTPint _expires, MTPBool _test_mode, MTPint _this_dc, const MTPVector &_dc_options, MTPint _chat_size_max, MTPint _megagroup_size_max, MTPint _forwarded_count_max, MTPint _online_update_period_ms, MTPint _offline_blur_timeout_ms, MTPint _offline_idle_timeout_ms, MTPint _online_cloud_timeout_ms, MTPint _notify_cloud_delay_ms, MTPint _notify_default_delay_ms, MTPint _chat_big_size, MTPint _push_chat_period_ms, MTPint _push_chat_limit, MTPint _saved_gifs_limit, MTPint _edit_time_limit, const MTPVector &_disabled_features) { - return MTPconfig(new MTPDconfig(_date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _disabled_features)); + return MTP::internal::TypeCreator::new_config(_date, _expires, _test_mode, _this_dc, _dc_options, _chat_size_max, _megagroup_size_max, _forwarded_count_max, _online_update_period_ms, _offline_blur_timeout_ms, _offline_idle_timeout_ms, _online_cloud_timeout_ms, _notify_cloud_delay_ms, _notify_default_delay_ms, _chat_big_size, _push_chat_period_ms, _push_chat_limit, _saved_gifs_limit, _edit_time_limit, _disabled_features); } inline MTPnearestDc::MTPnearestDc() : mtpDataOwner(new MTPDnearestDc()) { @@ -27243,7 +28739,7 @@ inline void MTPnearestDc::write(mtpBuffer &to) const { inline MTPnearestDc::MTPnearestDc(MTPDnearestDc *_data) : mtpDataOwner(_data) { } inline MTPnearestDc MTP_nearestDc(const MTPstring &_country, MTPint _this_dc, MTPint _nearest_dc) { - return MTPnearestDc(new MTPDnearestDc(_country, _this_dc, _nearest_dc)); + return MTP::internal::TypeCreator::new_nearestDc(_country, _this_dc, _nearest_dc); } inline uint32 MTPhelp_appUpdate::innerLength() const { @@ -27295,10 +28791,10 @@ inline MTPhelp_appUpdate::MTPhelp_appUpdate(mtpTypeId type) : mtpDataOwner(0), _ inline MTPhelp_appUpdate::MTPhelp_appUpdate(MTPDhelp_appUpdate *_data) : mtpDataOwner(_data), _type(mtpc_help_appUpdate) { } inline MTPhelp_appUpdate MTP_help_appUpdate(MTPint _id, MTPBool _critical, const MTPstring &_url, const MTPstring &_text) { - return MTPhelp_appUpdate(new MTPDhelp_appUpdate(_id, _critical, _url, _text)); + return MTP::internal::TypeCreator::new_help_appUpdate(_id, _critical, _url, _text); } inline MTPhelp_appUpdate MTP_help_noAppUpdate() { - return MTPhelp_appUpdate(mtpc_help_noAppUpdate); + return MTP::internal::TypeCreator::new_help_noAppUpdate(); } inline MTPhelp_inviteText::MTPhelp_inviteText() : mtpDataOwner(new MTPDhelp_inviteText()) { @@ -27325,7 +28821,7 @@ inline void MTPhelp_inviteText::write(mtpBuffer &to) const { inline MTPhelp_inviteText::MTPhelp_inviteText(MTPDhelp_inviteText *_data) : mtpDataOwner(_data) { } inline MTPhelp_inviteText MTP_help_inviteText(const MTPstring &_message) { - return MTPhelp_inviteText(new MTPDhelp_inviteText(_message)); + return MTP::internal::TypeCreator::new_help_inviteText(_message); } inline uint32 MTPencryptedChat::innerLength() const { @@ -27463,19 +28959,19 @@ inline MTPencryptedChat::MTPencryptedChat(MTPDencryptedChat *_data) : mtpDataOwn inline MTPencryptedChat::MTPencryptedChat(MTPDencryptedChatDiscarded *_data) : mtpDataOwner(_data), _type(mtpc_encryptedChatDiscarded) { } inline MTPencryptedChat MTP_encryptedChatEmpty(MTPint _id) { - return MTPencryptedChat(new MTPDencryptedChatEmpty(_id)); + return MTP::internal::TypeCreator::new_encryptedChatEmpty(_id); } inline MTPencryptedChat MTP_encryptedChatWaiting(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id) { - return MTPencryptedChat(new MTPDencryptedChatWaiting(_id, _access_hash, _date, _admin_id, _participant_id)); + return MTP::internal::TypeCreator::new_encryptedChatWaiting(_id, _access_hash, _date, _admin_id, _participant_id); } inline MTPencryptedChat MTP_encryptedChatRequested(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a) { - return MTPencryptedChat(new MTPDencryptedChatRequested(_id, _access_hash, _date, _admin_id, _participant_id, _g_a)); + return MTP::internal::TypeCreator::new_encryptedChatRequested(_id, _access_hash, _date, _admin_id, _participant_id, _g_a); } inline MTPencryptedChat MTP_encryptedChat(MTPint _id, const MTPlong &_access_hash, MTPint _date, MTPint _admin_id, MTPint _participant_id, const MTPbytes &_g_a_or_b, const MTPlong &_key_fingerprint) { - return MTPencryptedChat(new MTPDencryptedChat(_id, _access_hash, _date, _admin_id, _participant_id, _g_a_or_b, _key_fingerprint)); + return MTP::internal::TypeCreator::new_encryptedChat(_id, _access_hash, _date, _admin_id, _participant_id, _g_a_or_b, _key_fingerprint); } inline MTPencryptedChat MTP_encryptedChatDiscarded(MTPint _id) { - return MTPencryptedChat(new MTPDencryptedChatDiscarded(_id)); + return MTP::internal::TypeCreator::new_encryptedChatDiscarded(_id); } inline MTPinputEncryptedChat::MTPinputEncryptedChat() : mtpDataOwner(new MTPDinputEncryptedChat()) { @@ -27504,7 +29000,7 @@ inline void MTPinputEncryptedChat::write(mtpBuffer &to) const { inline MTPinputEncryptedChat::MTPinputEncryptedChat(MTPDinputEncryptedChat *_data) : mtpDataOwner(_data) { } inline MTPinputEncryptedChat MTP_inputEncryptedChat(MTPint _chat_id, const MTPlong &_access_hash) { - return MTPinputEncryptedChat(new MTPDinputEncryptedChat(_chat_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputEncryptedChat(_chat_id, _access_hash); } inline uint32 MTPencryptedFile::innerLength() const { @@ -27558,10 +29054,10 @@ inline MTPencryptedFile::MTPencryptedFile(mtpTypeId type) : mtpDataOwner(0), _ty inline MTPencryptedFile::MTPencryptedFile(MTPDencryptedFile *_data) : mtpDataOwner(_data), _type(mtpc_encryptedFile) { } inline MTPencryptedFile MTP_encryptedFileEmpty() { - return MTPencryptedFile(mtpc_encryptedFileEmpty); + return MTP::internal::TypeCreator::new_encryptedFileEmpty(); } inline MTPencryptedFile MTP_encryptedFile(const MTPlong &_id, const MTPlong &_access_hash, MTPint _size, MTPint _dc_id, MTPint _key_fingerprint) { - return MTPencryptedFile(new MTPDencryptedFile(_id, _access_hash, _size, _dc_id, _key_fingerprint)); + return MTP::internal::TypeCreator::new_encryptedFile(_id, _access_hash, _size, _dc_id, _key_fingerprint); } inline uint32 MTPinputEncryptedFile::innerLength() const { @@ -27651,16 +29147,16 @@ inline MTPinputEncryptedFile::MTPinputEncryptedFile(MTPDinputEncryptedFile *_dat inline MTPinputEncryptedFile::MTPinputEncryptedFile(MTPDinputEncryptedFileBigUploaded *_data) : mtpDataOwner(_data), _type(mtpc_inputEncryptedFileBigUploaded) { } inline MTPinputEncryptedFile MTP_inputEncryptedFileEmpty() { - return MTPinputEncryptedFile(mtpc_inputEncryptedFileEmpty); + return MTP::internal::TypeCreator::new_inputEncryptedFileEmpty(); } inline MTPinputEncryptedFile MTP_inputEncryptedFileUploaded(const MTPlong &_id, MTPint _parts, const MTPstring &_md5_checksum, MTPint _key_fingerprint) { - return MTPinputEncryptedFile(new MTPDinputEncryptedFileUploaded(_id, _parts, _md5_checksum, _key_fingerprint)); + return MTP::internal::TypeCreator::new_inputEncryptedFileUploaded(_id, _parts, _md5_checksum, _key_fingerprint); } inline MTPinputEncryptedFile MTP_inputEncryptedFile(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputEncryptedFile(new MTPDinputEncryptedFile(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputEncryptedFile(_id, _access_hash); } inline MTPinputEncryptedFile MTP_inputEncryptedFileBigUploaded(const MTPlong &_id, MTPint _parts, MTPint _key_fingerprint) { - return MTPinputEncryptedFile(new MTPDinputEncryptedFileBigUploaded(_id, _parts, _key_fingerprint)); + return MTP::internal::TypeCreator::new_inputEncryptedFileBigUploaded(_id, _parts, _key_fingerprint); } inline uint32 MTPencryptedMessage::innerLength() const { @@ -27734,10 +29230,10 @@ inline MTPencryptedMessage::MTPencryptedMessage(MTPDencryptedMessage *_data) : m inline MTPencryptedMessage::MTPencryptedMessage(MTPDencryptedMessageService *_data) : mtpDataOwner(_data), _type(mtpc_encryptedMessageService) { } inline MTPencryptedMessage MTP_encryptedMessage(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes, const MTPEncryptedFile &_file) { - return MTPencryptedMessage(new MTPDencryptedMessage(_random_id, _chat_id, _date, _bytes, _file)); + return MTP::internal::TypeCreator::new_encryptedMessage(_random_id, _chat_id, _date, _bytes, _file); } inline MTPencryptedMessage MTP_encryptedMessageService(const MTPlong &_random_id, MTPint _chat_id, MTPint _date, const MTPbytes &_bytes) { - return MTPencryptedMessage(new MTPDencryptedMessageService(_random_id, _chat_id, _date, _bytes)); + return MTP::internal::TypeCreator::new_encryptedMessageService(_random_id, _chat_id, _date, _bytes); } inline uint32 MTPmessages_dhConfig::innerLength() const { @@ -27803,10 +29299,10 @@ inline MTPmessages_dhConfig::MTPmessages_dhConfig(MTPDmessages_dhConfigNotModifi inline MTPmessages_dhConfig::MTPmessages_dhConfig(MTPDmessages_dhConfig *_data) : mtpDataOwner(_data), _type(mtpc_messages_dhConfig) { } inline MTPmessages_dhConfig MTP_messages_dhConfigNotModified(const MTPbytes &_random) { - return MTPmessages_dhConfig(new MTPDmessages_dhConfigNotModified(_random)); + return MTP::internal::TypeCreator::new_messages_dhConfigNotModified(_random); } inline MTPmessages_dhConfig MTP_messages_dhConfig(MTPint _g, const MTPbytes &_p, MTPint _version, const MTPbytes &_random) { - return MTPmessages_dhConfig(new MTPDmessages_dhConfig(_g, _p, _version, _random)); + return MTP::internal::TypeCreator::new_messages_dhConfig(_g, _p, _version, _random); } inline uint32 MTPmessages_sentEncryptedMessage::innerLength() const { @@ -27868,10 +29364,10 @@ inline MTPmessages_sentEncryptedMessage::MTPmessages_sentEncryptedMessage(MTPDme inline MTPmessages_sentEncryptedMessage::MTPmessages_sentEncryptedMessage(MTPDmessages_sentEncryptedFile *_data) : mtpDataOwner(_data), _type(mtpc_messages_sentEncryptedFile) { } inline MTPmessages_sentEncryptedMessage MTP_messages_sentEncryptedMessage(MTPint _date) { - return MTPmessages_sentEncryptedMessage(new MTPDmessages_sentEncryptedMessage(_date)); + return MTP::internal::TypeCreator::new_messages_sentEncryptedMessage(_date); } inline MTPmessages_sentEncryptedMessage MTP_messages_sentEncryptedFile(MTPint _date, const MTPEncryptedFile &_file) { - return MTPmessages_sentEncryptedMessage(new MTPDmessages_sentEncryptedFile(_date, _file)); + return MTP::internal::TypeCreator::new_messages_sentEncryptedFile(_date, _file); } inline uint32 MTPinputDocument::innerLength() const { @@ -27919,10 +29415,10 @@ inline MTPinputDocument::MTPinputDocument(mtpTypeId type) : mtpDataOwner(0), _ty inline MTPinputDocument::MTPinputDocument(MTPDinputDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputDocument) { } inline MTPinputDocument MTP_inputDocumentEmpty() { - return MTPinputDocument(mtpc_inputDocumentEmpty); + return MTP::internal::TypeCreator::new_inputDocumentEmpty(); } inline MTPinputDocument MTP_inputDocument(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputDocument(new MTPDinputDocument(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputDocument(_id, _access_hash); } inline uint32 MTPdocument::innerLength() const { @@ -27996,10 +29492,10 @@ inline MTPdocument::MTPdocument(MTPDdocumentEmpty *_data) : mtpDataOwner(_data), inline MTPdocument::MTPdocument(MTPDdocument *_data) : mtpDataOwner(_data), _type(mtpc_document) { } inline MTPdocument MTP_documentEmpty(const MTPlong &_id) { - return MTPdocument(new MTPDdocumentEmpty(_id)); + return MTP::internal::TypeCreator::new_documentEmpty(_id); } inline MTPdocument MTP_document(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, const MTPVector &_attributes) { - return MTPdocument(new MTPDdocument(_id, _access_hash, _date, _mime_type, _size, _thumb, _dc_id, _attributes)); + return MTP::internal::TypeCreator::new_document(_id, _access_hash, _date, _mime_type, _size, _thumb, _dc_id, _attributes); } inline MTPhelp_support::MTPhelp_support() : mtpDataOwner(new MTPDhelp_support()) { @@ -28028,7 +29524,7 @@ inline void MTPhelp_support::write(mtpBuffer &to) const { inline MTPhelp_support::MTPhelp_support(MTPDhelp_support *_data) : mtpDataOwner(_data) { } inline MTPhelp_support MTP_help_support(const MTPstring &_phone_number, const MTPUser &_user) { - return MTPhelp_support(new MTPDhelp_support(_phone_number, _user)); + return MTP::internal::TypeCreator::new_help_support(_phone_number, _user); } inline uint32 MTPnotifyPeer::innerLength() const { @@ -28078,16 +29574,16 @@ inline MTPnotifyPeer::MTPnotifyPeer(mtpTypeId type) : mtpDataOwner(0), _type(typ inline MTPnotifyPeer::MTPnotifyPeer(MTPDnotifyPeer *_data) : mtpDataOwner(_data), _type(mtpc_notifyPeer) { } inline MTPnotifyPeer MTP_notifyPeer(const MTPPeer &_peer) { - return MTPnotifyPeer(new MTPDnotifyPeer(_peer)); + return MTP::internal::TypeCreator::new_notifyPeer(_peer); } inline MTPnotifyPeer MTP_notifyUsers() { - return MTPnotifyPeer(mtpc_notifyUsers); + return MTP::internal::TypeCreator::new_notifyUsers(); } inline MTPnotifyPeer MTP_notifyChats() { - return MTPnotifyPeer(mtpc_notifyChats); + return MTP::internal::TypeCreator::new_notifyChats(); } inline MTPnotifyPeer MTP_notifyAll() { - return MTPnotifyPeer(mtpc_notifyAll); + return MTP::internal::TypeCreator::new_notifyAll(); } inline uint32 MTPsendMessageAction::innerLength() const { @@ -28191,34 +29687,34 @@ inline MTPsendMessageAction::MTPsendMessageAction(MTPDsendMessageUploadPhotoActi inline MTPsendMessageAction::MTPsendMessageAction(MTPDsendMessageUploadDocumentAction *_data) : mtpDataOwner(_data), _type(mtpc_sendMessageUploadDocumentAction) { } inline MTPsendMessageAction MTP_sendMessageTypingAction() { - return MTPsendMessageAction(mtpc_sendMessageTypingAction); + return MTP::internal::TypeCreator::new_sendMessageTypingAction(); } inline MTPsendMessageAction MTP_sendMessageCancelAction() { - return MTPsendMessageAction(mtpc_sendMessageCancelAction); + return MTP::internal::TypeCreator::new_sendMessageCancelAction(); } inline MTPsendMessageAction MTP_sendMessageRecordVideoAction() { - return MTPsendMessageAction(mtpc_sendMessageRecordVideoAction); + return MTP::internal::TypeCreator::new_sendMessageRecordVideoAction(); } inline MTPsendMessageAction MTP_sendMessageUploadVideoAction(MTPint _progress) { - return MTPsendMessageAction(new MTPDsendMessageUploadVideoAction(_progress)); + return MTP::internal::TypeCreator::new_sendMessageUploadVideoAction(_progress); } inline MTPsendMessageAction MTP_sendMessageRecordAudioAction() { - return MTPsendMessageAction(mtpc_sendMessageRecordAudioAction); + return MTP::internal::TypeCreator::new_sendMessageRecordAudioAction(); } inline MTPsendMessageAction MTP_sendMessageUploadAudioAction(MTPint _progress) { - return MTPsendMessageAction(new MTPDsendMessageUploadAudioAction(_progress)); + return MTP::internal::TypeCreator::new_sendMessageUploadAudioAction(_progress); } inline MTPsendMessageAction MTP_sendMessageUploadPhotoAction(MTPint _progress) { - return MTPsendMessageAction(new MTPDsendMessageUploadPhotoAction(_progress)); + return MTP::internal::TypeCreator::new_sendMessageUploadPhotoAction(_progress); } inline MTPsendMessageAction MTP_sendMessageUploadDocumentAction(MTPint _progress) { - return MTPsendMessageAction(new MTPDsendMessageUploadDocumentAction(_progress)); + return MTP::internal::TypeCreator::new_sendMessageUploadDocumentAction(_progress); } inline MTPsendMessageAction MTP_sendMessageGeoLocationAction() { - return MTPsendMessageAction(mtpc_sendMessageGeoLocationAction); + return MTP::internal::TypeCreator::new_sendMessageGeoLocationAction(); } inline MTPsendMessageAction MTP_sendMessageChooseContactAction() { - return MTPsendMessageAction(mtpc_sendMessageChooseContactAction); + return MTP::internal::TypeCreator::new_sendMessageChooseContactAction(); } inline MTPcontacts_found::MTPcontacts_found() : mtpDataOwner(new MTPDcontacts_found()) { @@ -28249,7 +29745,7 @@ inline void MTPcontacts_found::write(mtpBuffer &to) const { inline MTPcontacts_found::MTPcontacts_found(MTPDcontacts_found *_data) : mtpDataOwner(_data) { } inline MTPcontacts_found MTP_contacts_found(const MTPVector &_results, const MTPVector &_chats, const MTPVector &_users) { - return MTPcontacts_found(new MTPDcontacts_found(_results, _chats, _users)); + return MTP::internal::TypeCreator::new_contacts_found(_results, _chats, _users); } inline uint32 MTPinputPrivacyKey::innerLength() const { @@ -28278,10 +29774,10 @@ inline MTPinputPrivacyKey::MTPinputPrivacyKey(mtpTypeId type) : _type(type) { } } inline MTPinputPrivacyKey MTP_inputPrivacyKeyStatusTimestamp() { - return MTPinputPrivacyKey(mtpc_inputPrivacyKeyStatusTimestamp); + return MTP::internal::TypeCreator::new_inputPrivacyKeyStatusTimestamp(); } inline MTPinputPrivacyKey MTP_inputPrivacyKeyChatInvite() { - return MTPinputPrivacyKey(mtpc_inputPrivacyKeyChatInvite); + return MTP::internal::TypeCreator::new_inputPrivacyKeyChatInvite(); } inline uint32 MTPprivacyKey::innerLength() const { @@ -28310,10 +29806,10 @@ inline MTPprivacyKey::MTPprivacyKey(mtpTypeId type) : _type(type) { } } inline MTPprivacyKey MTP_privacyKeyStatusTimestamp() { - return MTPprivacyKey(mtpc_privacyKeyStatusTimestamp); + return MTP::internal::TypeCreator::new_privacyKeyStatusTimestamp(); } inline MTPprivacyKey MTP_privacyKeyChatInvite() { - return MTPprivacyKey(mtpc_privacyKeyChatInvite); + return MTP::internal::TypeCreator::new_privacyKeyChatInvite(); } inline uint32 MTPinputPrivacyRule::innerLength() const { @@ -28381,22 +29877,22 @@ inline MTPinputPrivacyRule::MTPinputPrivacyRule(MTPDinputPrivacyValueAllowUsers inline MTPinputPrivacyRule::MTPinputPrivacyRule(MTPDinputPrivacyValueDisallowUsers *_data) : mtpDataOwner(_data), _type(mtpc_inputPrivacyValueDisallowUsers) { } inline MTPinputPrivacyRule MTP_inputPrivacyValueAllowContacts() { - return MTPinputPrivacyRule(mtpc_inputPrivacyValueAllowContacts); + return MTP::internal::TypeCreator::new_inputPrivacyValueAllowContacts(); } inline MTPinputPrivacyRule MTP_inputPrivacyValueAllowAll() { - return MTPinputPrivacyRule(mtpc_inputPrivacyValueAllowAll); + return MTP::internal::TypeCreator::new_inputPrivacyValueAllowAll(); } inline MTPinputPrivacyRule MTP_inputPrivacyValueAllowUsers(const MTPVector &_users) { - return MTPinputPrivacyRule(new MTPDinputPrivacyValueAllowUsers(_users)); + return MTP::internal::TypeCreator::new_inputPrivacyValueAllowUsers(_users); } inline MTPinputPrivacyRule MTP_inputPrivacyValueDisallowContacts() { - return MTPinputPrivacyRule(mtpc_inputPrivacyValueDisallowContacts); + return MTP::internal::TypeCreator::new_inputPrivacyValueDisallowContacts(); } inline MTPinputPrivacyRule MTP_inputPrivacyValueDisallowAll() { - return MTPinputPrivacyRule(mtpc_inputPrivacyValueDisallowAll); + return MTP::internal::TypeCreator::new_inputPrivacyValueDisallowAll(); } inline MTPinputPrivacyRule MTP_inputPrivacyValueDisallowUsers(const MTPVector &_users) { - return MTPinputPrivacyRule(new MTPDinputPrivacyValueDisallowUsers(_users)); + return MTP::internal::TypeCreator::new_inputPrivacyValueDisallowUsers(_users); } inline uint32 MTPprivacyRule::innerLength() const { @@ -28464,22 +29960,22 @@ inline MTPprivacyRule::MTPprivacyRule(MTPDprivacyValueAllowUsers *_data) : mtpDa inline MTPprivacyRule::MTPprivacyRule(MTPDprivacyValueDisallowUsers *_data) : mtpDataOwner(_data), _type(mtpc_privacyValueDisallowUsers) { } inline MTPprivacyRule MTP_privacyValueAllowContacts() { - return MTPprivacyRule(mtpc_privacyValueAllowContacts); + return MTP::internal::TypeCreator::new_privacyValueAllowContacts(); } inline MTPprivacyRule MTP_privacyValueAllowAll() { - return MTPprivacyRule(mtpc_privacyValueAllowAll); + return MTP::internal::TypeCreator::new_privacyValueAllowAll(); } inline MTPprivacyRule MTP_privacyValueAllowUsers(const MTPVector &_users) { - return MTPprivacyRule(new MTPDprivacyValueAllowUsers(_users)); + return MTP::internal::TypeCreator::new_privacyValueAllowUsers(_users); } inline MTPprivacyRule MTP_privacyValueDisallowContacts() { - return MTPprivacyRule(mtpc_privacyValueDisallowContacts); + return MTP::internal::TypeCreator::new_privacyValueDisallowContacts(); } inline MTPprivacyRule MTP_privacyValueDisallowAll() { - return MTPprivacyRule(mtpc_privacyValueDisallowAll); + return MTP::internal::TypeCreator::new_privacyValueDisallowAll(); } inline MTPprivacyRule MTP_privacyValueDisallowUsers(const MTPVector &_users) { - return MTPprivacyRule(new MTPDprivacyValueDisallowUsers(_users)); + return MTP::internal::TypeCreator::new_privacyValueDisallowUsers(_users); } inline MTPaccount_privacyRules::MTPaccount_privacyRules() : mtpDataOwner(new MTPDaccount_privacyRules()) { @@ -28508,7 +30004,7 @@ inline void MTPaccount_privacyRules::write(mtpBuffer &to) const { inline MTPaccount_privacyRules::MTPaccount_privacyRules(MTPDaccount_privacyRules *_data) : mtpDataOwner(_data) { } inline MTPaccount_privacyRules MTP_account_privacyRules(const MTPVector &_rules, const MTPVector &_users) { - return MTPaccount_privacyRules(new MTPDaccount_privacyRules(_rules, _users)); + return MTP::internal::TypeCreator::new_account_privacyRules(_rules, _users); } inline MTPaccountDaysTTL::MTPaccountDaysTTL() : mtpDataOwner(new MTPDaccountDaysTTL()) { @@ -28535,7 +30031,7 @@ inline void MTPaccountDaysTTL::write(mtpBuffer &to) const { inline MTPaccountDaysTTL::MTPaccountDaysTTL(MTPDaccountDaysTTL *_data) : mtpDataOwner(_data) { } inline MTPaccountDaysTTL MTP_accountDaysTTL(MTPint _days) { - return MTPaccountDaysTTL(new MTPDaccountDaysTTL(_days)); + return MTP::internal::TypeCreator::new_accountDaysTTL(_days); } inline uint32 MTPdocumentAttribute::innerLength() const { @@ -28661,22 +30157,23 @@ inline MTPdocumentAttribute::MTPdocumentAttribute(MTPDdocumentAttributeAudio *_d inline MTPdocumentAttribute::MTPdocumentAttribute(MTPDdocumentAttributeFilename *_data) : mtpDataOwner(_data), _type(mtpc_documentAttributeFilename) { } inline MTPdocumentAttribute MTP_documentAttributeImageSize(MTPint _w, MTPint _h) { - return MTPdocumentAttribute(new MTPDdocumentAttributeImageSize(_w, _h)); + return MTP::internal::TypeCreator::new_documentAttributeImageSize(_w, _h); } inline MTPdocumentAttribute MTP_documentAttributeAnimated() { - return MTPdocumentAttribute(mtpc_documentAttributeAnimated); + return MTP::internal::TypeCreator::new_documentAttributeAnimated(); } inline MTPdocumentAttribute MTP_documentAttributeSticker(const MTPstring &_alt, const MTPInputStickerSet &_stickerset) { - return MTPdocumentAttribute(new MTPDdocumentAttributeSticker(_alt, _stickerset)); + return MTP::internal::TypeCreator::new_documentAttributeSticker(_alt, _stickerset); } inline MTPdocumentAttribute MTP_documentAttributeVideo(MTPint _duration, MTPint _w, MTPint _h) { - return MTPdocumentAttribute(new MTPDdocumentAttributeVideo(_duration, _w, _h)); + return MTP::internal::TypeCreator::new_documentAttributeVideo(_duration, _w, _h); } -inline MTPdocumentAttribute MTP_documentAttributeAudio(MTPint _flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform) { - return MTPdocumentAttribute(new MTPDdocumentAttributeAudio(_flags, _duration, _title, _performer, _waveform)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDdocumentAttributeAudio::Flags) +inline MTPdocumentAttribute MTP_documentAttributeAudio(const MTPflags &_flags, MTPint _duration, const MTPstring &_title, const MTPstring &_performer, const MTPbytes &_waveform) { + return MTP::internal::TypeCreator::new_documentAttributeAudio(_flags, _duration, _title, _performer, _waveform); } inline MTPdocumentAttribute MTP_documentAttributeFilename(const MTPstring &_file_name) { - return MTPdocumentAttribute(new MTPDdocumentAttributeFilename(_file_name)); + return MTP::internal::TypeCreator::new_documentAttributeFilename(_file_name); } inline uint32 MTPmessages_stickers::innerLength() const { @@ -28724,10 +30221,10 @@ inline MTPmessages_stickers::MTPmessages_stickers(mtpTypeId type) : mtpDataOwner inline MTPmessages_stickers::MTPmessages_stickers(MTPDmessages_stickers *_data) : mtpDataOwner(_data), _type(mtpc_messages_stickers) { } inline MTPmessages_stickers MTP_messages_stickersNotModified() { - return MTPmessages_stickers(mtpc_messages_stickersNotModified); + return MTP::internal::TypeCreator::new_messages_stickersNotModified(); } inline MTPmessages_stickers MTP_messages_stickers(const MTPstring &_hash, const MTPVector &_stickers) { - return MTPmessages_stickers(new MTPDmessages_stickers(_hash, _stickers)); + return MTP::internal::TypeCreator::new_messages_stickers(_hash, _stickers); } inline MTPstickerPack::MTPstickerPack() : mtpDataOwner(new MTPDstickerPack()) { @@ -28756,7 +30253,7 @@ inline void MTPstickerPack::write(mtpBuffer &to) const { inline MTPstickerPack::MTPstickerPack(MTPDstickerPack *_data) : mtpDataOwner(_data) { } inline MTPstickerPack MTP_stickerPack(const MTPstring &_emoticon, const MTPVector &_documents) { - return MTPstickerPack(new MTPDstickerPack(_emoticon, _documents)); + return MTP::internal::TypeCreator::new_stickerPack(_emoticon, _documents); } inline uint32 MTPmessages_allStickers::innerLength() const { @@ -28804,10 +30301,10 @@ inline MTPmessages_allStickers::MTPmessages_allStickers(mtpTypeId type) : mtpDat inline MTPmessages_allStickers::MTPmessages_allStickers(MTPDmessages_allStickers *_data) : mtpDataOwner(_data), _type(mtpc_messages_allStickers) { } inline MTPmessages_allStickers MTP_messages_allStickersNotModified() { - return MTPmessages_allStickers(mtpc_messages_allStickersNotModified); + return MTP::internal::TypeCreator::new_messages_allStickersNotModified(); } inline MTPmessages_allStickers MTP_messages_allStickers(MTPint _hash, const MTPVector &_sets) { - return MTPmessages_allStickers(new MTPDmessages_allStickers(_hash, _sets)); + return MTP::internal::TypeCreator::new_messages_allStickers(_hash, _sets); } inline MTPdisabledFeature::MTPdisabledFeature() : mtpDataOwner(new MTPDdisabledFeature()) { @@ -28836,7 +30333,7 @@ inline void MTPdisabledFeature::write(mtpBuffer &to) const { inline MTPdisabledFeature::MTPdisabledFeature(MTPDdisabledFeature *_data) : mtpDataOwner(_data) { } inline MTPdisabledFeature MTP_disabledFeature(const MTPstring &_feature, const MTPstring &_description) { - return MTPdisabledFeature(new MTPDdisabledFeature(_feature, _description)); + return MTP::internal::TypeCreator::new_disabledFeature(_feature, _description); } inline MTPmessages_affectedMessages::MTPmessages_affectedMessages() : mtpDataOwner(new MTPDmessages_affectedMessages()) { @@ -28865,7 +30362,7 @@ inline void MTPmessages_affectedMessages::write(mtpBuffer &to) const { inline MTPmessages_affectedMessages::MTPmessages_affectedMessages(MTPDmessages_affectedMessages *_data) : mtpDataOwner(_data) { } inline MTPmessages_affectedMessages MTP_messages_affectedMessages(MTPint _pts, MTPint _pts_count) { - return MTPmessages_affectedMessages(new MTPDmessages_affectedMessages(_pts, _pts_count)); + return MTP::internal::TypeCreator::new_messages_affectedMessages(_pts, _pts_count); } inline uint32 MTPcontactLink::innerLength() const { @@ -28898,16 +30395,16 @@ inline MTPcontactLink::MTPcontactLink(mtpTypeId type) : _type(type) { } } inline MTPcontactLink MTP_contactLinkUnknown() { - return MTPcontactLink(mtpc_contactLinkUnknown); + return MTP::internal::TypeCreator::new_contactLinkUnknown(); } inline MTPcontactLink MTP_contactLinkNone() { - return MTPcontactLink(mtpc_contactLinkNone); + return MTP::internal::TypeCreator::new_contactLinkNone(); } inline MTPcontactLink MTP_contactLinkHasPhone() { - return MTPcontactLink(mtpc_contactLinkHasPhone); + return MTP::internal::TypeCreator::new_contactLinkHasPhone(); } inline MTPcontactLink MTP_contactLinkContact() { - return MTPcontactLink(mtpc_contactLinkContact); + return MTP::internal::TypeCreator::new_contactLinkContact(); } inline uint32 MTPwebPage::innerLength() const { @@ -29015,13 +30512,14 @@ inline MTPwebPage::MTPwebPage(MTPDwebPagePending *_data) : mtpDataOwner(_data), inline MTPwebPage::MTPwebPage(MTPDwebPage *_data) : mtpDataOwner(_data), _type(mtpc_webPage) { } inline MTPwebPage MTP_webPageEmpty(const MTPlong &_id) { - return MTPwebPage(new MTPDwebPageEmpty(_id)); + return MTP::internal::TypeCreator::new_webPageEmpty(_id); } inline MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date) { - return MTPwebPage(new MTPDwebPagePending(_id, _date)); + return MTP::internal::TypeCreator::new_webPagePending(_id, _date); } -inline MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) { - return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDwebPage::Flags) +inline MTPwebPage MTP_webPage(const MTPflags &_flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) { + return MTP::internal::TypeCreator::new_webPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document); } inline MTPauthorization::MTPauthorization() : mtpDataOwner(new MTPDauthorization()) { @@ -29072,7 +30570,7 @@ inline void MTPauthorization::write(mtpBuffer &to) const { inline MTPauthorization::MTPauthorization(MTPDauthorization *_data) : mtpDataOwner(_data) { } inline MTPauthorization MTP_authorization(const MTPlong &_hash, MTPint _flags, const MTPstring &_device_model, const MTPstring &_platform, const MTPstring &_system_version, MTPint _api_id, const MTPstring &_app_name, const MTPstring &_app_version, MTPint _date_created, MTPint _date_active, const MTPstring &_ip, const MTPstring &_country, const MTPstring &_region) { - return MTPauthorization(new MTPDauthorization(_hash, _flags, _device_model, _platform, _system_version, _api_id, _app_name, _app_version, _date_created, _date_active, _ip, _country, _region)); + return MTP::internal::TypeCreator::new_authorization(_hash, _flags, _device_model, _platform, _system_version, _api_id, _app_name, _app_version, _date_created, _date_active, _ip, _country, _region); } inline MTPaccount_authorizations::MTPaccount_authorizations() : mtpDataOwner(new MTPDaccount_authorizations()) { @@ -29099,7 +30597,7 @@ inline void MTPaccount_authorizations::write(mtpBuffer &to) const { inline MTPaccount_authorizations::MTPaccount_authorizations(MTPDaccount_authorizations *_data) : mtpDataOwner(_data) { } inline MTPaccount_authorizations MTP_account_authorizations(const MTPVector &_authorizations) { - return MTPaccount_authorizations(new MTPDaccount_authorizations(_authorizations)); + return MTP::internal::TypeCreator::new_account_authorizations(_authorizations); } inline uint32 MTPaccount_password::innerLength() const { @@ -29169,10 +30667,10 @@ inline MTPaccount_password::MTPaccount_password(MTPDaccount_noPassword *_data) : inline MTPaccount_password::MTPaccount_password(MTPDaccount_password *_data) : mtpDataOwner(_data), _type(mtpc_account_password) { } inline MTPaccount_password MTP_account_noPassword(const MTPbytes &_new_salt, const MTPstring &_email_unconfirmed_pattern) { - return MTPaccount_password(new MTPDaccount_noPassword(_new_salt, _email_unconfirmed_pattern)); + return MTP::internal::TypeCreator::new_account_noPassword(_new_salt, _email_unconfirmed_pattern); } inline MTPaccount_password MTP_account_password(const MTPbytes &_current_salt, const MTPbytes &_new_salt, const MTPstring &_hint, MTPBool _has_recovery, const MTPstring &_email_unconfirmed_pattern) { - return MTPaccount_password(new MTPDaccount_password(_current_salt, _new_salt, _hint, _has_recovery, _email_unconfirmed_pattern)); + return MTP::internal::TypeCreator::new_account_password(_current_salt, _new_salt, _hint, _has_recovery, _email_unconfirmed_pattern); } inline MTPaccount_passwordSettings::MTPaccount_passwordSettings() : mtpDataOwner(new MTPDaccount_passwordSettings()) { @@ -29199,7 +30697,7 @@ inline void MTPaccount_passwordSettings::write(mtpBuffer &to) const { inline MTPaccount_passwordSettings::MTPaccount_passwordSettings(MTPDaccount_passwordSettings *_data) : mtpDataOwner(_data) { } inline MTPaccount_passwordSettings MTP_account_passwordSettings(const MTPstring &_email) { - return MTPaccount_passwordSettings(new MTPDaccount_passwordSettings(_email)); + return MTP::internal::TypeCreator::new_account_passwordSettings(_email); } inline MTPaccount_passwordInputSettings::MTPaccount_passwordInputSettings() : mtpDataOwner(new MTPDaccount_passwordInputSettings()) { @@ -29233,8 +30731,9 @@ inline void MTPaccount_passwordInputSettings::write(mtpBuffer &to) const { } inline MTPaccount_passwordInputSettings::MTPaccount_passwordInputSettings(MTPDaccount_passwordInputSettings *_data) : mtpDataOwner(_data) { } -inline MTPaccount_passwordInputSettings MTP_account_passwordInputSettings(MTPint _flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email) { - return MTPaccount_passwordInputSettings(new MTPDaccount_passwordInputSettings(_flags, _new_salt, _new_password_hash, _hint, _email)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDaccount_passwordInputSettings::Flags) +inline MTPaccount_passwordInputSettings MTP_account_passwordInputSettings(const MTPflags &_flags, const MTPbytes &_new_salt, const MTPbytes &_new_password_hash, const MTPstring &_hint, const MTPstring &_email) { + return MTP::internal::TypeCreator::new_account_passwordInputSettings(_flags, _new_salt, _new_password_hash, _hint, _email); } inline MTPauth_passwordRecovery::MTPauth_passwordRecovery() : mtpDataOwner(new MTPDauth_passwordRecovery()) { @@ -29261,7 +30760,7 @@ inline void MTPauth_passwordRecovery::write(mtpBuffer &to) const { inline MTPauth_passwordRecovery::MTPauth_passwordRecovery(MTPDauth_passwordRecovery *_data) : mtpDataOwner(_data) { } inline MTPauth_passwordRecovery MTP_auth_passwordRecovery(const MTPstring &_email_pattern) { - return MTPauth_passwordRecovery(new MTPDauth_passwordRecovery(_email_pattern)); + return MTP::internal::TypeCreator::new_auth_passwordRecovery(_email_pattern); } inline MTPreceivedNotifyMessage::MTPreceivedNotifyMessage() : mtpDataOwner(new MTPDreceivedNotifyMessage()) { @@ -29290,7 +30789,7 @@ inline void MTPreceivedNotifyMessage::write(mtpBuffer &to) const { inline MTPreceivedNotifyMessage::MTPreceivedNotifyMessage(MTPDreceivedNotifyMessage *_data) : mtpDataOwner(_data) { } inline MTPreceivedNotifyMessage MTP_receivedNotifyMessage(MTPint _id, MTPint _flags) { - return MTPreceivedNotifyMessage(new MTPDreceivedNotifyMessage(_id, _flags)); + return MTP::internal::TypeCreator::new_receivedNotifyMessage(_id, _flags); } inline uint32 MTPexportedChatInvite::innerLength() const { @@ -29336,10 +30835,10 @@ inline MTPexportedChatInvite::MTPexportedChatInvite(mtpTypeId type) : mtpDataOwn inline MTPexportedChatInvite::MTPexportedChatInvite(MTPDchatInviteExported *_data) : mtpDataOwner(_data), _type(mtpc_chatInviteExported) { } inline MTPexportedChatInvite MTP_chatInviteEmpty() { - return MTPexportedChatInvite(mtpc_chatInviteEmpty); + return MTP::internal::TypeCreator::new_chatInviteEmpty(); } inline MTPexportedChatInvite MTP_chatInviteExported(const MTPstring &_link) { - return MTPexportedChatInvite(new MTPDchatInviteExported(_link)); + return MTP::internal::TypeCreator::new_chatInviteExported(_link); } inline uint32 MTPchatInvite::innerLength() const { @@ -29401,10 +30900,11 @@ inline MTPchatInvite::MTPchatInvite(MTPDchatInviteAlready *_data) : mtpDataOwner inline MTPchatInvite::MTPchatInvite(MTPDchatInvite *_data) : mtpDataOwner(_data), _type(mtpc_chatInvite) { } inline MTPchatInvite MTP_chatInviteAlready(const MTPChat &_chat) { - return MTPchatInvite(new MTPDchatInviteAlready(_chat)); + return MTP::internal::TypeCreator::new_chatInviteAlready(_chat); } -inline MTPchatInvite MTP_chatInvite(MTPint _flags, const MTPstring &_title) { - return MTPchatInvite(new MTPDchatInvite(_flags, _title)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchatInvite::Flags) +inline MTPchatInvite MTP_chatInvite(const MTPflags &_flags, const MTPstring &_title) { + return MTP::internal::TypeCreator::new_chatInvite(_flags, _title); } inline uint32 MTPinputStickerSet::innerLength() const { @@ -29468,13 +30968,13 @@ inline MTPinputStickerSet::MTPinputStickerSet(MTPDinputStickerSetID *_data) : mt inline MTPinputStickerSet::MTPinputStickerSet(MTPDinputStickerSetShortName *_data) : mtpDataOwner(_data), _type(mtpc_inputStickerSetShortName) { } inline MTPinputStickerSet MTP_inputStickerSetEmpty() { - return MTPinputStickerSet(mtpc_inputStickerSetEmpty); + return MTP::internal::TypeCreator::new_inputStickerSetEmpty(); } inline MTPinputStickerSet MTP_inputStickerSetID(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputStickerSet(new MTPDinputStickerSetID(_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputStickerSetID(_id, _access_hash); } inline MTPinputStickerSet MTP_inputStickerSetShortName(const MTPstring &_short_name) { - return MTPinputStickerSet(new MTPDinputStickerSetShortName(_short_name)); + return MTP::internal::TypeCreator::new_inputStickerSetShortName(_short_name); } inline MTPstickerSet::MTPstickerSet() : mtpDataOwner(new MTPDstickerSet()) { @@ -29512,8 +31012,9 @@ inline void MTPstickerSet::write(mtpBuffer &to) const { } inline MTPstickerSet::MTPstickerSet(MTPDstickerSet *_data) : mtpDataOwner(_data) { } -inline MTPstickerSet MTP_stickerSet(MTPint _flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash) { - return MTPstickerSet(new MTPDstickerSet(_flags, _id, _access_hash, _title, _short_name, _count, _hash)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDstickerSet::Flags) +inline MTPstickerSet MTP_stickerSet(const MTPflags &_flags, const MTPlong &_id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_short_name, MTPint _count, MTPint _hash) { + return MTP::internal::TypeCreator::new_stickerSet(_flags, _id, _access_hash, _title, _short_name, _count, _hash); } inline MTPmessages_stickerSet::MTPmessages_stickerSet() : mtpDataOwner(new MTPDmessages_stickerSet()) { @@ -29544,7 +31045,7 @@ inline void MTPmessages_stickerSet::write(mtpBuffer &to) const { inline MTPmessages_stickerSet::MTPmessages_stickerSet(MTPDmessages_stickerSet *_data) : mtpDataOwner(_data) { } inline MTPmessages_stickerSet MTP_messages_stickerSet(const MTPStickerSet &_set, const MTPVector &_packs, const MTPVector &_documents) { - return MTPmessages_stickerSet(new MTPDmessages_stickerSet(_set, _packs, _documents)); + return MTP::internal::TypeCreator::new_messages_stickerSet(_set, _packs, _documents); } inline MTPbotCommand::MTPbotCommand() : mtpDataOwner(new MTPDbotCommand()) { @@ -29573,7 +31074,7 @@ inline void MTPbotCommand::write(mtpBuffer &to) const { inline MTPbotCommand::MTPbotCommand(MTPDbotCommand *_data) : mtpDataOwner(_data) { } inline MTPbotCommand MTP_botCommand(const MTPstring &_command, const MTPstring &_description) { - return MTPbotCommand(new MTPDbotCommand(_command, _description)); + return MTP::internal::TypeCreator::new_botCommand(_command, _description); } inline MTPbotInfo::MTPbotInfo() : mtpDataOwner(new MTPDbotInfo()) { @@ -29604,7 +31105,7 @@ inline void MTPbotInfo::write(mtpBuffer &to) const { inline MTPbotInfo::MTPbotInfo(MTPDbotInfo *_data) : mtpDataOwner(_data) { } inline MTPbotInfo MTP_botInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands) { - return MTPbotInfo(new MTPDbotInfo(_user_id, _description, _commands)); + return MTP::internal::TypeCreator::new_botInfo(_user_id, _description, _commands); } inline MTPkeyboardButton::MTPkeyboardButton() : mtpDataOwner(new MTPDkeyboardButton()) { @@ -29631,7 +31132,7 @@ inline void MTPkeyboardButton::write(mtpBuffer &to) const { inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButton *_data) : mtpDataOwner(_data) { } inline MTPkeyboardButton MTP_keyboardButton(const MTPstring &_text) { - return MTPkeyboardButton(new MTPDkeyboardButton(_text)); + return MTP::internal::TypeCreator::new_keyboardButton(_text); } inline MTPkeyboardButtonRow::MTPkeyboardButtonRow() : mtpDataOwner(new MTPDkeyboardButtonRow()) { @@ -29658,7 +31159,7 @@ inline void MTPkeyboardButtonRow::write(mtpBuffer &to) const { inline MTPkeyboardButtonRow::MTPkeyboardButtonRow(MTPDkeyboardButtonRow *_data) : mtpDataOwner(_data) { } inline MTPkeyboardButtonRow MTP_keyboardButtonRow(const MTPVector &_buttons) { - return MTPkeyboardButtonRow(new MTPDkeyboardButtonRow(_buttons)); + return MTP::internal::TypeCreator::new_keyboardButtonRow(_buttons); } inline uint32 MTPreplyMarkup::innerLength() const { @@ -29735,14 +31236,17 @@ inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardForceReply *_data) : mtpD } inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data) : mtpDataOwner(_data), _type(mtpc_replyKeyboardMarkup) { } -inline MTPreplyMarkup MTP_replyKeyboardHide(MTPint _flags) { - return MTPreplyMarkup(new MTPDreplyKeyboardHide(_flags)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDreplyKeyboardHide::Flags) +inline MTPreplyMarkup MTP_replyKeyboardHide(const MTPflags &_flags) { + return MTP::internal::TypeCreator::new_replyKeyboardHide(_flags); } -inline MTPreplyMarkup MTP_replyKeyboardForceReply(MTPint _flags) { - return MTPreplyMarkup(new MTPDreplyKeyboardForceReply(_flags)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDreplyKeyboardForceReply::Flags) +inline MTPreplyMarkup MTP_replyKeyboardForceReply(const MTPflags &_flags) { + return MTP::internal::TypeCreator::new_replyKeyboardForceReply(_flags); } -inline MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector &_rows) { - return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_flags, _rows)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDreplyKeyboardMarkup::Flags) +inline MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPflags &_flags, const MTPVector &_rows) { + return MTP::internal::TypeCreator::new_replyKeyboardMarkup(_flags, _rows); } inline uint32 MTPhelp_appChangelog::innerLength() const { @@ -29788,10 +31292,10 @@ inline MTPhelp_appChangelog::MTPhelp_appChangelog(mtpTypeId type) : mtpDataOwner inline MTPhelp_appChangelog::MTPhelp_appChangelog(MTPDhelp_appChangelog *_data) : mtpDataOwner(_data), _type(mtpc_help_appChangelog) { } inline MTPhelp_appChangelog MTP_help_appChangelogEmpty() { - return MTPhelp_appChangelog(mtpc_help_appChangelogEmpty); + return MTP::internal::TypeCreator::new_help_appChangelogEmpty(); } inline MTPhelp_appChangelog MTP_help_appChangelog(const MTPstring &_text) { - return MTPhelp_appChangelog(new MTPDhelp_appChangelog(_text)); + return MTP::internal::TypeCreator::new_help_appChangelog(_text); } inline uint32 MTPmessageEntity::innerLength() const { @@ -30021,37 +31525,37 @@ inline MTPmessageEntity::MTPmessageEntity(MTPDmessageEntityPre *_data) : mtpData inline MTPmessageEntity::MTPmessageEntity(MTPDmessageEntityTextUrl *_data) : mtpDataOwner(_data), _type(mtpc_messageEntityTextUrl) { } inline MTPmessageEntity MTP_messageEntityUnknown(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityUnknown(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityUnknown(_offset, _length); } inline MTPmessageEntity MTP_messageEntityMention(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityMention(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityMention(_offset, _length); } inline MTPmessageEntity MTP_messageEntityHashtag(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityHashtag(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityHashtag(_offset, _length); } inline MTPmessageEntity MTP_messageEntityBotCommand(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityBotCommand(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityBotCommand(_offset, _length); } inline MTPmessageEntity MTP_messageEntityUrl(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityUrl(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityUrl(_offset, _length); } inline MTPmessageEntity MTP_messageEntityEmail(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityEmail(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityEmail(_offset, _length); } inline MTPmessageEntity MTP_messageEntityBold(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityBold(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityBold(_offset, _length); } inline MTPmessageEntity MTP_messageEntityItalic(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityItalic(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityItalic(_offset, _length); } inline MTPmessageEntity MTP_messageEntityCode(MTPint _offset, MTPint _length) { - return MTPmessageEntity(new MTPDmessageEntityCode(_offset, _length)); + return MTP::internal::TypeCreator::new_messageEntityCode(_offset, _length); } inline MTPmessageEntity MTP_messageEntityPre(MTPint _offset, MTPint _length, const MTPstring &_language) { - return MTPmessageEntity(new MTPDmessageEntityPre(_offset, _length, _language)); + return MTP::internal::TypeCreator::new_messageEntityPre(_offset, _length, _language); } inline MTPmessageEntity MTP_messageEntityTextUrl(MTPint _offset, MTPint _length, const MTPstring &_url) { - return MTPmessageEntity(new MTPDmessageEntityTextUrl(_offset, _length, _url)); + return MTP::internal::TypeCreator::new_messageEntityTextUrl(_offset, _length, _url); } inline uint32 MTPinputChannel::innerLength() const { @@ -30099,10 +31603,10 @@ inline MTPinputChannel::MTPinputChannel(mtpTypeId type) : mtpDataOwner(0), _type inline MTPinputChannel::MTPinputChannel(MTPDinputChannel *_data) : mtpDataOwner(_data), _type(mtpc_inputChannel) { } inline MTPinputChannel MTP_inputChannelEmpty() { - return MTPinputChannel(mtpc_inputChannelEmpty); + return MTP::internal::TypeCreator::new_inputChannelEmpty(); } inline MTPinputChannel MTP_inputChannel(MTPint _channel_id, const MTPlong &_access_hash) { - return MTPinputChannel(new MTPDinputChannel(_channel_id, _access_hash)); + return MTP::internal::TypeCreator::new_inputChannel(_channel_id, _access_hash); } inline MTPcontacts_resolvedPeer::MTPcontacts_resolvedPeer() : mtpDataOwner(new MTPDcontacts_resolvedPeer()) { @@ -30133,7 +31637,7 @@ inline void MTPcontacts_resolvedPeer::write(mtpBuffer &to) const { inline MTPcontacts_resolvedPeer::MTPcontacts_resolvedPeer(MTPDcontacts_resolvedPeer *_data) : mtpDataOwner(_data) { } inline MTPcontacts_resolvedPeer MTP_contacts_resolvedPeer(const MTPPeer &_peer, const MTPVector &_chats, const MTPVector &_users) { - return MTPcontacts_resolvedPeer(new MTPDcontacts_resolvedPeer(_peer, _chats, _users)); + return MTP::internal::TypeCreator::new_contacts_resolvedPeer(_peer, _chats, _users); } inline MTPmessageRange::MTPmessageRange() : mtpDataOwner(new MTPDmessageRange()) { @@ -30162,7 +31666,7 @@ inline void MTPmessageRange::write(mtpBuffer &to) const { inline MTPmessageRange::MTPmessageRange(MTPDmessageRange *_data) : mtpDataOwner(_data) { } inline MTPmessageRange MTP_messageRange(MTPint _min_id, MTPint _max_id) { - return MTPmessageRange(new MTPDmessageRange(_min_id, _max_id)); + return MTP::internal::TypeCreator::new_messageRange(_min_id, _max_id); } inline MTPmessageGroup::MTPmessageGroup() : mtpDataOwner(new MTPDmessageGroup()) { @@ -30195,7 +31699,7 @@ inline void MTPmessageGroup::write(mtpBuffer &to) const { inline MTPmessageGroup::MTPmessageGroup(MTPDmessageGroup *_data) : mtpDataOwner(_data) { } inline MTPmessageGroup MTP_messageGroup(MTPint _min_id, MTPint _max_id, MTPint _count, MTPint _date) { - return MTPmessageGroup(new MTPDmessageGroup(_min_id, _max_id, _count, _date)); + return MTP::internal::TypeCreator::new_messageGroup(_min_id, _max_id, _count, _date); } inline uint32 MTPupdates_channelDifference::innerLength() const { @@ -30306,14 +31810,17 @@ inline MTPupdates_channelDifference::MTPupdates_channelDifference(MTPDupdates_ch } inline MTPupdates_channelDifference::MTPupdates_channelDifference(MTPDupdates_channelDifference *_data) : mtpDataOwner(_data), _type(mtpc_updates_channelDifference) { } -inline MTPupdates_channelDifference MTP_updates_channelDifferenceEmpty(MTPint _flags, MTPint _pts, MTPint _timeout) { - return MTPupdates_channelDifference(new MTPDupdates_channelDifferenceEmpty(_flags, _pts, _timeout)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdates_channelDifferenceEmpty::Flags) +inline MTPupdates_channelDifference MTP_updates_channelDifferenceEmpty(const MTPflags &_flags, MTPint _pts, MTPint _timeout) { + return MTP::internal::TypeCreator::new_updates_channelDifferenceEmpty(_flags, _pts, _timeout); } -inline MTPupdates_channelDifference MTP_updates_channelDifferenceTooLong(MTPint _flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPupdates_channelDifference(new MTPDupdates_channelDifferenceTooLong(_flags, _pts, _timeout, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _messages, _chats, _users)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdates_channelDifferenceTooLong::Flags) +inline MTPupdates_channelDifference MTP_updates_channelDifferenceTooLong(const MTPflags &_flags, MTPint _pts, MTPint _timeout, MTPint _top_message, MTPint _top_important_message, MTPint _read_inbox_max_id, MTPint _unread_count, MTPint _unread_important_count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { + return MTP::internal::TypeCreator::new_updates_channelDifferenceTooLong(_flags, _pts, _timeout, _top_message, _top_important_message, _read_inbox_max_id, _unread_count, _unread_important_count, _messages, _chats, _users); } -inline MTPupdates_channelDifference MTP_updates_channelDifference(MTPint _flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users) { - return MTPupdates_channelDifference(new MTPDupdates_channelDifference(_flags, _pts, _timeout, _new_messages, _other_updates, _chats, _users)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDupdates_channelDifference::Flags) +inline MTPupdates_channelDifference MTP_updates_channelDifference(const MTPflags &_flags, MTPint _pts, MTPint _timeout, const MTPVector &_new_messages, const MTPVector &_other_updates, const MTPVector &_chats, const MTPVector &_users) { + return MTP::internal::TypeCreator::new_updates_channelDifference(_flags, _pts, _timeout, _new_messages, _other_updates, _chats, _users); } inline uint32 MTPchannelMessagesFilter::innerLength() const { @@ -30363,13 +31870,14 @@ inline MTPchannelMessagesFilter::MTPchannelMessagesFilter(mtpTypeId type) : mtpD inline MTPchannelMessagesFilter::MTPchannelMessagesFilter(MTPDchannelMessagesFilter *_data) : mtpDataOwner(_data), _type(mtpc_channelMessagesFilter) { } inline MTPchannelMessagesFilter MTP_channelMessagesFilterEmpty() { - return MTPchannelMessagesFilter(mtpc_channelMessagesFilterEmpty); + return MTP::internal::TypeCreator::new_channelMessagesFilterEmpty(); } -inline MTPchannelMessagesFilter MTP_channelMessagesFilter(MTPint _flags, const MTPVector &_ranges) { - return MTPchannelMessagesFilter(new MTPDchannelMessagesFilter(_flags, _ranges)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchannelMessagesFilter::Flags) +inline MTPchannelMessagesFilter MTP_channelMessagesFilter(const MTPflags &_flags, const MTPVector &_ranges) { + return MTP::internal::TypeCreator::new_channelMessagesFilter(_flags, _ranges); } inline MTPchannelMessagesFilter MTP_channelMessagesFilterCollapsed() { - return MTPchannelMessagesFilter(mtpc_channelMessagesFilterCollapsed); + return MTP::internal::TypeCreator::new_channelMessagesFilterCollapsed(); } inline uint32 MTPchannelParticipant::innerLength() const { @@ -30511,22 +32019,22 @@ inline MTPchannelParticipant::MTPchannelParticipant(MTPDchannelParticipantKicked inline MTPchannelParticipant::MTPchannelParticipant(MTPDchannelParticipantCreator *_data) : mtpDataOwner(_data), _type(mtpc_channelParticipantCreator) { } inline MTPchannelParticipant MTP_channelParticipant(MTPint _user_id, MTPint _date) { - return MTPchannelParticipant(new MTPDchannelParticipant(_user_id, _date)); + return MTP::internal::TypeCreator::new_channelParticipant(_user_id, _date); } inline MTPchannelParticipant MTP_channelParticipantSelf(MTPint _user_id, MTPint _inviter_id, MTPint _date) { - return MTPchannelParticipant(new MTPDchannelParticipantSelf(_user_id, _inviter_id, _date)); + return MTP::internal::TypeCreator::new_channelParticipantSelf(_user_id, _inviter_id, _date); } inline MTPchannelParticipant MTP_channelParticipantModerator(MTPint _user_id, MTPint _inviter_id, MTPint _date) { - return MTPchannelParticipant(new MTPDchannelParticipantModerator(_user_id, _inviter_id, _date)); + return MTP::internal::TypeCreator::new_channelParticipantModerator(_user_id, _inviter_id, _date); } inline MTPchannelParticipant MTP_channelParticipantEditor(MTPint _user_id, MTPint _inviter_id, MTPint _date) { - return MTPchannelParticipant(new MTPDchannelParticipantEditor(_user_id, _inviter_id, _date)); + return MTP::internal::TypeCreator::new_channelParticipantEditor(_user_id, _inviter_id, _date); } inline MTPchannelParticipant MTP_channelParticipantKicked(MTPint _user_id, MTPint _kicked_by, MTPint _date) { - return MTPchannelParticipant(new MTPDchannelParticipantKicked(_user_id, _kicked_by, _date)); + return MTP::internal::TypeCreator::new_channelParticipantKicked(_user_id, _kicked_by, _date); } inline MTPchannelParticipant MTP_channelParticipantCreator(MTPint _user_id) { - return MTPchannelParticipant(new MTPDchannelParticipantCreator(_user_id)); + return MTP::internal::TypeCreator::new_channelParticipantCreator(_user_id); } inline uint32 MTPchannelParticipantsFilter::innerLength() const { @@ -30559,16 +32067,16 @@ inline MTPchannelParticipantsFilter::MTPchannelParticipantsFilter(mtpTypeId type } } inline MTPchannelParticipantsFilter MTP_channelParticipantsRecent() { - return MTPchannelParticipantsFilter(mtpc_channelParticipantsRecent); + return MTP::internal::TypeCreator::new_channelParticipantsRecent(); } inline MTPchannelParticipantsFilter MTP_channelParticipantsAdmins() { - return MTPchannelParticipantsFilter(mtpc_channelParticipantsAdmins); + return MTP::internal::TypeCreator::new_channelParticipantsAdmins(); } inline MTPchannelParticipantsFilter MTP_channelParticipantsKicked() { - return MTPchannelParticipantsFilter(mtpc_channelParticipantsKicked); + return MTP::internal::TypeCreator::new_channelParticipantsKicked(); } inline MTPchannelParticipantsFilter MTP_channelParticipantsBots() { - return MTPchannelParticipantsFilter(mtpc_channelParticipantsBots); + return MTP::internal::TypeCreator::new_channelParticipantsBots(); } inline uint32 MTPchannelParticipantRole::innerLength() const { @@ -30599,13 +32107,13 @@ inline MTPchannelParticipantRole::MTPchannelParticipantRole(mtpTypeId type) : _t } } inline MTPchannelParticipantRole MTP_channelRoleEmpty() { - return MTPchannelParticipantRole(mtpc_channelRoleEmpty); + return MTP::internal::TypeCreator::new_channelRoleEmpty(); } inline MTPchannelParticipantRole MTP_channelRoleModerator() { - return MTPchannelParticipantRole(mtpc_channelRoleModerator); + return MTP::internal::TypeCreator::new_channelRoleModerator(); } inline MTPchannelParticipantRole MTP_channelRoleEditor() { - return MTPchannelParticipantRole(mtpc_channelRoleEditor); + return MTP::internal::TypeCreator::new_channelRoleEditor(); } inline MTPchannels_channelParticipants::MTPchannels_channelParticipants() : mtpDataOwner(new MTPDchannels_channelParticipants()) { @@ -30636,7 +32144,7 @@ inline void MTPchannels_channelParticipants::write(mtpBuffer &to) const { inline MTPchannels_channelParticipants::MTPchannels_channelParticipants(MTPDchannels_channelParticipants *_data) : mtpDataOwner(_data) { } inline MTPchannels_channelParticipants MTP_channels_channelParticipants(MTPint _count, const MTPVector &_participants, const MTPVector &_users) { - return MTPchannels_channelParticipants(new MTPDchannels_channelParticipants(_count, _participants, _users)); + return MTP::internal::TypeCreator::new_channels_channelParticipants(_count, _participants, _users); } inline MTPchannels_channelParticipant::MTPchannels_channelParticipant() : mtpDataOwner(new MTPDchannels_channelParticipant()) { @@ -30665,7 +32173,7 @@ inline void MTPchannels_channelParticipant::write(mtpBuffer &to) const { inline MTPchannels_channelParticipant::MTPchannels_channelParticipant(MTPDchannels_channelParticipant *_data) : mtpDataOwner(_data) { } inline MTPchannels_channelParticipant MTP_channels_channelParticipant(const MTPChannelParticipant &_participant, const MTPVector &_users) { - return MTPchannels_channelParticipant(new MTPDchannels_channelParticipant(_participant, _users)); + return MTP::internal::TypeCreator::new_channels_channelParticipant(_participant, _users); } inline MTPhelp_termsOfService::MTPhelp_termsOfService() : mtpDataOwner(new MTPDhelp_termsOfService()) { @@ -30692,7 +32200,7 @@ inline void MTPhelp_termsOfService::write(mtpBuffer &to) const { inline MTPhelp_termsOfService::MTPhelp_termsOfService(MTPDhelp_termsOfService *_data) : mtpDataOwner(_data) { } inline MTPhelp_termsOfService MTP_help_termsOfService(const MTPstring &_text) { - return MTPhelp_termsOfService(new MTPDhelp_termsOfService(_text)); + return MTP::internal::TypeCreator::new_help_termsOfService(_text); } inline uint32 MTPfoundGif::innerLength() const { @@ -30766,10 +32274,10 @@ inline MTPfoundGif::MTPfoundGif(MTPDfoundGif *_data) : mtpDataOwner(_data), _typ inline MTPfoundGif::MTPfoundGif(MTPDfoundGifCached *_data) : mtpDataOwner(_data), _type(mtpc_foundGifCached) { } inline MTPfoundGif MTP_foundGif(const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h) { - return MTPfoundGif(new MTPDfoundGif(_url, _thumb_url, _content_url, _content_type, _w, _h)); + return MTP::internal::TypeCreator::new_foundGif(_url, _thumb_url, _content_url, _content_type, _w, _h); } inline MTPfoundGif MTP_foundGifCached(const MTPstring &_url, const MTPPhoto &_photo, const MTPDocument &_document) { - return MTPfoundGif(new MTPDfoundGifCached(_url, _photo, _document)); + return MTP::internal::TypeCreator::new_foundGifCached(_url, _photo, _document); } inline MTPmessages_foundGifs::MTPmessages_foundGifs() : mtpDataOwner(new MTPDmessages_foundGifs()) { @@ -30798,7 +32306,7 @@ inline void MTPmessages_foundGifs::write(mtpBuffer &to) const { inline MTPmessages_foundGifs::MTPmessages_foundGifs(MTPDmessages_foundGifs *_data) : mtpDataOwner(_data) { } inline MTPmessages_foundGifs MTP_messages_foundGifs(MTPint _next_offset, const MTPVector &_results) { - return MTPmessages_foundGifs(new MTPDmessages_foundGifs(_next_offset, _results)); + return MTP::internal::TypeCreator::new_messages_foundGifs(_next_offset, _results); } inline uint32 MTPmessages_savedGifs::innerLength() const { @@ -30846,10 +32354,10 @@ inline MTPmessages_savedGifs::MTPmessages_savedGifs(mtpTypeId type) : mtpDataOwn inline MTPmessages_savedGifs::MTPmessages_savedGifs(MTPDmessages_savedGifs *_data) : mtpDataOwner(_data), _type(mtpc_messages_savedGifs) { } inline MTPmessages_savedGifs MTP_messages_savedGifsNotModified() { - return MTPmessages_savedGifs(mtpc_messages_savedGifsNotModified); + return MTP::internal::TypeCreator::new_messages_savedGifsNotModified(); } inline MTPmessages_savedGifs MTP_messages_savedGifs(MTPint _hash, const MTPVector &_gifs) { - return MTPmessages_savedGifs(new MTPDmessages_savedGifs(_hash, _gifs)); + return MTP::internal::TypeCreator::new_messages_savedGifs(_hash, _gifs); } inline uint32 MTPinputBotInlineMessage::innerLength() const { @@ -30913,10 +32421,11 @@ inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMess inline MTPinputBotInlineMessage::MTPinputBotInlineMessage(MTPDinputBotInlineMessageText *_data) : mtpDataOwner(_data), _type(mtpc_inputBotInlineMessageText) { } inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaAuto(const MTPstring &_caption) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaAuto(_caption)); + return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaAuto(_caption); } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageText(_flags, _message, _entities)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageText::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageText(_flags, _message, _entities); } inline MTPinputBotInlineResult::MTPinputBotInlineResult() : mtpDataOwner(new MTPDinputBotInlineResult()) { @@ -30966,8 +32475,9 @@ inline void MTPinputBotInlineResult::write(mtpBuffer &to) const { } inline MTPinputBotInlineResult::MTPinputBotInlineResult(MTPDinputBotInlineResult *_data) : mtpDataOwner(_data) { } -inline MTPinputBotInlineResult MTP_inputBotInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { - return MTPinputBotInlineResult(new MTPDinputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineResult::Flags) +inline MTPinputBotInlineResult MTP_inputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { + return MTP::internal::TypeCreator::new_inputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message); } inline uint32 MTPbotInlineMessage::innerLength() const { @@ -31031,10 +32541,11 @@ inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageMediaAuto *_ inline MTPbotInlineMessage::MTPbotInlineMessage(MTPDbotInlineMessageText *_data) : mtpDataOwner(_data), _type(mtpc_botInlineMessageText) { } inline MTPbotInlineMessage MTP_botInlineMessageMediaAuto(const MTPstring &_caption) { - return MTPbotInlineMessage(new MTPDbotInlineMessageMediaAuto(_caption)); + return MTP::internal::TypeCreator::new_botInlineMessageMediaAuto(_caption); } -inline MTPbotInlineMessage MTP_botInlineMessageText(MTPint _flags, const MTPstring &_message, const MTPVector &_entities) { - return MTPbotInlineMessage(new MTPDbotInlineMessageText(_flags, _message, _entities)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineMessageText::Flags) +inline MTPbotInlineMessage MTP_botInlineMessageText(const MTPflags &_flags, const MTPstring &_message, const MTPVector &_entities) { + return MTP::internal::TypeCreator::new_botInlineMessageText(_flags, _message, _entities); } inline uint32 MTPbotInlineResult::innerLength() const { @@ -31146,13 +32657,14 @@ inline MTPbotInlineResult::MTPbotInlineResult(MTPDbotInlineMediaResultPhoto *_da inline MTPbotInlineResult::MTPbotInlineResult(MTPDbotInlineResult *_data) : mtpDataOwner(_data), _type(mtpc_botInlineResult) { } inline MTPbotInlineResult MTP_botInlineMediaResultDocument(const MTPstring &_id, const MTPstring &_type, const MTPDocument &_document, const MTPBotInlineMessage &_send_message) { - return MTPbotInlineResult(new MTPDbotInlineMediaResultDocument(_id, _type, _document, _send_message)); + return MTP::internal::TypeCreator::new_botInlineMediaResultDocument(_id, _type, _document, _send_message); } inline MTPbotInlineResult MTP_botInlineMediaResultPhoto(const MTPstring &_id, const MTPstring &_type, const MTPPhoto &_photo, const MTPBotInlineMessage &_send_message) { - return MTPbotInlineResult(new MTPDbotInlineMediaResultPhoto(_id, _type, _photo, _send_message)); + return MTP::internal::TypeCreator::new_botInlineMediaResultPhoto(_id, _type, _photo, _send_message); } -inline MTPbotInlineResult MTP_botInlineResult(MTPint _flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) { - return MTPbotInlineResult(new MTPDbotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDbotInlineResult::Flags) +inline MTPbotInlineResult MTP_botInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPBotInlineMessage &_send_message) { + return MTP::internal::TypeCreator::new_botInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message); } inline MTPmessages_botResults::MTPmessages_botResults() : mtpDataOwner(new MTPDmessages_botResults()) { @@ -31184,8 +32696,9 @@ inline void MTPmessages_botResults::write(mtpBuffer &to) const { } inline MTPmessages_botResults::MTPmessages_botResults(MTPDmessages_botResults *_data) : mtpDataOwner(_data) { } -inline MTPmessages_botResults MTP_messages_botResults(MTPint _flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results) { - return MTPmessages_botResults(new MTPDmessages_botResults(_flags, _query_id, _next_offset, _results)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessages_botResults::Flags) +inline MTPmessages_botResults MTP_messages_botResults(const MTPflags &_flags, const MTPlong &_query_id, const MTPstring &_next_offset, const MTPVector &_results) { + return MTP::internal::TypeCreator::new_messages_botResults(_flags, _query_id, _next_offset, _results); } inline MTPexportedMessageLink::MTPexportedMessageLink() : mtpDataOwner(new MTPDexportedMessageLink()) { @@ -31212,7 +32725,7 @@ inline void MTPexportedMessageLink::write(mtpBuffer &to) const { inline MTPexportedMessageLink::MTPexportedMessageLink(MTPDexportedMessageLink *_data) : mtpDataOwner(_data) { } inline MTPexportedMessageLink MTP_exportedMessageLink(const MTPstring &_link) { - return MTPexportedMessageLink(new MTPDexportedMessageLink(_link)); + return MTP::internal::TypeCreator::new_exportedMessageLink(_link); } inline MTPmessageFwdHeader::MTPmessageFwdHeader() : mtpDataOwner(new MTPDmessageFwdHeader()) { @@ -31246,8 +32759,9 @@ inline void MTPmessageFwdHeader::write(mtpBuffer &to) const { } inline MTPmessageFwdHeader::MTPmessageFwdHeader(MTPDmessageFwdHeader *_data) : mtpDataOwner(_data) { } -inline MTPmessageFwdHeader MTP_messageFwdHeader(MTPint _flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post) { - return MTPmessageFwdHeader(new MTPDmessageFwdHeader(_flags, _from_id, _date, _channel_id, _channel_post)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDmessageFwdHeader::Flags) +inline MTPmessageFwdHeader MTP_messageFwdHeader(const MTPflags &_flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post) { + return MTP::internal::TypeCreator::new_messageFwdHeader(_flags, _from_id, _date, _channel_id, _channel_post); } inline MTPchannels_messageEditData::MTPchannels_messageEditData() : mtpDataOwner(new MTPDchannels_messageEditData()) { @@ -31273,8 +32787,9 @@ inline void MTPchannels_messageEditData::write(mtpBuffer &to) const { } inline MTPchannels_messageEditData::MTPchannels_messageEditData(MTPDchannels_messageEditData *_data) : mtpDataOwner(_data) { } -inline MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags) { - return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags)); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDchannels_messageEditData::Flags) +inline MTPchannels_messageEditData MTP_channels_messageEditData(const MTPflags &_flags) { + return MTP::internal::TypeCreator::new_channels_messageEditData(_flags); } inline uint32 MTPauth_codeType::innerLength() const { @@ -31305,13 +32820,13 @@ inline MTPauth_codeType::MTPauth_codeType(mtpTypeId type) : _type(type) { } } inline MTPauth_codeType MTP_auth_codeTypeSms() { - return MTPauth_codeType(mtpc_auth_codeTypeSms); + return MTP::internal::TypeCreator::new_auth_codeTypeSms(); } inline MTPauth_codeType MTP_auth_codeTypeCall() { - return MTPauth_codeType(mtpc_auth_codeTypeCall); + return MTP::internal::TypeCreator::new_auth_codeTypeCall(); } inline MTPauth_codeType MTP_auth_codeTypeFlashCall() { - return MTPauth_codeType(mtpc_auth_codeTypeFlashCall); + return MTP::internal::TypeCreator::new_auth_codeTypeFlashCall(); } inline uint32 MTPauth_sentCodeType::innerLength() const { @@ -31403,17 +32918,25 @@ inline MTPauth_sentCodeType::MTPauth_sentCodeType(MTPDauth_sentCodeTypeCall *_da inline MTPauth_sentCodeType::MTPauth_sentCodeType(MTPDauth_sentCodeTypeFlashCall *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentCodeTypeFlashCall) { } inline MTPauth_sentCodeType MTP_auth_sentCodeTypeApp(MTPint _length) { - return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeApp(_length)); + return MTP::internal::TypeCreator::new_auth_sentCodeTypeApp(_length); } inline MTPauth_sentCodeType MTP_auth_sentCodeTypeSms(MTPint _length) { - return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeSms(_length)); + return MTP::internal::TypeCreator::new_auth_sentCodeTypeSms(_length); } inline MTPauth_sentCodeType MTP_auth_sentCodeTypeCall(MTPint _length) { - return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeCall(_length)); + return MTP::internal::TypeCreator::new_auth_sentCodeTypeCall(_length); } inline MTPauth_sentCodeType MTP_auth_sentCodeTypeFlashCall(const MTPstring &_pattern) { - return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeFlashCall(_pattern)); + return MTP::internal::TypeCreator::new_auth_sentCodeTypeFlashCall(_pattern); } +inline MTPDmessage::Flags mtpCastFlags(MTPDmessageService::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } +inline MTPDmessage::Flags mtpCastFlags(MTPDupdateShortMessage::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } +inline MTPDmessage::Flags mtpCastFlags(MTPDupdateShortChatMessage::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } +inline MTPDmessage::Flags mtpCastFlags(MTPDupdateShortSentMessage::Flags flags) { return MTPDmessage::Flags(QFlag(flags)); } +inline MTPDreplyKeyboardMarkup::Flags mtpCastFlags(MTPDreplyKeyboardHide::Flags flags) { return MTPDreplyKeyboardMarkup::Flags(QFlag(flags)); } +inline MTPDreplyKeyboardMarkup::Flags mtpCastFlags(MTPDreplyKeyboardForceReply::Flags flags) { return MTPDreplyKeyboardMarkup::Flags(QFlag(flags)); } +inline MTPDpeerNotifySettings::Flags mtpCastFlags(MTPDinputPeerNotifySettings::Flags flags) { return MTPDpeerNotifySettings::Flags(QFlag(flags)); } +inline MTPDinputPeerNotifySettings::Flags mtpCastFlags(MTPDpeerNotifySettings::Flags flags) { return MTPDinputPeerNotifySettings::Flags(QFlag(flags)); } // Human-readable text serialization void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons); diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 67013cf18..4e5bea498 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -778,14 +778,20 @@ void OverviewInner::preloadMore() { if (!_searchRequest) { MTPmessagesFilter filter = (_type == OverviewLinks) ? MTP_inputMessagesFilterUrl() : MTP_inputMessagesFilterDocument(); if (!_searchFull) { - int32 flags = (_history->peer->isChannel() && !_history->peer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _history->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(_lastSearchId), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, _lastSearchId ? SearchFromOffset : SearchFromStart), rpcFail(&OverviewInner::searchFailed, _lastSearchId ? SearchFromOffset : SearchFromStart)); + MTPmessages_Search::Flags flags = 0; + if (_history->peer->isChannel() && !_history->peer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _history->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(_lastSearchId), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, _lastSearchId ? SearchFromOffset : SearchFromStart), rpcFail(&OverviewInner::searchFailed, _lastSearchId ? SearchFromOffset : SearchFromStart)); if (!_lastSearchId) { _searchQueries.insert(_searchRequest, _searchQuery); } } else if (_migrated && !_searchFullMigrated) { - int32 flags = (_migrated->peer->isChannel() && !_migrated->peer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _migrated->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(_lastSearchMigratedId), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, _lastSearchMigratedId ? SearchMigratedFromOffset : SearchMigratedFromStart), rpcFail(&OverviewInner::searchFailed, _lastSearchMigratedId ? SearchMigratedFromOffset : SearchMigratedFromStart)); + MTPmessages_Search::Flags flags = 0; + if (_migrated->peer->isChannel() && !_migrated->peer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _migrated->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(_lastSearchMigratedId), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, _lastSearchMigratedId ? SearchMigratedFromOffset : SearchMigratedFromStart), rpcFail(&OverviewInner::searchFailed, _lastSearchMigratedId ? SearchMigratedFromOffset : SearchMigratedFromStart)); } } } else if (App::main()) { @@ -1530,9 +1536,12 @@ bool OverviewInner::onSearchMessages(bool searchCache) { } else if (_searchQuery != q) { _searchQuery = q; _searchFull = _searchFullMigrated = false; - int32 flags = (_history->peer->isChannel() && !_history->peer->isMegagroup()) ? MTPmessages_Search::flag_important_only : 0; + MTPmessages_Search::Flags flags = 0; + if (_history->peer->isChannel() && !_history->peer->isMegagroup()) { + flags |= MTPmessages_Search::Flag::f_important_only; + } MTPmessagesFilter filter = (_type == OverviewLinks) ? MTP_inputMessagesFilterUrl() : MTP_inputMessagesFilterDocument(); - _searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _history->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, SearchFromStart), rpcFail(&OverviewInner::searchFailed, SearchFromStart)); + _searchRequest = MTP::send(MTPmessages_Search(MTP_flags(flags), _history->peer->input, MTP_string(_searchQuery), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, SearchFromStart), rpcFail(&OverviewInner::searchFailed, SearchFromStart)); _searchQueries.insert(_searchRequest, _searchQuery); } return false; @@ -2386,7 +2395,6 @@ void OverviewWidget::onDeleteSelectedSure() { for (SelectedItemSet::const_iterator i = sel.cbegin(), e = sel.cend(); i != e; ++i) { i.value()->destroy(); } - Notify::historyItemsResized(); Ui::hideLayer(); for (QMap >::const_iterator i = ids.cbegin(), e = ids.cend(); i != e; ++i) { @@ -2408,7 +2416,6 @@ void OverviewWidget::onDeleteContextSure() { App::main()->checkPeerHistory(h->peer); } - Notify::historyItemsResized(); Ui::hideLayer(); if (wasOnServer) { diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index c98fe4a55..8e7b0321b 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -28,8 +28,6 @@ Qt::LayoutDirection gLangDir = gRtl ? Qt::RightToLeft : Qt::LeftToRight; QString gArguments; -mtpDcOptions gDcOptions; - bool gDevVersion = DevVersion; uint64 gBetaVersion = BETA_VERSION; uint64 gRealBetaVersion = BETA_VERSION; @@ -110,9 +108,6 @@ EmojiColorVariants gEmojiVariants; RecentStickerPreload gRecentStickersPreload; RecentStickerPack gRecentStickers; -StickerSets gStickerSets; -StickerSetsOrder gStickerSetsOrder; -uint64 gLastStickersUpdate = 0; SavedGifs gSavedGifs; uint64 gLastSavedGifsUpdate = 0; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 93524bba8..18b069258 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -55,18 +55,6 @@ inline bool rtl() { DeclareReadSetting(QString, Arguments); -struct mtpDcOption { - mtpDcOption(int id, int flags, const string &ip, int port) : id(id), flags(flags), ip(ip), port(port) { - } - - int id; - int flags; - string ip; - int port; -}; -typedef QMap mtpDcOptions; -DeclareSetting(mtpDcOptions, DcOptions); - DeclareSetting(bool, DevVersion); DeclareSetting(uint64, BetaVersion); DeclareSetting(uint64, RealBetaVersion); @@ -215,24 +203,6 @@ RecentStickerPack &cGetRecentStickers(); typedef QMap StickersByEmojiMap; -static const uint64 DefaultStickerSetId = 0; // for backward compatibility -static const uint64 CustomStickerSetId = 0xFFFFFFFFFFFFFFFFULL, RecentStickerSetId = 0xFFFFFFFFFFFFFFFEULL; -static const uint64 NoneStickerSetId = 0xFFFFFFFFFFFFFFFDULL; // for emoji/stickers panel -struct StickerSet { - StickerSet(uint64 id, uint64 access, const QString &title, const QString &shortName, int32 count, int32 hash, int32 flags) : id(id), access(access), title(title), shortName(shortName), count(count), hash(hash), flags(flags) { - } - uint64 id, access; - QString title, shortName; - int32 count, hash, flags; - StickerPack stickers; - StickersByEmojiMap emoji; -}; -typedef QMap StickerSets; -DeclareRefSetting(StickerSets, StickerSets); -typedef QList StickerSetsOrder; -DeclareRefSetting(StickerSetsOrder, StickerSetsOrder); -DeclareSetting(uint64, LastStickersUpdate); - typedef QVector SavedGifs; DeclareRefSetting(SavedGifs, SavedGifs); DeclareSetting(uint64, LastSavedGifsUpdate); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 330d39d24..8b87d1c53 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -1355,8 +1355,8 @@ void SettingsInner::onPasswordOff() { _passwordTurnOff.hide(); // int32 flags = MTPDaccount_passwordInputSettings::flag_new_salt | MTPDaccount_passwordInputSettings::flag_new_password_hash | MTPDaccount_passwordInputSettings::flag_hint | MTPDaccount_passwordInputSettings::flag_email; - int32 flags = MTPDaccount_passwordInputSettings::flag_email; - MTPaccount_PasswordInputSettings settings(MTP_account_passwordInputSettings(MTP_int(flags), MTP_string(QByteArray()), MTP_string(QByteArray()), MTP_string(QString()), MTP_string(QString()))); + MTPDaccount_passwordInputSettings::Flags flags = MTPDaccount_passwordInputSettings::Flag::f_email; + MTPaccount_PasswordInputSettings settings(MTP_account_passwordInputSettings(MTP_flags(flags), MTP_string(QByteArray()), MTP_string(QByteArray()), MTP_string(QString()), MTP_string(QString()))); MTP::send(MTPaccount_UpdatePasswordSettings(MTP_string(QByteArray()), settings), rpcDone(&SettingsInner::offPasswordDone), rpcFail(&SettingsInner::offPasswordFail)); } else { PasscodeBox *box = new PasscodeBox(_newPasswordSalt, _curPasswordSalt, _hasPasswordRecovery, _curPasswordHint, true); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index ed5ef5585..9be7d77c1 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -135,9 +135,9 @@ void PeerData::updateName(const QString &newName, const QString &newNameOrPhone, if (asChannel()->username != newUsername) { asChannel()->username = newUsername; if (newUsername.isEmpty()) { - asChannel()->flags &= ~MTPDchannel::flag_username; + asChannel()->flags &= ~MTPDchannel::Flag::f_username; } else { - asChannel()->flags |= MTPDchannel::flag_username; + asChannel()->flags |= MTPDchannel::Flag::f_username; } if (App::main()) { App::main()->peerUsernameChanged(this); @@ -802,14 +802,14 @@ QString saveFileName(const QString &title, const QString &filter, const QString bool StickerData::setInstalled() const { switch (set.type()) { case mtpc_inputStickerSetID: { - StickerSets::const_iterator it = cStickerSets().constFind(set.c_inputStickerSetID().vid.v); - return (it != cStickerSets().cend()) && !(it->flags & MTPDstickerSet::flag_disabled); + auto it = Global::StickerSets().constFind(set.c_inputStickerSetID().vid.v); + return (it != Global::StickerSets().cend()) && !(it->flags & MTPDstickerSet::Flag::f_disabled); } break; case mtpc_inputStickerSetShortName: { QString name = qs(set.c_inputStickerSetShortName().vshort_name).toLower(); - for (StickerSets::const_iterator it = cStickerSets().cbegin(), e = cStickerSets().cend(); it != e; ++it) { + for (auto it = Global::StickerSets().cbegin(), e = Global::StickerSets().cend(); it != e; ++it) { if (it->shortName.toLower() == name) { - return !(it->flags & MTPDstickerSet::flag_disabled); + return !(it->flags & MTPDstickerSet::Flag::f_disabled); } } } break; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index d8630ccc0..5b41f375e 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -103,10 +103,12 @@ inline PeerId peerFromMessage(const MTPmessage &msg) { } return (from_id && peerToUser(to_id) == MTP::authedId()) ? from_id : to_id; } -inline int32 flagsFromMessage(const MTPmessage &msg) { +inline MTPDmessage::Flags flagsFromMessage(const MTPmessage &msg) { switch (msg.type()) { case mtpc_message: return msg.c_message().vflags.v; - case mtpc_messageService: return msg.c_messageService().vflags.v; + + // dirty type hack :( we assume that MTPDmessage::Flags has the same flags and perhaps more + case mtpc_messageService: return MTPDmessage::Flags(QFlag(msg.c_messageService().vflags.v)); } return 0; } @@ -163,15 +165,16 @@ static const MsgId ServerMaxMsgId = 0x3FFFFFFF; static const MsgId ShowAtUnreadMsgId = 0; struct NotifySettings { - NotifySettings() : flags(MTPDinputPeerNotifySettings::flag_show_previews), mute(0), sound("default") { + NotifySettings() : flags(MTPDpeerNotifySettings::Flag::f_show_previews), mute(0), sound("default") { } - int32 flags, mute; + MTPDpeerNotifySettings::Flags flags; + int32 mute; string sound; bool previews() const { - return flags & MTPDinputPeerNotifySettings::flag_show_previews; + return flags & MTPDpeerNotifySettings::Flag::f_show_previews; } bool silent() const { - return flags & MTPDinputPeerNotifySettings::flag_silent; + return flags & MTPDpeerNotifySettings::Flag::f_silent; } }; typedef NotifySettings *NotifySettingsPtr; @@ -386,9 +389,9 @@ public: uint64 access; - int32 flags; + MTPDuser::Flags flags; bool isVerified() const { - return flags & MTPDuser::flag_verified; + return flags & MTPDuser::Flag::f_verified; } bool canWrite() const { return access != UserNoAccess; @@ -434,7 +437,7 @@ public: void invalidateParticipants() { participants = ChatData::Participants(); admins = ChatData::Admins(); - flags &= ~MTPDchat::flag_admin; + flags &= ~MTPDchat::Flag::f_admin; invitedByMe = ChatData::InvitedByMe(); botStatus = 0; } @@ -451,7 +454,7 @@ public: int32 version; int32 creator; - int32 flags; + MTPDchat::Flags flags; bool isForbidden; bool amIn() const { return !isForbidden && !haveLeft() && !wasKicked(); @@ -463,25 +466,25 @@ public: return !isDeactivated() && amIn(); } bool haveLeft() const { - return flags & MTPDchat::flag_left; + return flags & MTPDchat::Flag::f_left; } bool wasKicked() const { - return flags & MTPDchat::flag_kicked; + return flags & MTPDchat::Flag::f_kicked; } bool adminsEnabled() const { - return flags & MTPDchat::flag_admins_enabled; + return flags & MTPDchat::Flag::f_admins_enabled; } bool amCreator() const { - return flags & MTPDchat::flag_creator; + return flags & MTPDchat::Flag::f_creator; } bool amAdmin() const { - return flags & MTPDchat::flag_admin; + return flags & MTPDchat::Flag::f_admin; } bool isDeactivated() const { - return flags & MTPDchat::flag_deactivated; + return flags & MTPDchat::Flag::f_deactivated; } bool isMigrated() const { - return flags & MTPDchat::flag_migrated_to; + return flags & MTPDchat::Flag::f_migrated_to; } typedef QMap Participants; Participants participants; @@ -625,7 +628,8 @@ public: int32 count, adminsCount; int32 date; int32 version; - int32 flags, flagsFull; + MTPDchannel::Flags flags; + MTPDchannelFull::Flags flagsFull; MegagroupInfo *mgInfo; bool lastParticipantsCountOutdated() const { if (!mgInfo || !(mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsCountOutdated)) { @@ -639,31 +643,31 @@ public: } void flagsUpdated(); bool isMegagroup() const { - return flags & MTPDchannel::flag_megagroup; + return flags & MTPDchannel::Flag::f_megagroup; } bool isBroadcast() const { - return flags & MTPDchannel::flag_broadcast; + return flags & MTPDchannel::Flag::f_broadcast; } bool isPublic() const { - return flags & MTPDchannel::flag_username; + return flags & MTPDchannel::Flag::f_username; } bool canEditUsername() const { - return amCreator() && (flagsFull & MTPDchannelFull::flag_can_set_username); + return amCreator() && (flagsFull & MTPDchannelFull::Flag::f_can_set_username); } bool amCreator() const { - return flags & MTPDchannel::flag_creator; + return flags & MTPDchannel::Flag::f_creator; } bool amEditor() const { - return flags & MTPDchannel::flag_editor; + return flags & MTPDchannel::Flag::f_editor; } bool amModerator() const { - return flags & MTPDchannel::flag_moderator; + return flags & MTPDchannel::Flag::f_moderator; } bool haveLeft() const { - return flags & MTPDchannel::flag_left; + return flags & MTPDchannel::Flag::f_left; } bool wasKicked() const { - return flags & MTPDchannel::flag_kicked; + return flags & MTPDchannel::Flag::f_kicked; } bool amIn() const { return !isForbidden && !haveLeft() && !wasKicked(); @@ -675,17 +679,17 @@ public: return amIn() && (canPublish() || !isBroadcast()); } bool canViewParticipants() const { - return flagsFull & MTPDchannelFull::flag_can_view_participants; + return flagsFull & MTPDchannelFull::Flag::f_can_view_participants; } bool addsSignature() const { - return flags & MTPDchannel::flag_signatures; + return flags & MTPDchannel::Flag::f_signatures; } bool isForbidden; bool isVerified() const { - return flags & MTPDchannel::flag_verified; + return flags & MTPDchannel::Flag::f_verified; } bool canAddParticipants() const { - return amCreator() || amEditor() || (flags & MTPDchannel::flag_democracy); + return amCreator() || amEditor() || (flags & MTPDchannel::Flag::f_democracy); } // ImagePtr photoFull; @@ -1220,7 +1224,7 @@ public: int32 width, height, duration; QString message; // botContextMessageText - bool noWebPage; + bool noWebPage; //currently not used EntitiesInText entities; QString caption; // if message.isEmpty() use botContextMessageMediaAuto diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 70c9a7558..9c590eca5 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -59,6 +59,11 @@ struct ForConstTraits { }; #define for_const(range_declaration, range_expression) for (range_declaration : static_cast::ExpressionType>(range_expression)) +template +inline QFlags qFlags(Enum v) { + return QFlags(v); +} + //typedef unsigned char uchar; // Qt has uchar typedef qint16 int16; typedef quint16 uint16; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index ab36c4734..b14e63cef 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -661,8 +661,8 @@ void Window::sendServiceHistoryRequest() { UserData *user = App::userLoaded(ServiceUserId); if (!user) { - int32 userFlags = MTPDuser::flag_first_name | MTPDuser::flag_phone | MTPDuser::flag_status | MTPDuser::flag_verified; - user = App::feedUsers(MTP_vector(1, MTP_user(MTP_int(userFlags), MTP_int(ServiceUserId), MTPlong(), MTP_string("Telegram"), MTPstring(), MTPstring(), MTP_string("42777"), MTP_userProfilePhotoEmpty(), MTP_userStatusRecently(), MTPint(), MTPstring(), MTPstring()))); + MTPDuser::Flags userFlags = MTPDuser::Flag::f_first_name | MTPDuser::Flag::f_phone | MTPDuser::Flag::f_status | MTPDuser::Flag::f_verified; + user = App::feedUsers(MTP_vector(1, MTP_user(MTP_flags(userFlags), MTP_int(ServiceUserId), MTPlong(), MTP_string("Telegram"), MTPstring(), MTPstring(), MTP_string("42777"), MTP_userProfilePhotoEmpty(), MTP_userStatusRecently(), MTPint(), MTPstring(), MTPstring()))); } _serviceHistoryRequest = MTP::send(MTPmessages_GetHistory(user->input, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), main->rpcDone(&MainWidget::serviceHistoryDone), main->rpcFail(&MainWidget::serviceHistoryFail)); } @@ -1037,7 +1037,6 @@ bool Window::eventFilter(QObject *obj, QEvent *e) { break; case QEvent::ShortcutOverride: // handle shortcuts ourselves - DEBUG_LOG(("Shortcut override declined: %1").arg(static_cast(e)->key())); return true; case QEvent::Shortcut: From 2cbda4e1e574ca2a4219613540e86a83080444e4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 19 Mar 2016 21:32:17 +0300 Subject: [PATCH 05/10] removed history resize when adding items, simplified adding items, maintaining item and block indices, history scroll management broken when history changes --- Telegram/SourceFiles/history.cpp | 443 ++++++++++++------------------- Telegram/SourceFiles/history.h | 19 +- 2 files changed, 177 insertions(+), 285 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 356719060..85188c283 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -599,25 +599,24 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { return _joinedMessage; } - UserData *inviter = (peer->asChannel()->inviter > 0) ? App::userLoaded(peer->asChannel()->inviter) : 0; - if (!inviter) return 0; + UserData *inviter = (peer->asChannel()->inviter > 0) ? App::userLoaded(peer->asChannel()->inviter) : nullptr; + if (!inviter) return nullptr; - if (peerToUser(inviter->id) == MTP::authedId()) unread = false; MTPDmessage::Flags flags = 0; - if (unread) { + if (peerToUser(inviter->id) == MTP::authedId()) { + unread = false; + } else if (unread) { flags |= MTPDmessage::Flag::f_unread; } + QDateTime inviteDate = peer->asChannel()->inviteDate; if (unread) _maxReadMessageDate = inviteDate; if (isEmpty()) { - HistoryBlock *to = new HistoryBlock(this); - bool newBlock = true; _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); - if (!addNewItem(to, newBlock, _joinedMessage, unread)) { - _joinedMessage = 0; - } + addNewItem(_joinedMessage, unread); return _joinedMessage; } + for (int32 blockIndex = blocks.size(); blockIndex > 1;) { HistoryBlock *block = blocks.at(--blockIndex); for (int32 itemIndex = block->items.size(); itemIndex > 0;) { @@ -627,13 +626,13 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { if (item->date <= inviteDate) { if (peer->isMegagroup() && peer->migrateFrom() && item->isGroupMigrate()) { peer->asChannel()->mgInfo->joinedMessageFound = true; - return 0; + return nullptr; } ++itemIndex; _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); if (!addNewInTheMiddle(_joinedMessage, blockIndex, itemIndex)) { - _joinedMessage = 0; + _joinedMessage = nullptr; } if (lastMsgDate.isNull() || inviteDate >= lastMsgDate) { setLastMessage(_joinedMessage); @@ -648,38 +647,19 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } // adding new item to new block - int32 addToH = 0, skip = 0; - HistoryItem *till = blocks.isEmpty() ? 0 : blocks.front()->items.front(); - HistoryBlock *block = new HistoryBlock(this); + block->setIndexInHistory(0); + blocks.push_front(block); + for (int i = 1, l = blocks.size(); i < l; ++i) { + blocks.at(i)->setIndexInHistory(i); + } _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); - addItemAfterPrevToBlock(_joinedMessage, 0, block); - if (!block->items.isEmpty()) { - blocks.push_front(block); - if (width) { - addToH += block->height; - ++skip; - } - } else { - delete block; - } - if (width && addToH) { - for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { - if (skip) { - --skip; - } else { - (*i)->y += addToH; - } - } - height += addToH; - } - if (!lastMsgDate.isNull() && inviteDate >= lastMsgDate) { - setLastMessage(_joinedMessage); - if (unread) { - newItemAdded(_joinedMessage); - } - } + addItemAfterPrevToBlock(_joinedMessage, nullptr, block); + + t_assert(blocks.size() > 1); + blocks.at(1)->items.front()->previousItemChanged(); + return _joinedMessage; } @@ -799,23 +779,7 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp clear(true); } - HistoryBlock *to = nullptr; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); - } - HistoryItem *item = createItem((type == NewMessageLast) ? nullptr : to, msg, (type == NewMessageUnread)); - if (type == NewMessageLast && item) { - if (!item->detached()) { - t_assert(!newBlock); - return item; - } - } - return addNewItem(to, newBlock, item, (type == NewMessageUnread)); + return addNewToLastBlock(msg, type); } void ChannelHistory::addNewToOther(HistoryItem *item, NewMessageType type) { @@ -866,16 +830,16 @@ void ChannelHistory::switchMode() { HistoryItem *prev = 0; for (int32 i = 0; i < count;) { HistoryBlock *block = new HistoryBlock(this); + block->setIndexInHistory(blocks.size()); + blocks.push_back(block); + int32 willAddToBlock = qMin(int32(MessagesPerPage), count - i); block->items.reserve(willAddToBlock); for (int32 till = i + willAddToBlock; i < till; ++i) { prev = addItemAfterPrevToBlock(_otherList.at(i), prev, block); } - blocks.push_back(block); - if (width) { - block->y = height; - height += block->height; - } + + t_assert(!block->items.isEmpty()); } } @@ -1244,7 +1208,7 @@ HistoryItem *Histories::addNewMessage(const MTPMessage &msg, NewMessageType type return findOrInsert(peer, 0, 0)->addNewMessage(msg, type); } -HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, bool applyServiceAction) { +HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, bool detachExistingItem) { MsgId msgId = 0; switch (msg.type()) { case mtpc_messageEmpty: msgId = msg.c_messageEmpty().vid.v; break; @@ -1255,10 +1219,8 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo HistoryItem *result = App::histItemById(channelId(), msgId); if (result) { - if (block) { - if (!result->detached()) { - result->detach(); - } + if (!result->detached() && detachExistingItem) { + result->detach(); } if (msg.type() == mtpc_message) { result->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0); @@ -1505,18 +1467,7 @@ HistoryItem *History::createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 } HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags, HistoryMedia *media, bool newMsg) { - HistoryBlock *to = 0; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); - } - - HistoryItem *result = HistoryServiceMsg::create(this, msgId, date, text, flags, media); - return addNewItem(to, newBlock, result, newMsg); + return addNewItem(HistoryServiceMsg::create(this, msgId, date, text, flags, media), newMsg); } HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) { @@ -1534,66 +1485,32 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) return item; } - HistoryBlock *to = nullptr; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); + return addNewToLastBlock(msg, type); +} + +HistoryItem *History::addNewToLastBlock(const MTPMessage &msg, NewMessageType type) { + bool applyServiceAction = (type == NewMessageUnread), detachExistingItem = (type != NewMessageLast); + HistoryItem *item = createItem(msg, applyServiceAction, detachExistingItem); + if (!item || !item->detached()) { + return item; } - HistoryItem *item = createItem((type == NewMessageLast) ? nullptr : to, msg, (type == NewMessageUnread)); - if (type == NewMessageLast && item) { - if (!item->detached()) { - t_assert(!newBlock); - return item; - } - } - return addNewItem(to, newBlock, item, (type == NewMessageUnread)); + return addNewItem(item, (type == NewMessageUnread)); } HistoryItem *History::addToHistory(const MTPMessage &msg) { - return createItem(nullptr, msg, false); + return createItem(msg, false, false); } HistoryItem *History::addNewForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *item) { - HistoryBlock *to = nullptr; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); - } - return addNewItem(to, newBlock, createItemForwarded(id, flags, date, from, item), true); + return addNewItem(createItemForwarded(id, flags, date, from, item), true); } HistoryItem *History::addNewDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { - HistoryBlock *to = 0; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); - } - return addNewItem(to, newBlock, createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption), true); + return addNewItem(createItemDocument(id, flags, viaBotId, replyTo, date, from, doc, caption), true); } HistoryItem *History::addNewPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { - HistoryBlock *to = 0; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - } else { - to = blocks.back(); - t_assert(!to->items.isEmpty()); - t_assert(to->items.back() != nullptr); - } - return addNewItem(to, newBlock, createItemPhoto(id, flags, viaBotId, replyTo, date, from, photo, caption), true); + return addNewItem(createItemPhoto(id, flags, viaBotId, replyTo, date, from, photo, caption), true); } bool History::addToOverview(MediaOverviewType type, MsgId msgId, AddToOverviewMethod method) { @@ -1639,27 +1556,21 @@ void History::eraseFromOverview(MediaOverviewType type, MsgId msgId) { if (App::wnd()) App::wnd()->mediaOverviewUpdated(peer, type); } -HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg) { - if (!adding) { - if (newBlock) delete to; - return adding; - } +HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) { + t_assert(adding != nullptr); + t_assert(adding->detached()); - if (newBlock) { - to->y = height; - blocks.push_back(to); + if (blocks.isEmpty()) { + blocks.push_back(new HistoryBlock(this)); + blocks.back()->setIndexInHistory(blocks.size()); } - adding->attachToBlock(to, to->items.size()); - to->items.push_back(adding); + HistoryBlock *block = blocks.back(); + + adding->attachToBlock(block, block->items.size()); + block->items.push_back(adding); adding->previousItemChanged(); setLastMessage(adding); - adding->y = to->height; - if (width) { - int32 dh = adding->resize(width); - to->height += dh; - height += dh; - } if (newMsg) { newItemAdded(adding); } @@ -1775,10 +1686,6 @@ HistoryItem *History::addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *pr item->attachToBlock(block, block->items.size()); block->items.push_back(item); item->previousItemChanged(); - if (width) { - item->y = block->height; - block->height += item->resize(width); - } return item; } @@ -1824,10 +1731,16 @@ void History::addOlderSlice(const QVector &slice, const QVectorsetIndexInHistory(0); + blocks.push_front(block); + for (int i = 1, l = blocks.size(); i < l; ++i) { + blocks.at(i)->setIndexInHistory(i); + } + block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { --i; - HistoryItem *adding = createItem(block, *i, false); + HistoryItem *adding = createItem(*i, false, true); if (!adding) continue; for (; groupsIt != groupsEnd; ++groupsIt) { @@ -1847,112 +1760,99 @@ void History::addOlderSlice(const QVector &slice, const QVectoritems.front(); - while (oldFirst && last && oldFirst->type() == HistoryItemGroup && last->type() == HistoryItemGroup) { - static_cast(last)->uniteWith(static_cast(oldFirst)); - oldFirst->destroy(); - if (blocks.isEmpty()) { - oldFirst = 0; - } else { - t_assert(blocks.size() > 1); - oldFirst = blocks.at(1)->items.front(); - } - } if (block->items.isEmpty()) { - oldLoaded = true; + blocks.pop_front(); delete block; - } else { - if (oldFirst) { - blocks.push_front(block); - if (width) { - block->y = 0; - for (int32 i = 1, l = blocks.size(); i < l; ++i) { - blocks.at(i)->y += block->height; - } - height += block->height; - } - } else { - blocks.push_front(block); - if (width) { - height = block->height; - } - } + block = nullptr; - if (loadedAtBottom()) { // add photos to overview and authors to lastAuthors / lastParticipants - bool channel = isChannel(); - int32 mask = 0; - QList *lastAuthors = 0; - OrderedSet *markupSenders = 0; - if (peer->isChat()) { - lastAuthors = &peer->asChat()->lastAuthors; - markupSenders = &peer->asChat()->markupSenders; - } else if (peer->isMegagroup()) { - lastAuthors = &peer->asChannel()->mgInfo->lastParticipants; - markupSenders = &peer->asChannel()->mgInfo->markupSenders; - } - for (int32 i = block->items.size(); i > 0; --i) { - HistoryItem *item = block->items[i - 1]; - mask |= item->addToOverview(AddToOverviewFront); - if (item->from()->id) { - if (lastAuthors) { // chats - if (item->from()->isUser()) { - if (!lastAuthors->contains(item->from()->asUser())) { - lastAuthors->push_back(item->from()->asUser()); - if (peer->isMegagroup()) { - peer->asChannel()->mgInfo->lastParticipantsStatus |= MegagroupInfo::LastParticipantsAdminsOutdated; - } + oldLoaded = true; + } else if (loadedAtBottom()) { // add photos to overview and authors to lastAuthors / lastParticipants + bool channel = isChannel(); + int32 mask = 0; + QList *lastAuthors = 0; + OrderedSet *markupSenders = 0; + if (peer->isChat()) { + lastAuthors = &peer->asChat()->lastAuthors; + markupSenders = &peer->asChat()->markupSenders; + } else if (peer->isMegagroup()) { + lastAuthors = &peer->asChannel()->mgInfo->lastParticipants; + markupSenders = &peer->asChannel()->mgInfo->markupSenders; + } + for (int32 i = block->items.size(); i > 0; --i) { + HistoryItem *item = block->items[i - 1]; + mask |= item->addToOverview(AddToOverviewFront); + if (item->from()->id) { + if (lastAuthors) { // chats + if (item->from()->isUser()) { + if (!lastAuthors->contains(item->from()->asUser())) { + lastAuthors->push_back(item->from()->asUser()); + if (peer->isMegagroup()) { + peer->asChannel()->mgInfo->lastParticipantsStatus |= MegagroupInfo::LastParticipantsAdminsOutdated; } } } } - if (item->author()->id) { - if (markupSenders) { // chats with bots - if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { - MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; - if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { - bool wasKeyboardHide = markupSenders->contains(item->author()); - if (!wasKeyboardHide) { - markupSenders->insert(item->author()); - } - if (!(markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero)) { - if (!lastKeyboardInited) { - bool botNotInChat = false; - if (peer->isChat()) { - botNotInChat = (!peer->canWrite() || !peer->asChat()->participants.isEmpty()) && item->author()->isUser() && !peer->asChat()->participants.contains(item->author()->asUser()); - } else if (peer->isMegagroup()) { - botNotInChat = (!peer->canWrite() || peer->asChannel()->mgInfo->botStatus != 0) && item->author()->isUser() && !peer->asChannel()->mgInfo->bots.contains(item->author()->asUser()); - } - if (wasKeyboardHide || botNotInChat) { - clearLastKeyboard(); - } else { - lastKeyboardInited = true; - lastKeyboardId = item->id; - lastKeyboardFrom = item->author()->id; - lastKeyboardUsed = false; - } + } + if (item->author()->id) { + if (markupSenders) { // chats with bots + if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { + MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { + bool wasKeyboardHide = markupSenders->contains(item->author()); + if (!wasKeyboardHide) { + markupSenders->insert(item->author()); + } + if (!(markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero)) { + if (!lastKeyboardInited) { + bool botNotInChat = false; + if (peer->isChat()) { + botNotInChat = (!peer->canWrite() || !peer->asChat()->participants.isEmpty()) && item->author()->isUser() && !peer->asChat()->participants.contains(item->author()->asUser()); + } else if (peer->isMegagroup()) { + botNotInChat = (!peer->canWrite() || peer->asChannel()->mgInfo->botStatus != 0) && item->author()->isUser() && !peer->asChannel()->mgInfo->bots.contains(item->author()->asUser()); + } + if (wasKeyboardHide || botNotInChat) { + clearLastKeyboard(); + } else { + lastKeyboardInited = true; + lastKeyboardId = item->id; + lastKeyboardFrom = item->author()->id; + lastKeyboardUsed = false; } } } } - } else if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { // conversations with bots - MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; - if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { - if (markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero) { - clearLastKeyboard(); - } else { - lastKeyboardInited = true; - lastKeyboardId = item->id; - lastKeyboardFrom = item->author()->id; - lastKeyboardUsed = false; - } + } + } else if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { // conversations with bots + MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { + if (markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero) { + clearLastKeyboard(); + } else { + lastKeyboardInited = true; + lastKeyboardId = item->id; + lastKeyboardFrom = item->author()->id; + lastKeyboardUsed = false; } } } } - for (int32 t = 0; t < OverviewCount; ++t) { - if ((mask & (1 << t)) && App::wnd()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(t)); - } } + for (int32 t = 0; t < OverviewCount; ++t) { + if ((mask & (1 << t)) && App::wnd()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(t)); + } + } + + // we've added a new front block, now we check if both + // last message of the first block and first message of + // the last block are groups, if they are - unite them + HistoryItem *first = (block && blocks.size() > 1) ? blocks.at(1)->items.front() : nullptr; + if (first && last && first->type() == HistoryItemGroup && last->type() == HistoryItemGroup) { + static_cast(first)->uniteWith(static_cast(last)); + last->destroy(); + + // last->destroy() could've destroyed this new block + // so we can't rely on this pointer any more + block = nullptr; } if (isChannel()) { @@ -1976,10 +1876,13 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.back(); HistoryBlock *block = new HistoryBlock(this); + block->setIndexInHistory(blocks.size()); + blocks.push_back(block); + block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { --i; - HistoryItem *adding = createItem(block, *i, false); + HistoryItem *adding = createItem(*i, false, true); if (!adding) continue; for (; groupsIt != groupsEnd; ++groupsIt) { @@ -2002,13 +1905,10 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.isEmpty()) { newLoaded = true; setLastMessage(lastImportantMessage()); + + blocks.pop_back(); delete block; - } else { - blocks.push_back(block); - if (width) { - block->y = height; - height += block->height; - } + block = nullptr; } } @@ -2621,29 +2521,16 @@ void History::changeMsgId(MsgId oldId, MsgId newId) { } } -void History::blockResized(HistoryBlock *block, int32 dh) { - int32 i = blocks.indexOf(block), l = blocks.size(); - if (i >= 0) { - for (++i; i < l; ++i) { - blocks[i]->y -= dh; - } - height -= dh; - } -} - void History::removeBlock(HistoryBlock *block) { - int32 i = blocks.indexOf(block), h = block->height; - if (i >= 0) { - blocks.removeAt(i); - int32 l = blocks.size(); - if (i > 0 && l == 1) { // only fake block with date left - removeBlock(blocks[0]); - height = 0; - } else if (h) { - for (; i < l; ++i) { - blocks[i]->y -= h; - } - height -= h; + int index = blocks.indexOf(block); + if (index >= 0) { + setPendingResize(); + blocks.removeAt(index); + for (int i = index, l = blocks.size(); i < l; ++i) { + blocks.at(i)->setIndexInHistory(i); + } + if (index < blocks.size()) { + blocks.at(index)->items.front()->previousItemChanged(); } } delete block; @@ -2691,14 +2578,14 @@ void HistoryBlock::clear(bool leaveItems) { } void HistoryBlock::removeItem(HistoryItem *item) { - int32 i = items.indexOf(item), dh = 0; + int32 index = items.indexOf(item), dh = 0; if (history->showFrom == item) { - history->getNextShowFrom(this, i); + history->getNextShowFrom(this, index); } if (history->unreadBar == item) { history->unreadBar = nullptr; } - if (i < 0) { + if (index < 0) { return; } @@ -2708,7 +2595,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { HistoryGroup *nextGroup = 0, *prevGroup = 0; HistoryCollapse *nextCollapse = 0; HistoryItem *prevItem = 0; - for (int32 nextBlock = myIndex, nextIndex = qMin(items.size(), i + 1); nextBlock < history->blocks.size(); ++nextBlock) { + for (int32 nextBlock = myIndex, nextIndex = qMin(items.size(), index + 1); nextBlock < history->blocks.size(); ++nextBlock) { HistoryBlock *block = history->blocks.at(nextBlock); for (; nextIndex < block->items.size(); ++nextIndex) { HistoryItem *item = block->items.at(nextIndex); @@ -2728,7 +2615,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { break; } } - for (int32 prevBlock = myIndex + 1, prevIndex = qMax(1, i); prevBlock > 0;) { + for (int32 prevBlock = myIndex + 1, prevIndex = qMax(1, index); prevBlock > 0;) { --prevBlock; HistoryBlock *block = history->blocks.at(prevBlock); if (!prevIndex) prevIndex = block->items.size(); @@ -2760,19 +2647,21 @@ void HistoryBlock::removeItem(HistoryItem *item) { // myIndex can be invalid now, because of destroying previous blocks dh = item->height(); - items.remove(i); + items.remove(index); if ((!item->out() || item->isPost()) && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); } History *h = history; - if (int32 l = items.size()) { - for (; i < l; ++i) { - items.at(i)->y -= dh; + if (int l = items.size()) { + for (int i = index; i < l; ++i) { items.at(i)->setIndexInBlock(i); } - height -= dh; - history->blockResized(this, dh); + if (index < items.size()) { + items.at(index)->previousItemChanged(); + } else if (_indexInHistory + 1 < history->blocks.size()) { + history->blocks.at(_indexInHistory + 1)->items.front()->previousItemChanged(); + } } else { history->removeBlock(this); } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 379752697..da98d2955 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -236,16 +236,10 @@ public: return blocks.isEmpty(); } void clear(bool leaveItems = false); - void blockResized(HistoryBlock *block, int32 dh); void removeBlock(HistoryBlock *block); virtual ~History(); - HistoryItem *createItem(HistoryBlock *block, const MTPMessage &msg, bool applyServiceAction); - HistoryItem *createItemForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *msg); - HistoryItem *createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); - HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); - HistoryItem *addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, bool newMsg = true); HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); HistoryItem *addToHistory(const MTPMessage &msg); @@ -439,6 +433,7 @@ public: protected: void clearOnDestroy(); + HistoryItem *addNewToLastBlock(const MTPMessage &msg, NewMessageType type); private: @@ -467,9 +462,14 @@ private: friend class HistoryBlock; friend class ChannelHistory; + HistoryItem *createItem(const MTPMessage &msg, bool applyServiceAction, bool detachExistingItem); + HistoryItem *createItemForwarded(MsgId id, MTPDmessage::Flags flags, QDateTime date, int32 from, HistoryMessage *msg); + HistoryItem *createItemDocument(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, DocumentData *doc, const QString &caption); + HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); + HistoryItem *addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block); HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); - HistoryItem *addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *adding, bool newMsg); + HistoryItem *addNewItem(HistoryItem *adding, bool newMsg); HistoryItem *addMessageGroupAfterPrevToBlock(const MTPDmessageGroup &group, HistoryItem *prev, HistoryBlock *block); HistoryItem *addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev); @@ -851,6 +851,9 @@ public: HistoryBlock *previous() const { return (_indexInHistory > 0) ? history->blocks.at(_indexInHistory - 1) : nullptr; } + void setIndexInHistory(int index) { + _indexInHistory = index; + } protected: @@ -1346,7 +1349,7 @@ protected: return nullptr; } - // this should be used only in initDimensions() + // this should be used only in previousItemChanged() // to add required bits to the Interfaces mask // after that always use Is() bool displayDate() const { From 0b2bcbc3e93a7fe62889abc66cc5726313170be7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 20 Mar 2016 11:16:35 +0300 Subject: [PATCH 06/10] some warnings fixed, TDESKTOP_DISABLE_NETWORK_PROXY macro added --- Telegram/SourceFiles/_other/genlang.cpp | 57 ++++++++++++++----- Telegram/SourceFiles/app.cpp | 6 ++ Telegram/SourceFiles/app.h | 2 + Telegram/SourceFiles/application.cpp | 2 + Telegram/SourceFiles/audio.cpp | 27 +++++---- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/connectionbox.cpp | 2 + Telegram/SourceFiles/boxes/usernamebox.cpp | 2 +- Telegram/SourceFiles/history.cpp | 3 +- Telegram/SourceFiles/localstorage.cpp | 2 +- Telegram/SourceFiles/logs.cpp | 33 +++++++++-- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mtproto/generate.py | 2 +- .../SourceFiles/mtproto/mtpConnection.cpp | 14 +++-- Telegram/SourceFiles/mtproto/mtpConnection.h | 2 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 22 ++----- .../SourceFiles/mtproto/mtpFileLoader.cpp | 6 ++ Telegram/SourceFiles/mtproto/mtpFileLoader.h | 4 ++ Telegram/SourceFiles/mtproto/mtpScheme.h | 22 ------- Telegram/SourceFiles/overviewwidget.cpp | 2 - Telegram/SourceFiles/pspecific_wnd.cpp | 15 ++--- Telegram/SourceFiles/settingswidget.cpp | 4 ++ Telegram/SourceFiles/settingswidget.h | 10 ++-- Telegram/SourceFiles/types.h | 2 +- Telegram/Telegram.vcxproj | 3 +- 25 files changed, 143 insertions(+), 105 deletions(-) diff --git a/Telegram/SourceFiles/_other/genlang.cpp b/Telegram/SourceFiles/_other/genlang.cpp index 2050bfcbf..4108f7ad2 100644 --- a/Telegram/SourceFiles/_other/genlang.cpp +++ b/Telegram/SourceFiles/_other/genlang.cpp @@ -189,7 +189,7 @@ void readKeyValue(const char *&from, const char *end) { if (*from == ':') { start = ++from; - + QVector &counted(keysCounted[varName][tagName]); QByteArray subvarValue; bool foundtag = false; @@ -606,13 +606,22 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ ++depth; current += ich; - if (tag == current) { + bool exact = (tag == current); + if (exact) { tcpp << tab.repeated(depth + 1) << "if (ch + " << depth << " == e) {\n"; tcpp << tab.repeated(depth + 1) << "\treturn lt_" << tag << ";\n"; tcpp << tab.repeated(depth + 1) << "}\n"; } - tcpp << tab.repeated(depth + 1) << "if (ch + " << depth << " < e) switch (*(ch + " << depth << ")) {\n"; + QByteArray nexttag = j.key(); + if (exact && depth > 0 && nexttag.mid(0, depth) != current) { + current.chop(1); + --depth; + tcpp << tab.repeated(depth + 1) << "break;\n"; + break; + } else { + tcpp << tab.repeated(depth + 1) << "if (ch + " << depth << " < e) switch (*(ch + " << depth << ")) {\n"; + } } while (true); ++j; } @@ -637,7 +646,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ tcpp << "\tswitch (*(ch + " << depth << ")) {\n"; for (LangKeys::const_iterator i = keys.cbegin(), j = i + 1, e = keys.cend(); i != e; ++i) { QByteArray key = i.key(); - while (key.mid(0, depth) != current) { + while (depth > 0 && key.mid(0, depth) != current) { tcpp << tab.repeated(depth - 3) << "}\n"; current.chop(1); --depth; @@ -645,7 +654,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ } do { if (key == current) break; - + char ich = i.key().at(current.size()); tcpp << tab.repeated(current.size() - 3) << "case '" << ich << "':\n"; if (j == e || ich != ((j.key().size() > depth) ? j.key().at(depth) : 0)) { @@ -661,13 +670,22 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ ++depth; current += ich; - if (key == current) { + bool exact = (key == current); + if (exact) { tcpp << tab.repeated(depth - 3) << "if (ch + " << depth << " == e) {\n"; tcpp << tab.repeated(depth - 3) << "\treturn " << key << (keysTags[key].isEmpty() ? "" : "__tagged") << ";\n"; tcpp << tab.repeated(depth - 3) << "}\n"; } - tcpp << tab.repeated(depth - 3) << "if (ch + " << depth << " < e) switch (*(ch + " << depth << ")) {\n"; + QByteArray nextkey = j.key(); + if (exact && depth > 0 && nextkey.mid(0, depth) != current) { + current.chop(1); + --depth; + tcpp << tab.repeated(depth - 3) << "break;\n"; + break; + } else { + tcpp << tab.repeated(depth - 3) << "if (ch + " << depth << " < e) switch (*(ch + " << depth << ")) {\n"; + } } while (true); ++j; } @@ -707,16 +725,25 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ tcpp << "\tif (index >= lngtags_max_counted_values) return lngkeys_cnt;\n\n"; if (!tags.isEmpty()) { tcpp << "\tswitch (key) {\n"; - for (int i = 0, l = keysOrder.size(); i < l; ++i) { - QVector &tagsList(keysTags[keysOrder[i]]); + for (auto key : keysOrder) { + QVector &tagsList(keysTags[key]); if (tagsList.isEmpty()) continue; - QMap > &countedTags(keysCounted[keysOrder[i]]); - tcpp << "\tcase " << keysOrder[i] << "__tagged: {\n"; + QMap > &countedTags(keysCounted[key]); + bool hasCounted = false; + for (auto tag : tagsList) { + if (!countedTags[tag].isEmpty()) { + hasCounted = true; + break; + } + } + if (!hasCounted) continue; + + tcpp << "\tcase " << key << "__tagged: {\n"; tcpp << "\t\tswitch (tag) {\n"; - for (int j = 0, s = tagsList.size(); j < s; ++j) { - if (!countedTags[tagsList[j]].isEmpty()) { - tcpp << "\t\tcase lt_" << tagsList[j] << ": return LangKey(" << keysOrder[i] << "__" << tagsList[j] << "0 + index);\n"; + for (auto tag : tagsList) { + if (!countedTags[tag].isEmpty()) { + tcpp << "\t\tcase lt_" << tag << ": return LangKey(" << key << "__" << tag << "0 + index);\n"; } } tcpp << "\t\t}\n"; @@ -724,7 +751,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ } tcpp << "\t}\n\n"; } - tcpp << "\treturn lngkeys_cnt;"; + tcpp << "\treturn lngkeys_cnt;\n"; tcpp << "}\n\n"; tcpp << "bool LangLoader::feedKeyValue(LangKey key, const QString &value) {\n"; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 39956672a..776cd91c8 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2474,9 +2474,12 @@ namespace App { } void setProxySettings(QNetworkAccessManager &manager) { +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY manager.setProxy(getHttpProxySettings()); +#endif } +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxy getHttpProxySettings() { const ConnectionProxy *proxy = 0; if (Global::started()) { @@ -2489,14 +2492,17 @@ namespace App { } return QNetworkProxy(QNetworkProxy::DefaultProxy); } +#endif void setProxySettings(QTcpSocket &socket) { +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY if (cConnectionType() == dbictTcpProxy) { const ConnectionProxy &p(cConnectionProxy()); socket.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, p.host, p.port, p.user, p.password)); } else { socket.setProxy(QNetworkProxy(QNetworkProxy::NoProxy)); } +#endif } QImage **cornersMask() { diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 36ea5d791..43ddf5f61 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -250,7 +250,9 @@ namespace App { const ReplyMarkup &replyMarkup(ChannelId channelId, MsgId msgId); void setProxySettings(QNetworkAccessManager &manager); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxy getHttpProxySettings(); +#endif void setProxySettings(QTcpSocket &socket); QImage **cornersMask(); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 23809f40c..3189c73f8 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -761,7 +761,9 @@ AppClass::AppClass() : QObject() _window->showSettings(); } +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxyFactory::setUseSystemConfiguration(true); +#endif if (state != Local::ReadMapPassNeeded) { checkMapVersion(); diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 48a5834cc..25f11dc58 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -226,10 +226,10 @@ void audioPlayNotify() { void audioFinish() { if (player) { - delete player; + deleteAndMark(player); } if (capture) { - delete capture; + deleteAndMark(capture); } alSourceStop(notifySource); @@ -243,14 +243,14 @@ void audioFinish() { } if (audioContext) { - alcMakeContextCurrent(NULL); + alcMakeContextCurrent(nullptr); alcDestroyContext(audioContext); - audioContext = 0; + audioContext = nullptr; } if (audioDevice) { alcCloseDevice(audioDevice); - audioDevice = 0; + audioDevice = nullptr; } cSetHasAudioCapture(false); @@ -1685,7 +1685,7 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const err = SetupErrorAtStart; QMutexLocker lock(&playerMutex); AudioPlayer *voice = audioPlayer(); - if (!voice) return 0; + if (!voice) return nullptr; bool isGoodId = false; AudioPlayer::Msg *m = 0; @@ -1717,7 +1717,7 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const if (!l || !m) { LOG(("Audio Error: trying to load part of audio, that is not current at the moment")); err = SetupErrorNotPlaying; - return 0; + return nullptr; } if (*l && (!isGoodId || !(*l)->check(m->file, m->data))) { @@ -1741,27 +1741,26 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const // if (!f.open(QIODevice::ReadOnly)) { // LOG(("Audio Error: could not open file '%1'").arg(m->fname)); // m->state = AudioPlayerStoppedAtStart; -// return 0; +// return nullptr; // } // header = f.read(8); // } // if (header.size() < 8) { // LOG(("Audio Error: could not read header from file '%1', data size %2").arg(m->fname).arg(m->data.isEmpty() ? QFileInfo(m->fname).size() : m->data.size())); // m->state = AudioPlayerStoppedAtStart; -// return 0; +// return nullptr; // } *l = new FFMpegLoader(m->file, m->data); - int ret; if (!(*l)->open(position)) { m->state = AudioPlayerStoppedAtStart; - return 0; + return nullptr; } int64 duration = (*l)->duration(); if (duration <= 0) { m->state = AudioPlayerStoppedAtStart; - return 0; + return nullptr; } m->duration = duration; m->frequency = (*l)->frequency(); @@ -1771,7 +1770,7 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const if (!m->skipEnd) { err = SetupErrorLoadedFull; LOG(("Audio Error: trying to load part of audio, that is already loaded to the end")); - return 0; + return nullptr; } } return *l; @@ -2029,7 +2028,7 @@ void AudioCaptureInner::onStart() { } // Open audio stream - if ((res = avcodec_open2(d->codecContext, d->codec, NULL)) < 0) { + if ((res = avcodec_open2(d->codecContext, d->codec, nullptr)) < 0) { LOG(("Audio Error: Unable to avcodec_open2 for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res))); onStop(false); emit error(); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 8a39799e0..0d4178a5d 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -839,7 +839,7 @@ void SetupChannelBox::onChange() { } _checkTimer.stop(); } else { - int32 i, len = name.size(); + int32 len = name.size(); for (int32 i = 0; i < len; ++i) { QChar ch = name.at(i); if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_') { diff --git a/Telegram/SourceFiles/boxes/connectionbox.cpp b/Telegram/SourceFiles/boxes/connectionbox.cpp index 27b2ce7ff..aa5ebd767 100644 --- a/Telegram/SourceFiles/boxes/connectionbox.cpp +++ b/Telegram/SourceFiles/boxes/connectionbox.cpp @@ -201,8 +201,10 @@ void ConnectionBox::onSave() { } else { cSetConnectionType(dbictAuto); cSetConnectionProxy(ConnectionProxy()); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxyFactory::setUseSystemConfiguration(false); QNetworkProxyFactory::setUseSystemConfiguration(true); +#endif } if (cPlatform() == dbipWindows && cTryIPv6() != _tryIPv6.checked()) { cSetTryIPv6(_tryIPv6.checked()); diff --git a/Telegram/SourceFiles/boxes/usernamebox.cpp b/Telegram/SourceFiles/boxes/usernamebox.cpp index 13786841f..247db630f 100644 --- a/Telegram/SourceFiles/boxes/usernamebox.cpp +++ b/Telegram/SourceFiles/boxes/usernamebox.cpp @@ -160,7 +160,7 @@ void UsernameBox::onChanged() { } _checkTimer.stop(); } else { - int32 i, len = name.size(); + int32 len = name.size(); for (int32 i = 0; i < len; ++i) { QChar ch = name.at(i); if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_' && (ch != '@' || i > 0)) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 85188c283..ad6c2ead0 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2646,7 +2646,6 @@ void HistoryBlock::removeItem(HistoryItem *item) { } // myIndex can be invalid now, because of destroying previous blocks - dh = item->height(); items.remove(index); if ((!item->out() || item->isPost()) && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); @@ -4725,7 +4724,7 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, _data->checkSticker(); bool loaded = _data->loaded(); - bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost, hovered, pressed; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 usew = _maxw, usex = 0; const HistoryReply *reply = toHistoryReply(parent); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index d0959f05e..0bcdb8be8 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -3663,7 +3663,7 @@ namespace Local { QString name, invitationUrl; quint64 access; - qint32 date, version, adminned, forbidden, flags; + qint32 date, version, forbidden, flags; from.stream >> name >> access >> date >> version >> forbidden >> flags >> invitationUrl; if (!wasLoaded) { diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 5a1e5d520..aaad6db26 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -642,14 +642,26 @@ namespace SignalHandlers { return stream; } + template + struct _writeNumberSignAndRemoveIt { + static void call(Type &number) { + if (number < 0) { + _writeChar('-'); + number = -number; + } + } + }; + template + struct _writeNumberSignAndRemoveIt { + static void call(Type &number) { + } + }; + template const dump &_writeNumber(const dump &stream, Type number) { if (!CrashDumpFile) return stream; - if (number < 0) { - _writeChar('-'); - number = -number; - } + _writeNumberSignAndRemoveIt<(Type(-1) > Type(0)), Type>::call(number); Type upper = 1, prev = number / 10; while (prev >= upper) { upper *= 10; @@ -937,7 +949,10 @@ namespace SignalHandlers { Status start() { CrashDumpPath = cWorkingDir() + qsl("tdata/working"); #ifdef Q_OS_WIN - if (FILE *f = _wfopen(CrashDumpPath.toStdWString().c_str(), L"rb")) { + FILE *f = nullptr; + if (_wfopen_s(&f, CrashDumpPath.toStdWString().c_str(), L"rb") != 0) { + f = nullptr; + } else { #else if (FILE *f = fopen(QFile::encodeName(CrashDumpPath).constData(), "rb")) { #endif @@ -964,12 +979,18 @@ namespace SignalHandlers { } #ifdef Q_OS_WIN - CrashDumpFile = _wfopen(CrashDumpPath.toStdWString().c_str(), L"wb"); + if (_wfopen_s(&CrashDumpFile, CrashDumpPath.toStdWString().c_str(), L"wb") != 0) { + CrashDumpFile = nullptr; + } #else CrashDumpFile = fopen(QFile::encodeName(CrashDumpPath).constData(), "wb"); #endif if (CrashDumpFile) { +#ifdef Q_OS_WIN + CrashDumpFileNo = _fileno(CrashDumpFile); +#else CrashDumpFileNo = fileno(CrashDumpFile); +#endif if (SetSignalHandlers) { #ifndef Q_OS_WIN struct sigaction sigact; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index c420db743..5fc4200ac 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4027,7 +4027,7 @@ void MainWidget::updateReceived(const mtpPrime *from, const mtpPrime *end) { feedUpdates(updates); } App::emitPeerUpdated(); - } catch (mtpErrorUnexpected &e) { // just some other type + } catch (mtpErrorUnexpected &) { // just some other type } } update(); diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index a802e721d..433d9c2ae 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -722,7 +722,7 @@ for restype in typesList: typesText += '\tvoid write(mtpBuffer &to) const;\n'; # write method inlineMethods += 'inline void MTP' + restype + '::write(mtpBuffer &to) const {\n'; - if (withType): + if (withType and writer != ''): inlineMethods += '\tswitch (_type) {\n'; inlineMethods += writer; inlineMethods += '\t}\n'; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index e74184483..9903cfd54 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -641,7 +641,9 @@ MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection moveToThread(thread); manager.moveToThread(thread); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY manager.setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy)); +#endif httpStartTimer.moveToThread(thread); httpStartTimer.setSingleShot(true); @@ -652,7 +654,9 @@ MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection connect(&tcpTimeoutTimer, SIGNAL(timeout()), this, SLOT(onTcpTimeoutTimer())); sock.moveToThread(thread); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY sock.setProxy(QNetworkProxy(QNetworkProxy::NoProxy)); +#endif connect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError))); connect(&sock, SIGNAL(connected()), this, SLOT(onSocketConnected())); connect(&sock, SIGNAL(disconnected()), this, SLOT(onSocketDisconnected())); @@ -2722,7 +2726,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt MTPMsgResendReq request(rFrom, rEnd); handleMsgsStates(request.c_msg_resend_req().vmsg_ids.c_vector().v, states, toAck); } - } catch(Exception &e) { + } catch(Exception &) { LOG(("Message Error: could not parse sent msgs_state_req")); throw; } @@ -2942,7 +2946,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt } - } catch (Exception &e) { + } catch (Exception &) { return -1; } @@ -3548,7 +3552,7 @@ void MTProtoConnectionPrivate::dhClientParamsSend() { client_dh_inner_data.vg_b._string().v.resize(256); // gen rand 'b' - uint32 b[64], *g_b((uint32*)&client_dh_inner_data.vg_b._string().v[0]), g_b_len; + uint32 b[64], *g_b((uint32*)&client_dh_inner_data.vg_b._string().v[0]); memset_rand(b, sizeof(b)); // count g_b and auth_key using openssl BIGNUM methods @@ -3807,7 +3811,7 @@ void MTProtoConnectionPrivate::sendRequestNotSecure(const TRequest &request) { onSentSome(buffer.size() * sizeof(mtpPrime)); - } catch (Exception &e) { + } catch (Exception &) { return restart(); } } @@ -3844,7 +3848,7 @@ bool MTProtoConnectionPrivate::readResponseNotSecure(TResponse &response) { } const mtpPrime *from(answer + 5), *end(from + len - 5); response.read(from, end); - } catch (Exception &e) { + } catch (Exception &) { return false; } return true; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index d0513848b..113cd63c1 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -440,7 +440,7 @@ private: MTPabstractConnection *_conn, *_conn4, *_conn6; SingleTimer retryTimer; // exp retry timer - uint32 retryTimeout; + int retryTimeout; quint64 retryWillFinish; SingleTimer oldConnectionTimer; diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 05c26b8e3..b87938ab9 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -831,19 +831,6 @@ public: VType v; }; - - -template -class MTPvector; -template -MTPvector MTP_vector(uint32 count); - -template -MTPvector MTP_vector(uint32 count, const T &value); - -template -MTPvector MTP_vector(const QVector &v); - template class MTPvector : private mtpDataOwner { public: @@ -897,9 +884,12 @@ private: explicit MTPvector(MTPDvector *_data) : mtpDataOwner(_data) { } - friend MTPvector MTP_vector(uint32 count); - friend MTPvector MTP_vector(uint32 count, const T &value); - friend MTPvector MTP_vector(const QVector &v); + template + friend MTPvector MTP_vector(uint32 count); + template + friend MTPvector MTP_vector(uint32 count, const U &value); + template + friend MTPvector MTP_vector(const QVector &v); typedef typename MTPDvector::VType VType; }; template diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index 311fbebf8..54a6740f6 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -771,9 +771,11 @@ private: }; void reinitWebLoadManager() { +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY if (webLoadManager()) { webLoadManager()->setProxySettings(App::getHttpProxySettings()); } +#endif } void stopWebLoadManager() { @@ -790,11 +792,13 @@ void stopWebLoadManager() { } } +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY void WebLoadManager::setProxySettings(const QNetworkProxy &proxy) { QMutexLocker lock(&_loaderPointersMutex); _proxySettings = proxy; emit proxyApplyDelayed(); } +#endif WebLoadManager::WebLoadManager(QThread *thread) { moveToThread(thread); @@ -1021,8 +1025,10 @@ void WebLoadManager::sendRequest(webFileLoaderPrivate *loader, const QString &re } void WebLoadManager::proxyApply() { +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QMutexLocker lock(&_loaderPointersMutex); _manager.setProxy(_proxySettings); +#endif } void WebLoadManager::finish() { diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.h b/Telegram/SourceFiles/mtproto/mtpFileLoader.h index f64ac4d45..c3097b57c 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.h +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.h @@ -321,7 +321,9 @@ public: WebLoadManager(QThread *thread); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY void setProxySettings(const QNetworkProxy &proxy); +#endif void append(webFileLoader *loader, const QString &url); void stop(webFileLoader *reader); @@ -352,7 +354,9 @@ private: void sendRequest(webFileLoaderPrivate *loader, const QString &redirect = QString()); bool handleReplyResult(webFileLoaderPrivate *loader, WebReplyProcessResult result); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxy _proxySettings; +#endif QNetworkAccessManager _manager; typedef QMap LoaderPointers; LoaderPointers _loaderPointers; diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 7c487353c..199ec12e7 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -23307,8 +23307,6 @@ inline void MTPbool::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId } } inline void MTPbool::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPbool::MTPbool(mtpTypeId type) : _type(type) { switch (type) { @@ -24329,8 +24327,6 @@ inline void MTPstorage_fileType::read(const mtpPrime *&from, const mtpPrime *end } } inline void MTPstorage_fileType::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPstorage_fileType::MTPstorage_fileType(mtpTypeId type) : _type(type) { switch (type) { @@ -26148,8 +26144,6 @@ inline void MTPinputPeerNotifyEvents::read(const mtpPrime *&from, const mtpPrime } } inline void MTPinputPeerNotifyEvents::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPinputPeerNotifyEvents::MTPinputPeerNotifyEvents(mtpTypeId type) : _type(type) { switch (type) { @@ -26212,8 +26206,6 @@ inline void MTPpeerNotifyEvents::read(const mtpPrime *&from, const mtpPrime *end } } inline void MTPpeerNotifyEvents::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPpeerNotifyEvents::MTPpeerNotifyEvents(mtpTypeId type) : _type(type) { switch (type) { @@ -27077,8 +27069,6 @@ inline void MTPmessagesFilter::read(const mtpPrime *&from, const mtpPrime *end, } } inline void MTPmessagesFilter::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPmessagesFilter::MTPmessagesFilter(mtpTypeId type) : _type(type) { switch (type) { @@ -29763,8 +29753,6 @@ inline void MTPinputPrivacyKey::read(const mtpPrime *&from, const mtpPrime *end, } } inline void MTPinputPrivacyKey::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPinputPrivacyKey::MTPinputPrivacyKey(mtpTypeId type) : _type(type) { switch (type) { @@ -29795,8 +29783,6 @@ inline void MTPprivacyKey::read(const mtpPrime *&from, const mtpPrime *end, mtpT } } inline void MTPprivacyKey::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPprivacyKey::MTPprivacyKey(mtpTypeId type) : _type(type) { switch (type) { @@ -30382,8 +30368,6 @@ inline void MTPcontactLink::read(const mtpPrime *&from, const mtpPrime *end, mtp } } inline void MTPcontactLink::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPcontactLink::MTPcontactLink(mtpTypeId type) : _type(type) { switch (type) { @@ -32054,8 +32038,6 @@ inline void MTPchannelParticipantsFilter::read(const mtpPrime *&from, const mtpP } } inline void MTPchannelParticipantsFilter::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPchannelParticipantsFilter::MTPchannelParticipantsFilter(mtpTypeId type) : _type(type) { switch (type) { @@ -32095,8 +32077,6 @@ inline void MTPchannelParticipantRole::read(const mtpPrime *&from, const mtpPrim } } inline void MTPchannelParticipantRole::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPchannelParticipantRole::MTPchannelParticipantRole(mtpTypeId type) : _type(type) { switch (type) { @@ -32808,8 +32788,6 @@ inline void MTPauth_codeType::read(const mtpPrime *&from, const mtpPrime *end, m } } inline void MTPauth_codeType::write(mtpBuffer &to) const { - switch (_type) { - } } inline MTPauth_codeType::MTPauth_codeType(mtpTypeId type) : _type(type) { switch (type) { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 4e5bea498..c75c84698 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -613,8 +613,6 @@ void OverviewInner::onDragExec() { bool uponSelected = false; if (_dragItem) { - bool afterDragSymbol; - uint16 symbol; if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) { uponSelected = _selected.contains(_dragItem); } else { diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 82304ce54..72adf5222 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2185,7 +2185,6 @@ namespace PlatformSpecific { namespace { void _psLogError(const char *str, LSTATUS code) { - WCHAR errMsg[2048]; LPTSTR errorText = NULL, errorTextDefault = L"(Unknown error)"; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0); if (!errorText) { @@ -2523,11 +2522,11 @@ bool LoadDbgHelp(bool extended = false) { WCHAR szTemp[4096]; if (GetModuleFileName(NULL, szTemp, 4096) > 0) { - wcscat(szTemp, L".local"); + wcscat_s(szTemp, L".local"); if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES) { // ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows" if (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0) { - wcscat(szTemp, L"\\Debugging Tools for Windows\\dbghelp.dll"); + wcscat_s(szTemp, L"\\Debugging Tools for Windows\\dbghelp.dll"); // now check if the file exists: if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { hDll = LoadLibrary(szTemp); @@ -2535,7 +2534,7 @@ bool LoadDbgHelp(bool extended = false) { } // Still not found? Then try to load the 64-Bit version: if (!hDll && (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0)) { - wcscat(szTemp, L"\\Debugging Tools for Windows 64-Bit\\dbghelp.dll"); + wcscat_s(szTemp, L"\\Debugging Tools for Windows 64-Bit\\dbghelp.dll"); if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { hDll = LoadLibrary(szTemp); } @@ -2729,12 +2728,6 @@ BOOL _getModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULEW64 *pModu } void psWriteDump() { - OSVERSIONINFOEXA version; - ZeroMemory(&version, sizeof(OSVERSIONINFOEXA)); - version.dwOSVersionInfoSize = sizeof(version); - if (GetVersionExA((OSVERSIONINFOA*)&version) != FALSE) { - SignalHandlers::dump() << "OS-Version: " << version.dwMajorVersion << "." << version.dwMinorVersion << "." << version.dwBuildNumber << "\n"; - } } char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; @@ -3291,7 +3284,7 @@ bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title hr = nodeList->get_Length(&nodeListLength); if (!SUCCEEDED(hr)) return false; - if (nodeListLength < (withSubtitle ? 3 : 2)) return false; + if (nodeListLength < (withSubtitle ? 3U : 2U)) return false; { ComPtr textNode; diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 8b87d1c53..6eb623270 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -319,7 +319,9 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) connect(&_autoLock, SIGNAL(clicked()), this, SLOT(onAutoLock())); connect(&_passwordEdit, SIGNAL(clicked()), this, SLOT(onPassword())); connect(&_passwordTurnOff, SIGNAL(clicked()), this, SLOT(onPasswordOff())); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY connect(&_connectionType, SIGNAL(clicked()), this, SLOT(onConnectionType())); +#endif connect(&_showSessions, SIGNAL(clicked()), this, SLOT(onShowSessions())); connect(&_askQuestion, SIGNAL(clicked()), this, SLOT(onAskQuestion())); connect(&_telegramFAQ, SIGNAL(clicked()), this, SLOT(onTelegramFAQ())); @@ -1377,11 +1379,13 @@ void SettingsInner::onAutoLock() { Ui::showLayer(box); } +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY void SettingsInner::onConnectionType() { ConnectionBox *box = new ConnectionBox(); connect(box, SIGNAL(closed()), this, SLOT(updateConnectionType()), Qt::QueuedConnection); Ui::showLayer(box); } +#endif void SettingsInner::onUsername() { UsernameBox *box = new UsernameBox(); diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index d2ed56902..667921ba4 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -101,10 +101,10 @@ public slots: void onUpdatePhoto(); void onUpdatePhotoCancel(); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE void onAutoUpdate(); void onCheckNow(); - #endif +#endif void onRestartNow(); void onFullPeerUpdated(PeerData *peer); @@ -116,7 +116,9 @@ public slots: void onPasswordOff(); void onReloadPassword(Qt::ApplicationState state = Qt::ApplicationActive); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY void onConnectionType(); +#endif void onUsername(); @@ -162,13 +164,13 @@ public slots: void onLocalStorageClear(); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE void onUpdateChecking(); void onUpdateLatest(); void onUpdateDownloading(qint64 ready, qint64 total); void onUpdateReady(); void onUpdateFailed(); - #endif +#endif void onShowSessions(); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 9c590eca5..b630a481e 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -598,7 +598,7 @@ public: return _index.loadAcquire() - 1; } static uint64 Bit() { - return (1 << Index()); + return (1ULL << Index()); } }; diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 99397eaaa..e3c7032b1 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -78,6 +78,7 @@ MultiThreadedDebug Disabled /Zm152 %(AdditionalOptions) + Level3 Windows @@ -1665,7 +1666,7 @@ Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" Moc%27ing introwidget.h... Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp From c15db1f77e0665764d014baa185b59e0020b42f2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 20 Mar 2016 12:10:16 +0300 Subject: [PATCH 07/10] added TDESKTOP_DISABLE_CRASH_REPORTS macro and new pspecific file, pspecific_wnd renamed to pspecific_win --- Telegram/SourceFiles/logs.cpp | 124 +- Telegram/SourceFiles/pspecific.h | 12 +- Telegram/SourceFiles/pspecific_win.cpp | 3656 +++++++++++++++++ .../{pspecific_wnd.h => pspecific_win.h} | 0 ...{pspecific_wnd.cpp => pspecific_winrt.cpp} | 0 Telegram/SourceFiles/pspecific_winrt.h | 198 + Telegram/Telegram.pro | 11 +- Telegram/Telegram.vcxproj | 187 +- Telegram/Telegram.vcxproj.filters | 45 +- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 6 +- 10 files changed, 4087 insertions(+), 152 deletions(-) create mode 100644 Telegram/SourceFiles/pspecific_win.cpp rename Telegram/SourceFiles/{pspecific_wnd.h => pspecific_win.h} (100%) rename Telegram/SourceFiles/{pspecific_wnd.cpp => pspecific_winrt.cpp} (100%) create mode 100644 Telegram/SourceFiles/pspecific_winrt.h diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index aaad6db26..d4ba079b2 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -22,6 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include "pspecific.h" +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + // see https://blog.inventic.eu/2012/08/qt-and-google-breakpad/ #ifdef Q_OS_WIN @@ -30,17 +32,19 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "client/windows/handler/exception_handler.h" #pragma warning(pop) -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC // Q_OS_WIN #ifdef MAC_USE_BREAKPAD #include "client/mac/handler/exception_handler.h" -#else +#else // MAC_USE_BREAKPAD #include "client/crashpad_client.h" -#endif +#endif // else for MAC_USE_BREAKPAD -#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC #include "client/linux/handler/exception_handler.h" -#endif +#endif // Q_OS_LINUX64 || Q_OS_LINUX32 + +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS enum LogDataType { LogDataMain, @@ -286,8 +290,8 @@ void _logsWrite(LogDataType type, const QString &msg) { void _moveOldDataFiles(const QString &from); namespace SignalHandlers { - void StartBreakpad(); - void FinishBreakpad(); + void StartCrashHandler(); + void FinishCrashHandler(); } namespace Logs { @@ -303,22 +307,22 @@ namespace Logs { QString initialWorkingDir = QDir(cWorkingDir()).absolutePath() + '/', moveOldDataFrom; if (cBetaVersion()) { cSetDebug(true); -#if (defined Q_OS_MAC || defined Q_OS_LINUX) +#if defined Q_OS_MAC || defined Q_OS_LINUX } else { #ifdef _DEBUG cForceWorkingDir(cExeDir()); -#else +#else // _DEBUG if (cWorkingDir().isEmpty()) { cForceWorkingDir(psAppDataPath()); } -#endif +#endif // else for _DEBUG workingDirChosen = true; -#if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version +#if defined Q_OS_LINUX && !defined _DEBUG // fix first version moveOldDataFrom = initialWorkingDir; -#endif +#endif // Q_OS_LINUX && !_DEBUG -#endif +#endif // Q_OS_MAC || Q_OS_LINUX } LogsData = new LogsDataFields(); @@ -337,7 +341,7 @@ namespace Logs { QDir().mkpath(cWorkingDir() + qstr("tdata")); Sandbox::WorkingDirReady(); - SignalHandlers::StartBreakpad(); + SignalHandlers::StartCrashHandler(); if (!LogsData->openMain()) { delete LogsData; @@ -389,7 +393,7 @@ namespace Logs { _logsMutex(LogDataMain, true); - SignalHandlers::FinishBreakpad(); + SignalHandlers::FinishCrashHandler(); } bool started() { @@ -606,6 +610,11 @@ void _moveOldDataFiles(const QString &wasDir) { namespace SignalHandlers { + typedef std::map AnnotationsMap; + AnnotationsMap ProcessAnnotations; + +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + QString CrashDumpPath; FILE *CrashDumpFile = nullptr; int CrashDumpFileNo = 0; @@ -712,9 +721,6 @@ namespace SignalHandlers { bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; - typedef std::map AnnotationsMap; - AnnotationsMap ProcessAnnotations; - const char *BreakpadDumpPath = 0; const wchar_t *BreakpadDumpPathW = 0; @@ -726,9 +732,9 @@ namespace SignalHandlers { sigaction(signum, &SIG_def[signum], 0); } -#else +#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64 void Handler(int signum) { -#endif +#endif // else for Q_OS_MAC || Q_OS_LINUX || Q_OS_LINUX64 const char* name = 0; switch (signum) { @@ -739,7 +745,7 @@ namespace SignalHandlers { #ifndef Q_OS_WIN case SIGBUS: name = "SIGBUS"; break; case SIGSYS: name = "SIGSYS"; break; -#endif +#endif // !Q_OS_WIN } Qt::HANDLE thread = QThread::currentThreadId(); @@ -829,17 +835,17 @@ namespace SignalHandlers { dump() << "_unknown_module_\n"; } } -#endif +#endif // Q_OS_MAC dump() << "\nBacktrace:\n"; backtrace_symbols_fd(addresses, size, CrashDumpFileNo); -#else +#else // Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64 dump() << "\nBacktrace:\n"; psWriteStackTrace(); -#endif +#endif // else for Q_OS_MAC || Q_OS_LINUX32 || Q_OS_LINUX64 dump() << "\n"; @@ -853,11 +859,11 @@ namespace SignalHandlers { #ifdef Q_OS_WIN bool DumpCallback(const wchar_t* _dump_dir, const wchar_t* _minidump_id, void* context, EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion, bool success) -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC // Q_OS_WIN bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success) -#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 // Q_OS_MAC bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) -#endif +#endif // Q_OS_LINUX64 || Q_OS_LINUX32 { if (CrashLogged) return success; CrashLogged = true; @@ -865,20 +871,23 @@ namespace SignalHandlers { #ifdef Q_OS_WIN BreakpadDumpPathW = _minidump_id; Handler(-1); -#else +#else // Q_OS_WIN #ifdef Q_OS_MAC BreakpadDumpPath = _minidump_id; -#else +#else // Q_OS_MAC BreakpadDumpPath = md.path(); -#endif +#endif // else for Q_OS_MAC Handler(-1, 0, 0); -#endif +#endif // else for Q_OS_WIN return success; } -#endif +#endif // !Q_OS_MAC || MAC_USE_BREAKPAD - void StartBreakpad() { +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS + + void StartCrashHandler() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS ProcessAnnotations["Binary"] = cExeName().toUtf8().constData(); ProcessAnnotations["ApiId"] = QString::number(ApiId).toUtf8().constData(); ProcessAnnotations["Version"] = (cBetaVersion() ? qsl("%1 beta").arg(cBetaVersion()) : (cDevVersion() ? qsl("%1 dev") : qsl("%1")).arg(AppVersion)).toUtf8().constData(); @@ -897,7 +906,7 @@ namespace SignalHandlers { /*context*/ 0, true ); -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC // Q_OS_WIN #ifdef MAC_USE_BREAKPAD #ifndef _DEBUG @@ -909,9 +918,9 @@ namespace SignalHandlers { true, 0 ); -#endif +#endif // !_DEBUG SetSignalHandlers = false; -#else +#else // MAC_USE_BREAKPAD crashpad::CrashpadClient crashpad_client; std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().constData(); std::string database = QFile::encodeName(dumpspath).constData(); @@ -923,7 +932,7 @@ namespace SignalHandlers { false)) { crashpad_client.UseHandler(); } -#endif +#endif // else for MAC_USE_BREAKPAD #elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( google_breakpad::MinidumpDescriptor(QFile::encodeName(dumpspath).toStdString()), @@ -933,29 +942,36 @@ namespace SignalHandlers { true, -1 ); -#endif +#endif // Q_OS_LINUX64 || Q_OS_LINUX32 +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS } - void FinishBreakpad() { + void FinishCrashHandler() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + #if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD if (BreakpadExceptionHandler) { google_breakpad::ExceptionHandler *h = BreakpadExceptionHandler; BreakpadExceptionHandler = 0; delete h; } -#endif +#endif // !Q_OS_MAC || MAC_USE_BREAKPAD + +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS } Status start() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS CrashDumpPath = cWorkingDir() + qsl("tdata/working"); + #ifdef Q_OS_WIN FILE *f = nullptr; if (_wfopen_s(&f, CrashDumpPath.toStdWString().c_str(), L"rb") != 0) { f = nullptr; } else { -#else +#else // !Q_OS_WIN if (FILE *f = fopen(QFile::encodeName(CrashDumpPath).constData(), "rb")) { -#endif +#endif // else for !Q_OS_WIN QByteArray lastdump; char buffer[256 * 1024] = { 0 }; int32 read = fread(buffer, 1, 256 * 1024, f); @@ -970,10 +986,13 @@ namespace SignalHandlers { return LastCrashed; } + +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS return restart(); } Status restart() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS if (CrashDumpFile) { return Started; } @@ -982,15 +1001,15 @@ namespace SignalHandlers { if (_wfopen_s(&CrashDumpFile, CrashDumpPath.toStdWString().c_str(), L"wb") != 0) { CrashDumpFile = nullptr; } -#else +#else // Q_OS_WIN CrashDumpFile = fopen(QFile::encodeName(CrashDumpPath).constData(), "wb"); -#endif +#endif // else for Q_OS_WIN if (CrashDumpFile) { #ifdef Q_OS_WIN CrashDumpFileNo = _fileno(CrashDumpFile); -#else +#else // Q_OS_WIN CrashDumpFileNo = fileno(CrashDumpFile); -#endif +#endif // else for Q_OS_WIN if (SetSignalHandlers) { #ifndef Q_OS_WIN struct sigaction sigact; @@ -1005,12 +1024,12 @@ namespace SignalHandlers { sigaction(SIGFPE, &sigact, &SIG_def[SIGFPE]); sigaction(SIGBUS, &sigact, &SIG_def[SIGBUS]); sigaction(SIGSYS, &sigact, &SIG_def[SIGSYS]); -#else +#else // !Q_OS_WIN signal(SIGABRT, SignalHandlers::Handler); signal(SIGSEGV, SignalHandlers::Handler); signal(SIGILL, SignalHandlers::Handler); signal(SIGFPE, SignalHandlers::Handler); -#endif +#endif // else for !Q_OS_WIN } return Started; } @@ -1018,9 +1037,13 @@ namespace SignalHandlers { LOG(("FATAL: Could not open '%1' for writing!").arg(CrashDumpPath)); return CantOpen; +#else // !TDESKTOP_DISABLE_CRASH_REPORTS + return Started; +#endif // else for !TDESKTOP_DISABLE_CRASH_REPORTS } void finish() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS FinishBreakpad(); if (CrashDumpFile) { fclose(CrashDumpFile); @@ -1028,10 +1051,11 @@ namespace SignalHandlers { #ifdef Q_OS_WIN _wunlink(CrashDumpPath.toStdWString().c_str()); -#else +#else // Q_OS_WIN unlink(CrashDumpPath.toUtf8().constData()); -#endif +#endif // else for Q_OS_WIN } +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS } void setSelfUsername(const QString &username) { diff --git a/Telegram/SourceFiles/pspecific.h b/Telegram/SourceFiles/pspecific.h index 7003daa42..f0128a173 100644 --- a/Telegram/SourceFiles/pspecific.h +++ b/Telegram/SourceFiles/pspecific.h @@ -26,15 +26,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #ifdef Q_OS_MAC #include "pspecific_mac.h" -#endif +#endif // Q_OS_MAC #ifdef Q_OS_LINUX #include "pspecific_linux.h" -#endif +#endif // Q_OS_LINUX -#ifdef Q_OS_WIN -#include "pspecific_wnd.h" -#endif +#ifdef Q_OS_WINRT +#include "pspecific_winrt.h" +#elif defined Q_OS_WIN // Q_OS_WINRT +#include "pspecific_win.h" +#endif // Q_OS_WIN* namespace PlatformSpecific { diff --git a/Telegram/SourceFiles/pspecific_win.cpp b/Telegram/SourceFiles/pspecific_win.cpp new file mode 100644 index 000000000..4a2aa5a69 --- /dev/null +++ b/Telegram/SourceFiles/pspecific_win.cpp @@ -0,0 +1,3656 @@ +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram 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. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#include "stdafx.h" +#include "pspecific.h" + +#include "lang.h" +#include "application.h" +#include "mainwidget.h" + +#include "localstorage.h" + +#include "passcodewidget.h" + +#include +#include + +#include +#include +#include +#include + +#pragma warning(push) +#pragma warning(disable:4091) +#include +#include +#pragma warning(pop) + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) < (b) ? (b) : (a)) + +#include + +#ifndef DCX_USESTYLE +#define DCX_USESTYLE 0x00010000 +#endif + +#ifndef WM_NCPOINTERUPDATE +#define WM_NCPOINTERUPDATE 0x0241 +#define WM_NCPOINTERDOWN 0x0242 +#define WM_NCPOINTERUP 0x0243 +#endif + +const WCHAR AppUserModelIdRelease[] = L"Telegram.TelegramDesktop"; +const WCHAR AppUserModelIdBeta[] = L"Telegram.TelegramDesktop.Beta"; + +const WCHAR *AppUserModelId() { + return cBetaVersion() ? AppUserModelIdBeta : AppUserModelIdRelease; +} + +static const PROPERTYKEY pkey_AppUserModel_ID = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 5 }; +static const PROPERTYKEY pkey_AppUserModel_StartPinOption = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 12 }; + +using namespace Microsoft::WRL; +using namespace ABI::Windows::UI::Notifications; +using namespace ABI::Windows::Data::Xml::Dom; +using namespace Windows::Foundation; + +namespace { + QStringList _initLogs; + + bool frameless = true; + bool useTheme = false; + bool useOpenWith = false; + bool useOpenAs = false; + bool useWtsapi = false; + bool useShellapi = false; + bool useToast = false; + bool themeInited = false; + bool finished = true; + int menuShown = 0, menuHidden = 0; + int dleft = 0, dtop = 0; + QMargins simpleMargins, margins; + HICON bigIcon = 0, smallIcon = 0, overlayIcon = 0; + bool sessionLoggedOff = false; + + UINT tbCreatedMsgId = 0; + + ComPtr taskbarList; + + ComPtr toastNotificationManager; + ComPtr toastNotifier; + ComPtr toastNotificationFactory; + struct ToastNotificationPtr { + ToastNotificationPtr() { + } + ToastNotificationPtr(const ComPtr &ptr) : p(ptr) { + } + ComPtr p; + }; + typedef QMap > ToastNotifications; + ToastNotifications toastNotifications; + struct ToastImage { + uint64 until; + QString path; + }; + typedef QMap ToastImages; + ToastImages toastImages; + bool ToastImageSavedFlag = false; + + HWND createTaskbarHider() { + HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); + HWND hWnd = 0; + + QString cn = QString("TelegramTaskbarHider"); + LPCWSTR _cn = (LPCWSTR)cn.utf16(); + WNDCLASSEX wc; + + wc.cbSize = sizeof(wc); + wc.style = 0; + wc.lpfnWndProc = DefWindowProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = appinst; + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = 0; + wc.lpszMenuName = NULL; + wc.lpszClassName = _cn; + wc.hIconSm = 0; + if (!RegisterClassEx(&wc)) { + DEBUG_LOG(("Application Error: could not register taskbar hider window class, error: %1").arg(GetLastError())); + return hWnd; + } + + hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); + if (!hWnd) { + DEBUG_LOG(("Application Error: could not create taskbar hider window class, error: %1").arg(GetLastError())); + return hWnd; + } + return hWnd; + } + + enum { + _PsShadowMoved = 0x01, + _PsShadowResized = 0x02, + _PsShadowShown = 0x04, + _PsShadowHidden = 0x08, + _PsShadowActivate = 0x10, + }; + + enum { + _PsInitHor = 0x01, + _PsInitVer = 0x02, + }; + + int32 _psSize = 0; + class _PsShadowWindows { + public: + + _PsShadowWindows() : screenDC(0), max_w(0), max_h(0), _x(0), _y(0), _w(0), _h(0), hidden(true), r(0), g(0), b(0), noKeyColor(RGB(255, 255, 255)) { + for (int i = 0; i < 4; ++i) { + dcs[i] = 0; + bitmaps[i] = 0; + hwnds[i] = 0; + } + } + + void setColor(QColor c) { + r = c.red(); + g = c.green(); + b = c.blue(); + + if (!hwnds[0]) return; + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + for (int i = 0; i < 4; ++i) { + Gdiplus::Graphics graphics(dcs[i]); + graphics.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + if ((i % 2) && _h || !(i % 2) && _w) { + graphics.FillRectangle(&brush, 0, 0, (i % 2) ? _size : _w, (i % 2) ? _h : _size); + } + } + initCorners(); + + _x = _y = _w = _h = 0; + update(_PsShadowMoved | _PsShadowResized); + } + + bool init(QColor c) { + style::rect topLeft = st::wndShadow; + _fullsize = topLeft.width(); + _shift = st::wndShadowShift; + QImage cornersImage(_fullsize, _fullsize, QImage::Format_ARGB32_Premultiplied); + { + QPainter p(&cornersImage); + p.drawPixmap(QPoint(0, 0), App::sprite(), topLeft); + } + if (rtl()) cornersImage = cornersImage.mirrored(true, false); + uchar *bits = cornersImage.bits(); + if (bits) { + for ( + quint32 *p = (quint32*)bits, *end = (quint32*)(bits + cornersImage.byteCount()); + p < end; + ++p + ) { + *p = (*p ^ 0x00ffffff) << 24; + } + } + + _metaSize = _fullsize + 2 * _shift; + _alphas.reserve(_metaSize); + _colors.reserve(_metaSize * _metaSize); + for (int32 j = 0; j < _metaSize; ++j) { + for (int32 i = 0; i < _metaSize; ++i) { + _colors.push_back((i < 2 * _shift || j < 2 * _shift) ? 1 : qMax(BYTE(1), BYTE(cornersImage.pixel(QPoint(i - 2 * _shift, j - 2 * _shift)) >> 24))); + } + } + uchar prev = 0; + for (int32 i = 0; i < _metaSize; ++i) { + uchar a = _colors[(_metaSize - 1) * _metaSize + i]; + if (a < prev) break; + + _alphas.push_back(a); + prev = a; + } + _psSize = _size = _alphas.size() - 2 * _shift; + + setColor(c); + + Gdiplus::GdiplusStartupInput gdiplusStartupInput; + ULONG_PTR gdiplusToken; + Gdiplus::Status gdiRes = Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + + if (gdiRes != Gdiplus::Ok) { + LOG(("Application Error: could not init GDI+, error: %1").arg((int)gdiRes)); + return false; + } + blend.AlphaFormat = AC_SRC_ALPHA; + blend.SourceConstantAlpha = 255; + blend.BlendFlags = 0; + blend.BlendOp = AC_SRC_OVER; + + screenDC = GetDC(0); + if (!screenDC) { + LOG(("Application Error: could not GetDC(0), error: %2").arg(GetLastError())); + return false; + } + + QRect avail(Sandbox::availableGeometry()); + max_w = avail.width(); + if (max_w < st::wndMinWidth) max_w = st::wndMinWidth; + max_h = avail.height(); + if (max_h < st::wndMinHeight) max_h = st::wndMinHeight; + + HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); + HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; + + for (int i = 0; i < 4; ++i) { + QString cn = QString("TelegramShadow%1").arg(i); + LPCWSTR _cn = (LPCWSTR)cn.utf16(); + WNDCLASSEX wc; + + wc.cbSize = sizeof(wc); + wc.style = 0; + wc.lpfnWndProc = wndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = appinst; + wc.hIcon = 0; + wc.hCursor = 0; + wc.hbrBackground = 0; + wc.lpszMenuName = NULL; + wc.lpszClassName = _cn; + wc.hIconSm = 0; + if (!RegisterClassEx(&wc)) { + LOG(("Application Error: could not register shadow window class %1, error: %2").arg(i).arg(GetLastError())); + destroy(); + return false; + } + + hwnds[i] = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); + if (!hwnds[i]) { + LOG(("Application Error: could not create shadow window class %1, error: %2").arg(i).arg(GetLastError())); + destroy(); + return false; + } + SetWindowLong(hwnds[i], GWL_HWNDPARENT, (LONG)hwnd); + + dcs[i] = CreateCompatibleDC(screenDC); + if (!dcs[i]) { + LOG(("Application Error: could not create dc for shadow window class %1, error: %2").arg(i).arg(GetLastError())); + destroy(); + return false; + } + + bitmaps[i] = CreateCompatibleBitmap(screenDC, (i % 2) ? _size : max_w, (i % 2) ? max_h : _size); + if (!bitmaps[i]) { + LOG(("Application Error: could not create bitmap for shadow window class %1, error: %2").arg(i).arg(GetLastError())); + destroy(); + return false; + } + + SelectObject(dcs[i], bitmaps[i]); + } + + initCorners(); + return true; + } + + void initCorners(int directions = (_PsInitHor | _PsInitVer)) { + bool hor = (directions & _PsInitHor), ver = (directions & _PsInitVer); + Gdiplus::Graphics graphics0(dcs[0]), graphics1(dcs[1]), graphics2(dcs[2]), graphics3(dcs[3]); + graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + if (hor) graphics0.FillRectangle(&brush, 0, 0, _fullsize - (_size - _shift), 2 * _shift); + + if (ver) { + graphics1.FillRectangle(&brush, 0, 0, _size, 2 * _shift); + graphics3.FillRectangle(&brush, 0, 0, _size, 2 * _shift); + graphics1.FillRectangle(&brush, _size - _shift, 2 * _shift, _shift, _fullsize); + graphics3.FillRectangle(&brush, 0, 2 * _shift, _shift, _fullsize); + } + + if (hor) { + for (int j = 2 * _shift; j < _size; ++j) { + for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + graphics0.FillRectangle(&brush, k, j, 1, 1); + graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); + } + } + for (int j = _size; j < _size + 2 * _shift; ++j) { + for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); + } + } + } + if (ver) { + for (int j = 2 * _shift; j < _fullsize + 2 * _shift; ++j) { + for (int k = _shift; k < _size; ++k) { + brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + (k + _shift)], r, g, b)); + graphics1.FillRectangle(&brush, _size - k - 1, j, 1, 1); + graphics3.FillRectangle(&brush, k, j, 1, 1); + } + } + } + } + void verCorners(int h, Gdiplus::Graphics *pgraphics1, Gdiplus::Graphics *pgraphics3) { + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + pgraphics1->FillRectangle(&brush, _size - _shift, h - _fullsize, _shift, _fullsize); + pgraphics3->FillRectangle(&brush, 0, h - _fullsize, _shift, _fullsize); + for (int j = 0; j < _fullsize; ++j) { + for (int k = _shift; k < _size; ++k) { + brush.SetColor(Gdiplus::Color(_colors[(j + 2 * _shift) * _metaSize + k + _shift], r, g, b)); + pgraphics1->FillRectangle(&brush, _size - k - 1, h - j - 1, 1, 1); + pgraphics3->FillRectangle(&brush, k, h - j - 1, 1, 1); + } + } + } + void horCorners(int w, Gdiplus::Graphics *pgraphics0, Gdiplus::Graphics *pgraphics2) { + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + pgraphics0->FillRectangle(&brush, w - 2 * _size - (_fullsize - (_size - _shift)), 0, _fullsize - (_size - _shift), 2 * _shift); + for (int j = 2 * _shift; j < _size; ++j) { + for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + pgraphics0->FillRectangle(&brush, w - 2 * _size - k - 1, j, 1, 1); + pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); + } + } + for (int j = _size; j < _size + 2 * _shift; ++j) { + for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); + } + } + } + + void update(int changes, WINDOWPOS *pos = 0) { + HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; + if (!hwnd || !hwnds[0]) return; + + if (changes == _PsShadowActivate) { + for (int i = 0; i < 4; ++i) { + SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + } + return; + } + + if (changes & _PsShadowHidden) { + if (!hidden) { + for (int i = 0; i < 4; ++i) { + hidden = true; + ShowWindow(hwnds[i], SW_HIDE); + } + } + return; + } + if (!App::wnd()->psPosInited()) return; + + int x = _x, y = _y, w = _w, h = _h; + if (pos && (!(pos->flags & SWP_NOMOVE) || !(pos->flags & SWP_NOSIZE) || !(pos->flags & SWP_NOREPOSITION))) { + if (!(pos->flags & SWP_NOMOVE)) { + x = pos->x - _size; + y = pos->y - _size; + } else if (pos->flags & SWP_NOSIZE) { + for (int i = 0; i < 4; ++i) { + SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + } + return; + } + if (!(pos->flags & SWP_NOSIZE)) { + w = pos->cx + 2 * _size; + h = pos->cy + 2 * _size; + } + } else { + RECT r; + GetWindowRect(hwnd, &r); + x = r.left - _size; + y = r.top - _size; + w = r.right + _size - x; + h = r.bottom + _size - y; + } + if (h < 2 * _fullsize + 2 * _shift) { + h = 2 * _fullsize + 2 * _shift; + } + if (w < 2 * (_fullsize + _shift)) { + w = 2 * (_fullsize + _shift); + } + + if (w != _w) { + int from = (_w > 2 * (_fullsize + _shift)) ? (_w - _size - _fullsize - _shift) : (_fullsize - (_size - _shift)); + int to = w - _size - _fullsize - _shift; + if (w > max_w) { + from = _fullsize - (_size - _shift); + max_w *= 2; + for (int i = 0; i < 4; i += 2) { + DeleteObject(bitmaps[i]); + bitmaps[i] = CreateCompatibleBitmap(screenDC, max_w, _size); + SelectObject(dcs[i], bitmaps[i]); + } + initCorners(_PsInitHor); + } + Gdiplus::Graphics graphics0(dcs[0]), graphics2(dcs[2]); + graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + if (to > from) { + graphics0.FillRectangle(&brush, from, 0, to - from, 2 * _shift); + for (int i = 2 * _shift; i < _size; ++i) { + Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + graphics0.DrawLine(&pen, from, i, to, i); + graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); + } + for (int i = _size; i < _size + 2 * _shift; ++i) { + Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); + } + } + if (_w > w) { + graphics0.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); + graphics2.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); + } + horCorners(w, &graphics0, &graphics2); + POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }, f = { 0, 0 }; + SIZE s = { w - 2 * _size, _size }; + updateWindow(0, &p0, &s); + updateWindow(2, &p2, &s); + } else if (x != _x || y != _y) { + POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }; + updateWindow(0, &p0); + updateWindow(2, &p2); + } else if (h != _h) { + POINT p2 = { x + _size, y + h - _size }; + updateWindow(2, &p2); + } + + if (h != _h) { + int from = (_h > 2 * _fullsize + 2 * _shift) ? (_h - _fullsize) : (_fullsize + 2 * _shift); + int to = h - _fullsize; + if (h > max_h) { + from = (_fullsize + 2 * _shift); + max_h *= 2; + for (int i = 1; i < 4; i += 2) { + DeleteObject(bitmaps[i]); + bitmaps[i] = CreateCompatibleBitmap(dcs[i], _size, max_h); + SelectObject(dcs[i], bitmaps[i]); + } + initCorners(_PsInitVer); + } + Gdiplus::Graphics graphics1(dcs[1]), graphics3(dcs[3]); + graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + + Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + if (to > from) { + graphics1.FillRectangle(&brush, _size - _shift, from, _shift, to - from); + graphics3.FillRectangle(&brush, 0, from, _shift, to - from); + for (int i = 2 * _shift; i < _size + _shift; ++i) { + Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + graphics1.DrawLine(&pen, _size + _shift - i - 1, from, _size + _shift - i - 1, to); + graphics3.DrawLine(&pen, i - _shift, from, i - _shift, to); + } + } + if (_h > h) { + graphics1.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); + graphics3.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); + } + verCorners(h, &graphics1, &graphics3); + + POINT p1 = {x + w - _size, y}, p3 = {x, y}, f = {0, 0}; + SIZE s = { _size, h }; + updateWindow(1, &p1, &s); + updateWindow(3, &p3, &s); + } else if (x != _x || y != _y) { + POINT p1 = { x + w - _size, y }, p3 = { x, y }; + updateWindow(1, &p1); + updateWindow(3, &p3); + } else if (w != _w) { + POINT p1 = { x + w - _size, y }; + updateWindow(1, &p1); + } + _x = x; + _y = y; + _w = w; + _h = h; + + if (hidden && (changes & _PsShadowShown)) { + for (int i = 0; i < 4; ++i) { + SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOACTIVATE); + } + hidden = false; + } + } + + void updateWindow(int i, POINT *p, SIZE *s = 0) { + static POINT f = {0, 0}; + if (s) { + UpdateLayeredWindow(hwnds[i], (s ? screenDC : 0), p, s, (s ? dcs[i] : 0), (s ? (&f) : 0), noKeyColor, &blend, ULW_ALPHA); + } else { + SetWindowPos(hwnds[i], 0, p->x, p->y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER); + } + } + + void destroy() { + for (int i = 0; i < 4; ++i) { + if (dcs[i]) DeleteDC(dcs[i]); + if (bitmaps[i]) DeleteObject(bitmaps[i]); + if (hwnds[i]) DestroyWindow(hwnds[i]); + dcs[i] = 0; + bitmaps[i] = 0; + hwnds[i] = 0; + } + if (screenDC) ReleaseDC(0, screenDC); + } + + private: + + int _x, _y, _w, _h; + int _metaSize, _fullsize, _size, _shift; + QVector _alphas, _colors; + + bool hidden; + + HWND hwnds[4]; + HDC dcs[4], screenDC; + HBITMAP bitmaps[4]; + int max_w, max_h; + BLENDFUNCTION blend; + + BYTE r, g, b; + COLORREF noKeyColor; + + static LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + + }; + _PsShadowWindows _psShadowWindows; + + LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + if (finished) return DefWindowProc(hwnd, msg, wParam, lParam); + + int i; + for (i = 0; i < 4; ++i) { + if (_psShadowWindows.hwnds[i] && hwnd == _psShadowWindows.hwnds[i]) { + break; + } + } + if (i == 4) return DefWindowProc(hwnd, msg, wParam, lParam); + + switch (msg) { + case WM_CLOSE: + App::wnd()->close(); + break; + + case WM_NCHITTEST: { + int32 xPos = GET_X_LPARAM(lParam), yPos = GET_Y_LPARAM(lParam); + switch (i) { + case 0: return HTTOP; + case 1: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPRIGHT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMRIGHT : HTRIGHT); + case 2: return HTBOTTOM; + case 3: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPLEFT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMLEFT : HTLEFT); + } + return HTTRANSPARENT; + } break; + + case WM_NCACTIVATE: return DefWindowProc(hwnd, msg, wParam, lParam); + case WM_NCLBUTTONDOWN: + case WM_NCLBUTTONUP: + case WM_NCLBUTTONDBLCLK: + case WM_NCMBUTTONDOWN: + case WM_NCMBUTTONUP: + case WM_NCMBUTTONDBLCLK: + case WM_NCRBUTTONDOWN: + case WM_NCRBUTTONUP: + case WM_NCRBUTTONDBLCLK: + case WM_NCXBUTTONDOWN: + case WM_NCXBUTTONUP: + case WM_NCXBUTTONDBLCLK: + case WM_NCMOUSEHOVER: + case WM_NCMOUSELEAVE: + case WM_NCMOUSEMOVE: + case WM_NCPOINTERUPDATE: + case WM_NCPOINTERDOWN: + case WM_NCPOINTERUP: + if (App::wnd() && App::wnd()->psHwnd()) { + if (msg == WM_NCLBUTTONDOWN) { + ::SetForegroundWindow(App::wnd()->psHwnd()); + } + LRESULT res = SendMessage(App::wnd()->psHwnd(), msg, wParam, lParam); + return res; + } + return 0; + break; + case WM_ACTIVATE: + if (App::wnd() && App::wnd()->psHwnd() && wParam == WA_ACTIVE) { + if ((HWND)lParam != App::wnd()->psHwnd()) { + ::SetForegroundWindow(hwnd); + ::SetWindowPos(App::wnd()->psHwnd(), hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + } + return DefWindowProc(hwnd, msg, wParam, lParam); + break; + default: + return DefWindowProc(hwnd, msg, wParam, lParam); + } + return 0; + } + + QColor _shActive(0, 0, 0), _shInactive(0, 0, 0); + + typedef HRESULT (FAR STDAPICALLTYPE *f_setWindowTheme)(HWND hWnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList); + f_setWindowTheme setWindowTheme = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_openAs_RunDLL)(HWND hWnd, HINSTANCE hInstance, LPCWSTR lpszCmdLine, int nCmdShow); + f_openAs_RunDLL openAs_RunDLL = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_shOpenWithDialog)(HWND hwndParent, const OPENASINFO *poainfo); + f_shOpenWithDialog shOpenWithDialog = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_shAssocEnumHandlers)(PCWSTR pszExtra, ASSOC_FILTER afFilter, IEnumAssocHandlers **ppEnumHandler); + f_shAssocEnumHandlers shAssocEnumHandlers = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_shCreateItemFromParsingName)(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); + f_shCreateItemFromParsingName shCreateItemFromParsingName = 0; + + typedef BOOL (FAR STDAPICALLTYPE *f_wtsRegisterSessionNotification)(HWND hWnd, DWORD dwFlags); + f_wtsRegisterSessionNotification wtsRegisterSessionNotification = 0; + + typedef BOOL (FAR STDAPICALLTYPE *f_wtsUnRegisterSessionNotification)(HWND hWnd); + f_wtsUnRegisterSessionNotification wtsUnRegisterSessionNotification = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_shQueryUserNotificationState)(QUERY_USER_NOTIFICATION_STATE *pquns); + f_shQueryUserNotificationState shQueryUserNotificationState = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_setCurrentProcessExplicitAppUserModelID)(__in PCWSTR AppID); + f_setCurrentProcessExplicitAppUserModelID setCurrentProcessExplicitAppUserModelID = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_roGetActivationFactory)(_In_ HSTRING activatableClassId, _In_ REFIID iid, _COM_Outptr_ void ** factory); + f_roGetActivationFactory roGetActivationFactory = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_windowsCreateStringReference)(_In_reads_opt_(length + 1) PCWSTR sourceString, UINT32 length, _Out_ HSTRING_HEADER * hstringHeader, _Outptr_result_maybenull_ _Result_nullonfailure_ HSTRING * string); + f_windowsCreateStringReference windowsCreateStringReference = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_windowsDeleteString)(_In_opt_ HSTRING string); + f_windowsDeleteString windowsDeleteString = 0; + + typedef HRESULT (FAR STDAPICALLTYPE *f_propVariantToString)(_In_ REFPROPVARIANT propvar, _Out_writes_(cch) PWSTR psz, _In_ UINT cch); + f_propVariantToString propVariantToString = 0; + + template + bool loadFunction(HINSTANCE dll, LPCSTR name, TFunction &func) { + if (!dll) return false; + + func = (TFunction)GetProcAddress(dll, name); + return !!func; + } + + class _PsInitializer { + public: + _PsInitializer() { + frameless = false; + + setupUx(); + setupShell(); + setupWtsapi(); + setupPropSys(); + setupCombase(); + + useTheme = !!setWindowTheme; + } + void setupUx() { + HINSTANCE procId = LoadLibrary(L"UXTHEME.DLL"); + + loadFunction(procId, "SetWindowTheme", setWindowTheme); + } + void setupShell() { + HINSTANCE procId = LoadLibrary(L"SHELL32.DLL"); + setupOpenWith(procId); + setupOpenAs(procId); + setupShellapi(procId); + setupAppUserModel(procId); + } + void setupOpenWith(HINSTANCE procId) { + if (!loadFunction(procId, "SHAssocEnumHandlers", shAssocEnumHandlers)) return; + if (!loadFunction(procId, "SHCreateItemFromParsingName", shCreateItemFromParsingName)) return; + useOpenWith = true; + } + void setupOpenAs(HINSTANCE procId) { + if (!loadFunction(procId, "SHOpenWithDialog", shOpenWithDialog) && !loadFunction(procId, "OpenAs_RunDLLW", openAs_RunDLL)) return; + useOpenAs = true; + } + void setupShellapi(HINSTANCE procId) { + if (!loadFunction(procId, "SHQueryUserNotificationState", shQueryUserNotificationState)) return; + useShellapi = true; + } + void setupAppUserModel(HINSTANCE procId) { + if (!loadFunction(procId, "SetCurrentProcessExplicitAppUserModelID", setCurrentProcessExplicitAppUserModelID)) return; + } + void setupWtsapi() { + HINSTANCE procId = LoadLibrary(L"WTSAPI32.DLL"); + + if (!loadFunction(procId, "WTSRegisterSessionNotification", wtsRegisterSessionNotification)) return; + if (!loadFunction(procId, "WTSUnRegisterSessionNotification", wtsUnRegisterSessionNotification)) return; + useWtsapi = true; + } + void setupCombase() { + if (!setCurrentProcessExplicitAppUserModelID) return; + + HINSTANCE procId = LoadLibrary(L"COMBASE.DLL"); + setupToast(procId); + } + void setupPropSys() { + HINSTANCE procId = LoadLibrary(L"PROPSYS.DLL"); + if (!loadFunction(procId, "PropVariantToString", propVariantToString)) return; + } + void setupToast(HINSTANCE procId) { + if (!propVariantToString) return; + if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) return; + if (!loadFunction(procId, "RoGetActivationFactory", roGetActivationFactory)) return; + + HINSTANCE otherProcId = LoadLibrary(L"api-ms-win-core-winrt-string-l1-1-0.dll"); + if (!loadFunction(otherProcId, "WindowsCreateStringReference", windowsCreateStringReference)) return; + if (!loadFunction(otherProcId, "WindowsDeleteString", windowsDeleteString)) return; + + useToast = true; + } + }; + _PsInitializer _psInitializer; + + class _PsEventFilter : public QAbstractNativeEventFilter { + public: + _PsEventFilter() { + } + + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) { + Window *wnd = App::wnd(); + if (!wnd) return false; + + MSG *msg = (MSG*)message; + if (msg->message == WM_ENDSESSION) { + App::quit(); + return false; + } + if (msg->hwnd == wnd->psHwnd() || msg->hwnd && !wnd->psHwnd()) { + return mainWindowEvent(msg->hwnd, msg->message, msg->wParam, msg->lParam, (LRESULT*)result); + } + return false; + } + + bool mainWindowEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result) { + if (tbCreatedMsgId && msg == tbCreatedMsgId) { + HRESULT hr = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&taskbarList)); + if (!SUCCEEDED(hr)) { + taskbarList.Reset(); + } + } + switch (msg) { + + case WM_TIMECHANGE: { + App::wnd()->checkAutoLockIn(100); + } return false; + + case WM_WTSSESSION_CHANGE: { + if (wParam == WTS_SESSION_LOGOFF || wParam == WTS_SESSION_LOCK) { + sessionLoggedOff = true; + } else if (wParam == WTS_SESSION_LOGON || wParam == WTS_SESSION_UNLOCK) { + sessionLoggedOff = false; + } + } return false; + + case WM_DESTROY: { + App::quit(); + } return false; + + case WM_ACTIVATE: { + if (LOWORD(wParam) == WA_CLICKACTIVE) { + App::wnd()->inactivePress(true); + } + if (LOWORD(wParam) != WA_INACTIVE) { + _psShadowWindows.setColor(_shActive); + _psShadowWindows.update(_PsShadowActivate); + } else { + _psShadowWindows.setColor(_shInactive); + } + if (Global::started()) { + QMetaObject::invokeMethod(App::wnd(), "updateCounter", Qt::QueuedConnection); + App::wnd()->update(); + } + } return false; + + case WM_NCPAINT: if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return false; *result = 0; return true; + + case WM_NCCALCSIZE: { + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); + if (GetWindowPlacement(hWnd, &wp) && wp.showCmd == SW_SHOWMAXIMIZED) { + LPNCCALCSIZE_PARAMS params = (LPNCCALCSIZE_PARAMS)lParam; + LPRECT r = (wParam == TRUE) ? ¶ms->rgrc[0] : (LPRECT)lParam; + HMONITOR hMonitor = MonitorFromPoint({ (r->left + r->right) / 2, (r->top + r->bottom) / 2 }, MONITOR_DEFAULTTONEAREST); + if (hMonitor) { + MONITORINFO mi; + mi.cbSize = sizeof(mi); + if (GetMonitorInfo(hMonitor, &mi)) { + *r = mi.rcWork; + } + } + } + *result = 0; + return true; + } + + case WM_NCACTIVATE: { + *result = DefWindowProc(hWnd, msg, wParam, -1); + } return true; + + case WM_WINDOWPOSCHANGING: + case WM_WINDOWPOSCHANGED: { + WINDOWPLACEMENT wp; + wp.length = sizeof(WINDOWPLACEMENT); + if (GetWindowPlacement(hWnd, &wp) && (wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) { + _psShadowWindows.update(_PsShadowHidden); + } else { + _psShadowWindows.update(_PsShadowMoved | _PsShadowResized, (WINDOWPOS*)lParam); + } + } return false; + + case WM_SIZE: { + if (App::wnd()) { + if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED || wParam == SIZE_MINIMIZED) { + if (wParam != SIZE_RESTORED || App::wnd()->windowState() != Qt::WindowNoState) { + Qt::WindowState state = Qt::WindowNoState; + if (wParam == SIZE_MAXIMIZED) { + state = Qt::WindowMaximized; + } else if (wParam == SIZE_MINIMIZED) { + state = Qt::WindowMinimized; + } + emit App::wnd()->windowHandle()->windowStateChanged(state); + } else { + App::wnd()->psUpdatedPosition(); + } + App::wnd()->psUpdateMargins(); + int changes = (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXIMIZED) ? _PsShadowHidden : (_PsShadowResized | _PsShadowShown); + _psShadowWindows.update(changes); + } + } + } return false; + + case WM_SHOWWINDOW: { + LONG style = GetWindowLong(hWnd, GWL_STYLE); + int changes = _PsShadowResized | ((wParam && !(style & (WS_MAXIMIZE | WS_MINIMIZE))) ? _PsShadowShown : _PsShadowHidden); + _psShadowWindows.update(changes); + } return false; + + case WM_MOVE: { + _psShadowWindows.update(_PsShadowMoved); + App::wnd()->psUpdatedPosition(); + } return false; + + case WM_NCHITTEST: { + POINTS p = MAKEPOINTS(lParam); + RECT r; + GetWindowRect(hWnd, &r); + HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + switch (res) { + case HitTestClient: + case HitTestSysButton: *result = HTCLIENT; break; + case HitTestIcon: *result = HTCAPTION; break; + case HitTestCaption: *result = HTCAPTION; break; + case HitTestTop: *result = HTTOP; break; + case HitTestTopRight: *result = HTTOPRIGHT; break; + case HitTestRight: *result = HTRIGHT; break; + case HitTestBottomRight: *result = HTBOTTOMRIGHT; break; + case HitTestBottom: *result = HTBOTTOM; break; + case HitTestBottomLeft: *result = HTBOTTOMLEFT; break; + case HitTestLeft: *result = HTLEFT; break; + case HitTestTopLeft: *result = HTTOPLEFT; break; + case HitTestNone: + default: *result = HTTRANSPARENT; break; + }; + } return true; + + case WM_NCRBUTTONUP: { + SendMessage(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam); + } return true; + + case WM_NCLBUTTONDOWN: { + POINTS p = MAKEPOINTS(lParam); + RECT r; + GetWindowRect(hWnd, &r); + HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + switch (res) { + case HitTestIcon: + if (menuHidden && getms() < menuHidden + 10) { + menuHidden = 0; + if (getms() < menuShown + GetDoubleClickTime()) { + App::wnd()->close(); + } + } else { + QRect icon = App::wnd()->iconRect(); + p.x = r.left - dleft + icon.left(); + p.y = r.top - dtop + icon.top() + icon.height(); + App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); + menuShown = getms(); + menuHidden = 0; + TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + menuHidden = getms(); + } + return true; + }; + } return false; + + case WM_NCLBUTTONDBLCLK: { + POINTS p = MAKEPOINTS(lParam); + RECT r; + GetWindowRect(hWnd, &r); + HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + switch (res) { + case HitTestIcon: App::wnd()->close(); return true; + }; + } return false; + + case WM_SYSCOMMAND: { + if (wParam == SC_MOUSEMENU) { + POINTS p = MAKEPOINTS(lParam); + App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); + TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + } + } return false; + + case WM_COMMAND: { + if (HIWORD(wParam)) return false; + int cmd = LOWORD(wParam); + switch (cmd) { + case SC_CLOSE: App::wnd()->close(); return true; + case SC_MINIMIZE: App::wnd()->setWindowState(Qt::WindowMinimized); return true; + case SC_MAXIMIZE: App::wnd()->setWindowState(Qt::WindowMaximized); return true; + case SC_RESTORE: App::wnd()->setWindowState(Qt::WindowNoState); return true; + } + } return true; + + } + return false; + } + }; + _PsEventFilter *_psEventFilter = 0; + +}; + +PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), ps_hWnd(0), ps_menu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)), + ps_iconBig(0), ps_iconSmall(0), ps_iconOverlay(0), trayIcon(0), trayIconMenu(0), posInited(false), ps_tbHider_hWnd(createTaskbarHider()) { + tbCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated"); + connect(&ps_cleanNotifyPhotosTimer, SIGNAL(timeout()), this, SLOT(psCleanNotifyPhotos())); +} + +void PsMainWindow::psShowTrayMenu() { + trayIconMenu->popup(QCursor::pos()); +} + +void PsMainWindow::psCleanNotifyPhotosIn(int32 dt) { + if (dt < 0) { + if (ps_cleanNotifyPhotosTimer.isActive() && ps_cleanNotifyPhotosTimer.remainingTime() <= -dt) return; + dt = -dt; + } + ps_cleanNotifyPhotosTimer.start(dt); +} + +void PsMainWindow::psCleanNotifyPhotos() { + uint64 ms = getms(true), minuntil = 0; + for (ToastImages::iterator i = toastImages.begin(); i != toastImages.end();) { + if (!i->until) { + ++i; + continue; + } + if (i->until <= ms) { + QFile(i->path).remove(); + i = toastImages.erase(i); + } else { + if (!minuntil || minuntil > i->until) { + minuntil = i->until; + } + ++i; + } + } + if (minuntil) psCleanNotifyPhotosIn(int32(minuntil - ms)); +} + +void PsMainWindow::psRefreshTaskbarIcon() { + QWidget *w = new QWidget(this); + w->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint); + w->setGeometry(x() + 1, y() + 1, 1, 1); + QPalette p(w->palette()); + p.setColor(QPalette::Background, st::titleBG->c); + QWindow *wnd = w->windowHandle(); + w->setPalette(p); + w->show(); + w->activateWindow(); + delete w; +} + +void PsMainWindow::psTrayMenuUpdated() { +} + +void PsMainWindow::psSetupTrayIcon() { + if (!trayIcon) { + trayIcon = new QSystemTrayIcon(this); + + QIcon icon(QPixmap::fromImage(App::wnd()->iconLarge(), Qt::ColorOnly)); + + trayIcon->setIcon(icon); + trayIcon->setToolTip(QString::fromStdWString(AppName)); + connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(toggleTray(QSystemTrayIcon::ActivationReason)), Qt::UniqueConnection); + connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(showFromTray())); + App::wnd()->updateTrayMenu(); + } + psUpdateCounter(); + + trayIcon->show(); + psUpdateDelegate(); +} + +void PsMainWindow::psUpdateWorkmode() { + switch (cWorkMode()) { + case dbiwmWindowAndTray: { + psSetupTrayIcon(); + HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + if (psOwner) { + SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); + psRefreshTaskbarIcon(); + } + } break; + + case dbiwmTrayOnly: { + psSetupTrayIcon(); + HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + if (!psOwner) { + SetWindowLong(ps_hWnd, GWL_HWNDPARENT, (LONG)ps_tbHider_hWnd); + } + } break; + + case dbiwmWindowOnly: { + if (trayIcon) { + trayIcon->setContextMenu(0); + trayIcon->deleteLater(); + } + trayIcon = 0; + + HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + if (psOwner) { + SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); + psRefreshTaskbarIcon(); + } + } break; + } +} + +HICON qt_pixmapToWinHICON(const QPixmap &); +HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &, int hbitmapFormat); + +static HICON _qt_createHIcon(const QIcon &icon, int xSize, int ySize) { + if (!icon.isNull()) { + const QPixmap pm = icon.pixmap(icon.actualSize(QSize(xSize, ySize))); + if (!pm.isNull()) + return qt_pixmapToWinHICON(pm); + } + return 0; +} + +void PsMainWindow::psUpdateCounter() { + int32 counter = App::histories().unreadBadge(); + bool muted = App::histories().unreadOnlyMuted(); + + style::color bg = muted ? st::counterMuteBG : st::counterBG; + QIcon iconSmall, iconBig; + iconSmall.addPixmap(QPixmap::fromImage(iconWithCounter(16, counter, bg, true), Qt::ColorOnly)); + iconSmall.addPixmap(QPixmap::fromImage(iconWithCounter(32, counter, bg, true), Qt::ColorOnly)); + iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(32, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); + iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(64, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); + if (trayIcon) { + trayIcon->setIcon(iconSmall); + } + + setWindowTitle((counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram")); + psDestroyIcons(); + ps_iconSmall = _qt_createHIcon(iconSmall, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); + ps_iconBig = _qt_createHIcon(iconBig, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); + SendMessage(ps_hWnd, WM_SETICON, 0, (LPARAM)ps_iconSmall); + SendMessage(ps_hWnd, WM_SETICON, 1, (LPARAM)(ps_iconBig ? ps_iconBig : ps_iconSmall)); + if (taskbarList.Get()) { + if (counter > 0) { + QIcon iconOverlay; + iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-16, counter, bg, false), Qt::ColorOnly)); + iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-32, counter, bg, false), Qt::ColorOnly)); + ps_iconOverlay = _qt_createHIcon(iconOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); + } + QString description = counter > 0 ? QString("%1 unread messages").arg(counter) : qsl("No unread messages"); + taskbarList->SetOverlayIcon(ps_hWnd, ps_iconOverlay, description.toStdWString().c_str()); + } + SetWindowPos(ps_hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); +} + +void PsMainWindow::psUpdateDelegate() { +} + +namespace { + HMONITOR enumMonitor = 0; + RECT enumMonitorWork; + + BOOL CALLBACK _monitorEnumProc( + _In_ HMONITOR hMonitor, + _In_ HDC hdcMonitor, + _In_ LPRECT lprcMonitor, + _In_ LPARAM dwData + ) { + MONITORINFOEX info; + info.cbSize = sizeof(info); + GetMonitorInfo(hMonitor, &info); + if (dwData == hashCrc32(info.szDevice, sizeof(info.szDevice))) { + enumMonitor = hMonitor; + enumMonitorWork = info.rcWork; + return FALSE; + } + return TRUE; + } +} + +void PsMainWindow::psInitSize() { + setMinimumWidth(st::wndMinWidth); + setMinimumHeight(st::wndMinHeight); + + TWindowPos pos(cWindowPos()); + QRect avail(Sandbox::availableGeometry()); + bool maximized = false; + QRect geom(avail.x() + (avail.width() - st::wndDefWidth) / 2, avail.y() + (avail.height() - st::wndDefHeight) / 2, st::wndDefWidth, st::wndDefHeight); + if (pos.w && pos.h) { + if (pos.y < 0) pos.y = 0; + enumMonitor = 0; + EnumDisplayMonitors(0, 0, &_monitorEnumProc, pos.moncrc); + if (enumMonitor) { + int32 w = enumMonitorWork.right - enumMonitorWork.left, h = enumMonitorWork.bottom - enumMonitorWork.top; + if (w >= st::wndMinWidth && h >= st::wndMinHeight) { + if (pos.w > w) pos.w = w; + if (pos.h > h) pos.h = h; + pos.x += enumMonitorWork.left; + pos.y += enumMonitorWork.top; + if (pos.x < enumMonitorWork.right - 10 && pos.y < enumMonitorWork.bottom - 10) { + geom = QRect(pos.x, pos.y, pos.w, pos.h); + } + } + } + maximized = pos.maximized; + } + setGeometry(geom); +} + +bool InitToastManager(); +bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg); +void CheckPinnedAppUserModelId(); +void CleanupAppUserModelIdShortcut(); + +void PsMainWindow::psInitFrameless() { + psUpdatedPositionTimer.setSingleShot(true); + connect(&psUpdatedPositionTimer, SIGNAL(timeout()), this, SLOT(psSavePosition())); + + QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); + ps_hWnd = static_cast(i->nativeResourceForWindow(QByteArrayLiteral("handle"), windowHandle())); + + if (!ps_hWnd) return; + + if (useWtsapi) wtsRegisterSessionNotification(ps_hWnd, NOTIFY_FOR_THIS_SESSION); + + if (frameless) { + setWindowFlags(Qt::FramelessWindowHint); + } + +// RegisterApplicationRestart(NULL, 0); + if (!InitToastManager()) { + useToast = false; + } + + psInitSysMenu(); +} + +void PsMainWindow::psSavePosition(Qt::WindowState state) { + if (state == Qt::WindowActive) state = windowHandle()->windowState(); + if (state == Qt::WindowMinimized || !posInited) return; + + TWindowPos pos(cWindowPos()), curPos = pos; + + if (state == Qt::WindowMaximized) { + curPos.maximized = 1; + } else { + RECT w; + GetWindowRect(ps_hWnd, &w); + curPos.x = w.left; + curPos.y = w.top; + curPos.w = w.right - w.left; + curPos.h = w.bottom - w.top; + curPos.maximized = 0; + } + + HMONITOR hMonitor = MonitorFromWindow(ps_hWnd, MONITOR_DEFAULTTONEAREST); + if (hMonitor) { + MONITORINFOEX info; + info.cbSize = sizeof(info); + GetMonitorInfo(hMonitor, &info); + if (!curPos.maximized) { + curPos.x -= info.rcWork.left; + curPos.y -= info.rcWork.top; + } + curPos.moncrc = hashCrc32(info.szDevice, sizeof(info.szDevice)); + } + + if (curPos.w >= st::wndMinWidth && curPos.h >= st::wndMinHeight) { + if (curPos.x != pos.x || curPos.y != pos.y || curPos.w != pos.w || curPos.h != pos.h || curPos.moncrc != pos.moncrc || curPos.maximized != pos.maximized) { + cSetWindowPos(curPos); + Local::writeSettings(); + } + } +} + +void PsMainWindow::psUpdatedPosition() { + psUpdatedPositionTimer.start(SaveWindowPositionTimeout); +} + +bool PsMainWindow::psHasNativeNotifications() { + return useToast; +} + +Q_DECLARE_METATYPE(QMargins); +void PsMainWindow::psFirstShow() { + if (useToast) { + cSetCustomNotifies(!cWindowsNotifications()); + } else { + cSetCustomNotifies(true); + } + + _psShadowWindows.init(_shActive); + finished = false; + + psUpdateMargins(); + + _psShadowWindows.update(_PsShadowHidden); + bool showShadows = true; + + show(); + if (cWindowPos().maximized) { + setWindowState(Qt::WindowMaximized); + } + + if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized()) || cStartInTray()) { + setWindowState(Qt::WindowMinimized); + if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { + hide(); + } else { + show(); + } + showShadows = false; + } else { + show(); + } + + posInited = true; + if (showShadows) { + _psShadowWindows.update(_PsShadowMoved | _PsShadowResized | _PsShadowShown); + } +} + +bool PsMainWindow::psHandleTitle() { + return true; +} + +void PsMainWindow::psInitSysMenu() { + Qt::WindowStates states = windowState(); + ps_menu = GetSystemMenu(ps_hWnd, FALSE); + psUpdateSysMenu(windowHandle()->windowState()); +} + +void PsMainWindow::psUpdateSysMenu(Qt::WindowState state) { + if (!ps_menu) return; + + int menuToDisable = SC_RESTORE; + if (state == Qt::WindowMaximized) { + menuToDisable = SC_MAXIMIZE; + } else if (state == Qt::WindowMinimized) { + menuToDisable = SC_MINIMIZE; + } + int itemCount = GetMenuItemCount(ps_menu); + for (int i = 0; i < itemCount; ++i) { + MENUITEMINFO itemInfo = {0}; + itemInfo.cbSize = sizeof(itemInfo); + itemInfo.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID; + if (GetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { + if (itemInfo.fType & MFT_SEPARATOR) { + continue; + } + if (itemInfo.wID && !(itemInfo.fState & MFS_DEFAULT)) { + UINT fOldState = itemInfo.fState, fState = itemInfo.fState & ~MFS_DISABLED; + if (itemInfo.wID == SC_CLOSE) { + fState |= MFS_DEFAULT; + } else if (itemInfo.wID == menuToDisable || (itemInfo.wID != SC_MINIMIZE && itemInfo.wID != SC_MAXIMIZE && itemInfo.wID != SC_RESTORE)) { + fState |= MFS_DISABLED; + } + itemInfo.fMask = MIIM_STATE; + itemInfo.fState = fState; + if (!SetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { + DEBUG_LOG(("PS Error: could not set state %1 to menu item %2, old state %3, error %4").arg(fState).arg(itemInfo.wID).arg(fOldState).arg(GetLastError())); + DestroyMenu(ps_menu); + ps_menu = 0; + break; + } + } + } else { + DEBUG_LOG(("PS Error: could not get state, menu item %1 of %2, error %3").arg(i).arg(itemCount).arg(GetLastError())); + DestroyMenu(ps_menu); + ps_menu = 0; + break; + } + } +} + +void PsMainWindow::psUpdateMargins() { + if (!ps_hWnd) return; + + RECT r, a; + + GetClientRect(ps_hWnd, &r); + a = r; + + LONG style = GetWindowLong(ps_hWnd, GWL_STYLE), styleEx = GetWindowLong(ps_hWnd, GWL_EXSTYLE); + AdjustWindowRectEx(&a, style, false, styleEx); + QMargins margins = QMargins(a.left - r.left, a.top - r.top, r.right - a.right, r.bottom - a.bottom); + if (style & WS_MAXIMIZE) { + RECT w, m; + GetWindowRect(ps_hWnd, &w); + m = w; + + HMONITOR hMonitor = MonitorFromRect(&w, MONITOR_DEFAULTTONEAREST); + if (hMonitor) { + MONITORINFO mi; + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + m = mi.rcWork; + } + + dleft = w.left - m.left; + dtop = w.top - m.top; + + margins.setLeft(margins.left() - w.left + m.left); + margins.setRight(margins.right() - m.right + w.right); + margins.setBottom(margins.bottom() - m.bottom + w.bottom); + margins.setTop(margins.top() - w.top + m.top); + } else { + dleft = dtop = 0; + } + + QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); + i->setWindowProperty(windowHandle()->handle(), qsl("WindowsCustomMargins"), QVariant::fromValue(margins)); + if (!themeInited) { + themeInited = true; + if (useTheme) { + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) { + setWindowTheme(ps_hWnd, L" ", L" "); + QApplication::setStyle(QStyleFactory::create(qsl("Windows"))); + } + } + } +} + +void PsMainWindow::psFlash() { + if (GetForegroundWindow() == ps_hWnd) return; + + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = ps_hWnd; + info.dwFlags = FLASHW_ALL; + info.dwTimeout = 0; + info.uCount = 1; + FlashWindowEx(&info); +} + +HWND PsMainWindow::psHwnd() const { + return ps_hWnd; +} + +HMENU PsMainWindow::psMenu() const { + return ps_menu; +} + +void PsMainWindow::psDestroyIcons() { + if (ps_iconBig) { + DestroyIcon(ps_iconBig); + ps_iconBig = 0; + } + if (ps_iconSmall) { + DestroyIcon(ps_iconSmall); + ps_iconSmall = 0; + } + if (ps_iconOverlay) { + DestroyIcon(ps_iconOverlay); + ps_iconOverlay = 0; + } +} + +PsMainWindow::~PsMainWindow() { + if (useWtsapi) { + QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); + if (HWND hWnd = static_cast(i->nativeResourceForWindow(QByteArrayLiteral("handle"), windowHandle()))) { + wtsUnRegisterSessionNotification(hWnd); + } + } + + if (taskbarList) taskbarList.Reset(); + + toastNotifications.clear(); + if (toastNotificationManager) toastNotificationManager.Reset(); + if (toastNotifier) toastNotifier.Reset(); + if (toastNotificationFactory) toastNotificationFactory.Reset(); + + finished = true; + if (ps_menu) DestroyMenu(ps_menu); + psDestroyIcons(); + _psShadowWindows.destroy(); + if (ps_tbHider_hWnd) DestroyWindow(ps_tbHider_hWnd); +} + +namespace { + QRect _monitorRect; + uint64 _monitorLastGot = 0; +} + +QRect psDesktopRect() { + uint64 tnow = getms(); + if (tnow > _monitorLastGot + 1000 || tnow < _monitorLastGot) { + _monitorLastGot = tnow; + HMONITOR hMonitor = MonitorFromWindow(App::wnd()->psHwnd(), MONITOR_DEFAULTTONEAREST); + if (hMonitor) { + MONITORINFOEX info; + info.cbSize = sizeof(info); + GetMonitorInfo(hMonitor, &info); + _monitorRect = QRect(info.rcWork.left, info.rcWork.top, info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top); + } else { + _monitorRect = QApplication::desktop()->availableGeometry(App::wnd()); + } + } + return _monitorRect; +} + +void psShowOverAll(QWidget *w, bool canFocus) { +} + +void psBringToBack(QWidget *w) { +} + +void PsMainWindow::psActivateNotify(NotifyWindow *w) { +} + +void PsMainWindow::psClearNotifies(PeerId peerId) { + if (!toastNotifier) return; + + if (peerId) { + ToastNotifications::iterator i = toastNotifications.find(peerId); + if (i != toastNotifications.cend()) { + QMap temp = i.value(); + toastNotifications.erase(i); + + for (QMap::const_iterator j = temp.cbegin(), e = temp.cend(); j != e; ++j) { + toastNotifier->Hide(j->p.Get()); + } + } + } else { + ToastNotifications temp = toastNotifications; + toastNotifications.clear(); + + for (ToastNotifications::const_iterator i = temp.cbegin(), end = temp.cend(); i != end; ++i) { + for (QMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { + toastNotifier->Hide(j->p.Get()); + } + } + } +} + +void PsMainWindow::psNotifyShown(NotifyWindow *w) { +} + +void PsMainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) { + QString title = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->history()->peer->name : qsl("Telegram Desktop"); + QString subtitle = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->notificationHeader() : QString(); + bool showpix = (!App::passcoded() && cNotifyView() <= dbinvShowName); + QString msg = (!App::passcoded() && cNotifyView() <= dbinvShowPreview) ? (fwdCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, fwdCount)) : lang(lng_notification_preview); + + CreateToast(item->history()->peer, item->id, showpix, title, subtitle, msg); +} + +QAbstractNativeEventFilter *psNativeEventFilter() { + delete _psEventFilter; + _psEventFilter = new _PsEventFilter(); + return _psEventFilter; +} + +void psDeleteDir(const QString &dir) { + std::wstring wDir = QDir::toNativeSeparators(dir).toStdWString(); + WCHAR path[4096]; + memcpy(path, wDir.c_str(), (wDir.size() + 1) * sizeof(WCHAR)); + path[wDir.size() + 1] = 0; + SHFILEOPSTRUCT file_op = { + NULL, + FO_DELETE, + path, + L"", + FOF_NOCONFIRMATION | + FOF_NOERRORUI | + FOF_SILENT, + false, + 0, + L"" + }; + int res = SHFileOperation(&file_op); +} + +namespace { + BOOL CALLBACK _ActivateProcess(HWND hWnd, LPARAM lParam) { + uint64 &processId(*(uint64*)lParam); + + DWORD dwProcessId; + ::GetWindowThreadProcessId(hWnd, &dwProcessId); + + if ((uint64)dwProcessId == processId) { // found top-level window + static const int32 nameBufSize = 1024; + WCHAR nameBuf[nameBufSize]; + int32 len = GetWindowText(hWnd, nameBuf, nameBufSize); + if (len && len < nameBufSize) { + if (QRegularExpression(qsl("^Telegram(\\s*\\(\\d+\\))?$")).match(QString::fromStdWString(nameBuf)).hasMatch()) { + BOOL res = ::SetForegroundWindow(hWnd); + ::SetFocus(hWnd); + return FALSE; + } + } + } + return TRUE; + } +} + +namespace { + uint64 _lastUserAction = 0; +} + +void psUserActionDone() { + _lastUserAction = getms(true); + if (sessionLoggedOff) sessionLoggedOff = false; +} + +bool psIdleSupported() { + LASTINPUTINFO lii; + lii.cbSize = sizeof(LASTINPUTINFO); + return GetLastInputInfo(&lii); +} + +uint64 psIdleTime() { + LASTINPUTINFO lii; + lii.cbSize = sizeof(LASTINPUTINFO); + return GetLastInputInfo(&lii) ? (GetTickCount() - lii.dwTime) : (getms(true) - _lastUserAction); +} + +bool psSkipAudioNotify() { + QUERY_USER_NOTIFICATION_STATE state; + if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { + if (state == QUNS_NOT_PRESENT || state == QUNS_PRESENTATION_MODE) return true; + } + return sessionLoggedOff; +} + +bool psSkipDesktopNotify() { + QUERY_USER_NOTIFICATION_STATE state; + if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { + if (state == QUNS_PRESENTATION_MODE || state == QUNS_RUNNING_D3D_FULL_SCREEN/* || state == QUNS_BUSY*/) return true; + } + return false; +} + +QStringList psInitLogs() { + return _initLogs; +} + +void psClearInitLogs() { + _initLogs = QStringList(); +} + +void psActivateProcess(uint64 pid) { + if (pid) { + ::EnumWindows((WNDENUMPROC)_ActivateProcess, (LPARAM)&pid); + } +} + +QString psCurrentCountry() { + int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, 0, 0); + if (chCount && chCount < 128) { + WCHAR wstrCountry[128]; + int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, wstrCountry, chCount); + return len ? QString::fromStdWString(std::wstring(wstrCountry)) : QString::fromLatin1(DefaultCountry); + } + return QString::fromLatin1(DefaultCountry); +} + +namespace { + QString langById(int lngId) { + int primary = lngId & 0xFF; + switch (primary) { + case 0x36: return qsl("af"); + case 0x1C: return qsl("sq"); + case 0x5E: return qsl("am"); + case 0x01: return qsl("ar"); + case 0x2B: return qsl("hy"); + case 0x4D: return qsl("as"); + case 0x2C: return qsl("az"); + case 0x45: return qsl("bn"); + case 0x6D: return qsl("ba"); + case 0x2D: return qsl("eu"); + case 0x23: return qsl("be"); + case 0x1A: + if (lngId == LANG_CROATIAN) { + return qsl("hr"); + } else if (lngId == LANG_BOSNIAN_NEUTRAL || lngId == LANG_BOSNIAN) { + return qsl("bs"); + } + return qsl("sr"); + break; + case 0x7E: return qsl("br"); + case 0x02: return qsl("bg"); + case 0x92: return qsl("ku"); + case 0x03: return qsl("ca"); + case 0x04: return qsl("zh"); + case 0x83: return qsl("co"); + case 0x05: return qsl("cs"); + case 0x06: return qsl("da"); + case 0x65: return qsl("dv"); + case 0x13: return qsl("nl"); + case 0x09: return qsl("en"); + case 0x25: return qsl("et"); + case 0x38: return qsl("fo"); + case 0x0B: return qsl("fi"); + case 0x0c: return qsl("fr"); + case 0x62: return qsl("fy"); + case 0x56: return qsl("gl"); + case 0x37: return qsl("ka"); + case 0x07: return qsl("de"); + case 0x08: return qsl("el"); + case 0x6F: return qsl("kl"); + case 0x47: return qsl("gu"); + case 0x68: return qsl("ha"); + case 0x0D: return qsl("he"); + case 0x39: return qsl("hi"); + case 0x0E: return qsl("hu"); + case 0x0F: return qsl("is"); + case 0x70: return qsl("ig"); + case 0x21: return qsl("id"); + case 0x5D: return qsl("iu"); + case 0x3C: return qsl("ga"); + case 0x34: return qsl("xh"); + case 0x35: return qsl("zu"); + case 0x10: return qsl("it"); + case 0x11: return qsl("ja"); + case 0x4B: return qsl("kn"); + case 0x3F: return qsl("kk"); + case 0x53: return qsl("kh"); + case 0x87: return qsl("rw"); + case 0x12: return qsl("ko"); + case 0x40: return qsl("ky"); + case 0x54: return qsl("lo"); + case 0x26: return qsl("lv"); + case 0x27: return qsl("lt"); + case 0x6E: return qsl("lb"); + case 0x2F: return qsl("mk"); + case 0x3E: return qsl("ms"); + case 0x4C: return qsl("ml"); + case 0x3A: return qsl("mt"); + case 0x81: return qsl("mi"); + case 0x4E: return qsl("mr"); + case 0x50: return qsl("mn"); + case 0x61: return qsl("ne"); + case 0x14: return qsl("no"); + case 0x82: return qsl("oc"); + case 0x48: return qsl("or"); + case 0x63: return qsl("ps"); + case 0x29: return qsl("fa"); + case 0x15: return qsl("pl"); + case 0x16: return qsl("pt"); + case 0x67: return qsl("ff"); + case 0x46: return qsl("pa"); + case 0x18: return qsl("ro"); + case 0x17: return qsl("rm"); + case 0x19: return qsl("ru"); + case 0x3B: return qsl("se"); + case 0x4F: return qsl("sa"); + case 0x32: return qsl("tn"); + case 0x59: return qsl("sd"); + case 0x5B: return qsl("si"); + case 0x1B: return qsl("sk"); + case 0x24: return qsl("sl"); + case 0x0A: return qsl("es"); + case 0x41: return qsl("sw"); + case 0x1D: return qsl("sv"); + case 0x28: return qsl("tg"); + case 0x49: return qsl("ta"); + case 0x44: return qsl("tt"); + case 0x4A: return qsl("te"); + case 0x1E: return qsl("th"); + case 0x51: return qsl("bo"); + case 0x73: return qsl("ti"); + case 0x1F: return qsl("tr"); + case 0x42: return qsl("tk"); + case 0x22: return qsl("uk"); + case 0x20: return qsl("ur"); + case 0x80: return qsl("ug"); + case 0x43: return qsl("uz"); + case 0x2A: return qsl("vi"); + case 0x52: return qsl("cy"); + case 0x88: return qsl("wo"); + case 0x78: return qsl("ii"); + case 0x6A: return qsl("yo"); + } + return QString::fromLatin1(DefaultLanguage); + } +} + +QString psCurrentLanguage() { + int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, 0, 0); + if (chCount && chCount < 128) { + WCHAR wstrLocale[128]; + int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, wstrLocale, chCount); + if (!len) return QString::fromLatin1(DefaultLanguage); + QString locale = QString::fromStdWString(std::wstring(wstrLocale)); + QRegularExpressionMatch m = QRegularExpression("(^|[^a-z])([a-z]{2})-").match(locale); + if (m.hasMatch()) { + return m.captured(2); + } + } + chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, 0, 0); + if (chCount && chCount < 128) { + WCHAR wstrLocale[128]; + int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, wstrLocale, chCount), lngId = 0; + if (len < 5) return QString::fromLatin1(DefaultLanguage); + + for (int i = 0; i < 4; ++i) { + WCHAR ch = wstrLocale[i]; + lngId *= 16; + if (ch >= WCHAR('0') && ch <= WCHAR('9')) { + lngId += (ch - WCHAR('0')); + } else if (ch >= WCHAR('A') && ch <= WCHAR('F')) { + lngId += (10 + ch - WCHAR('A')); + } else { + return QString::fromLatin1(DefaultLanguage); + } + } + return langById(lngId); + } + return QString::fromLatin1(DefaultLanguage); +} + +QString psAppDataPath() { + static const int maxFileLen = MAX_PATH * 10; + WCHAR wstrPath[maxFileLen]; + if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + return appData.absolutePath() + '/' + QString::fromWCharArray(AppName) + '/'; + } + return QString(); +} + +QString psAppDataPathOld() { + static const int maxFileLen = MAX_PATH * 10; + WCHAR wstrPath[maxFileLen]; + if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + return appData.absolutePath() + '/' + QString::fromWCharArray(AppNameOld) + '/'; + } + return QString(); +} + +QString psDownloadPath() { + return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + '/' + QString::fromWCharArray(AppName) + '/'; +} + +QString psCurrentExeDirectory(int argc, char *argv[]) { + LPWSTR *args; + int argsCount; + args = CommandLineToArgvW(GetCommandLine(), &argsCount); + if (args) { + QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); + if (info.isFile()) { + return info.absoluteDir().absolutePath() + '/'; + } + LocalFree(args); + } + return QString(); +} + +QString psCurrentExeName(int argc, char *argv[]) { + LPWSTR *args; + int argsCount; + args = CommandLineToArgvW(GetCommandLine(), &argsCount); + if (args) { + QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); + if (info.isFile()) { + return info.fileName(); + } + LocalFree(args); + } + return QString(); +} + +void psDoCleanup() { + try { + psAutoStart(false, true); + psSendToMenu(false, true); + CleanupAppUserModelIdShortcut(); + } catch (...) { + } +} + +int psCleanup() { + __try + { + psDoCleanup(); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + return 0; + } + return 0; +} + +void psDoFixPrevious() { + try { + static const int bufSize = 4096; + DWORD checkType, checkSize = bufSize * 2; + WCHAR checkStr[bufSize]; + + QString appId = QString::fromStdWString(AppId); + QString newKeyStr1 = QString("Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + QString newKeyStr2 = QString("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + QString oldKeyStr1 = QString("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + QString oldKeyStr2 = QString("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + HKEY newKey1, newKey2, oldKey1, oldKey2; + LSTATUS newKeyRes1 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr1.toStdWString().c_str(), 0, KEY_READ, &newKey1); + LSTATUS newKeyRes2 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr2.toStdWString().c_str(), 0, KEY_READ, &newKey2); + LSTATUS oldKeyRes1 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str(), 0, KEY_READ, &oldKey1); + LSTATUS oldKeyRes2 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str(), 0, KEY_READ, &oldKey2); + + bool existNew1 = (newKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(newKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + bool existNew2 = (newKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(newKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + bool existOld1 = (oldKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + bool existOld2 = (oldKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + + if (newKeyRes1 == ERROR_SUCCESS) RegCloseKey(newKey1); + if (newKeyRes2 == ERROR_SUCCESS) RegCloseKey(newKey2); + if (oldKeyRes1 == ERROR_SUCCESS) RegCloseKey(oldKey1); + if (oldKeyRes2 == ERROR_SUCCESS) RegCloseKey(oldKey2); + + if (existNew1 || existNew2) { + oldKeyRes1 = existOld1 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str()) : ERROR_SUCCESS; + oldKeyRes2 = existOld2 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str()) : ERROR_SUCCESS; + } + + QString userDesktopLnk, commonDesktopLnk; + WCHAR userDesktopFolder[MAX_PATH], commonDesktopFolder[MAX_PATH]; + HRESULT userDesktopRes = SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, userDesktopFolder); + HRESULT commonDesktopRes = SHGetFolderPath(0, CSIDL_COMMON_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, commonDesktopFolder); + if (SUCCEEDED(userDesktopRes)) { + userDesktopLnk = QString::fromWCharArray(userDesktopFolder) + "\\Telegram.lnk"; + } + if (SUCCEEDED(commonDesktopRes)) { + commonDesktopLnk = QString::fromWCharArray(commonDesktopFolder) + "\\Telegram.lnk"; + } + QFile userDesktopFile(userDesktopLnk), commonDesktopFile(commonDesktopLnk); + if (QFile::exists(userDesktopLnk) && QFile::exists(commonDesktopLnk) && userDesktopLnk != commonDesktopLnk) { + bool removed = QFile::remove(commonDesktopLnk); + } + } catch (...) { + } +} + +int psFixPrevious() { + __try + { + psDoFixPrevious(); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + return 0; + } + return 0; +} + +void psPostprocessFile(const QString &name) { + std::wstring zoneFile = QDir::toNativeSeparators(name).toStdWString() + L":Zone.Identifier"; + HANDLE f = CreateFile(zoneFile.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (f == INVALID_HANDLE_VALUE) { // :( + return; + } + + const char data[] = "[ZoneTransfer]\r\nZoneId=3\r\n"; + + DWORD written = 0; + BOOL result = WriteFile(f, data, sizeof(data), &written, NULL); + CloseHandle(f); + + if (!result || written != sizeof(data)) { // :( + return; + } +} + +namespace { + struct OpenWithApp { + OpenWithApp(const QString &name, HBITMAP icon, IAssocHandler *handler) : name(name), icon(icon), handler(handler) { + } + OpenWithApp(const QString &name, IAssocHandler *handler) : name(name), icon(0), handler(handler) { + } + void destroy() { + if (icon) DeleteBitmap(icon); + if (handler) handler->Release(); + } + QString name; + HBITMAP icon; + IAssocHandler *handler; + }; + + bool OpenWithAppLess(const OpenWithApp &a, const OpenWithApp &b) { + return a.name < b.name; + } + + HBITMAP _iconToBitmap(LPWSTR icon, int iconindex) { + if (!icon) return 0; + WCHAR tmpIcon[4096]; + if (icon[0] == L'@' && SUCCEEDED(SHLoadIndirectString(icon, tmpIcon, 4096, 0))) { + icon = tmpIcon; + } + int32 w = GetSystemMetrics(SM_CXSMICON), h = GetSystemMetrics(SM_CYSMICON); + + HICON ico = ExtractIcon(0, icon, iconindex); + if (!ico) { + if (!iconindex) { // try to read image + QImage img(QString::fromWCharArray(icon)); + if (!img.isNull()) { + return qt_pixmapToWinHBITMAP(QPixmap::fromImage(img.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)), /* HBitmapAlpha */ 2); + } + } + return 0; + } + + HDC screenDC = GetDC(0), hdc = CreateCompatibleDC(screenDC); + HBITMAP result = CreateCompatibleBitmap(screenDC, w, h); + HGDIOBJ was = SelectObject(hdc, result); + DrawIconEx(hdc, 0, 0, ico, w, h, 0, NULL, DI_NORMAL); + SelectObject(hdc, was); + DeleteDC(hdc); + ReleaseDC(0, screenDC); + + DestroyIcon(ico); + + return (HBITMAP)CopyImage(result, IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_CREATEDIBSECTION); +// return result; + } +} + +bool psShowOpenWithMenu(int x, int y, const QString &file) { + if (!useOpenWith || !App::wnd()) return false; + + bool result = false; + QList handlers; + IShellItem* pItem = nullptr; + if (SUCCEEDED(shCreateItemFromParsingName(QDir::toNativeSeparators(file).toStdWString().c_str(), nullptr, IID_PPV_ARGS(&pItem)))) { + IEnumAssocHandlers *assocHandlers = 0; + if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_EnumAssocHandlers, IID_PPV_ARGS(&assocHandlers)))) { + HRESULT hr = S_FALSE; + do + { + IAssocHandler *handler = 0; + ULONG ulFetched = 0; + hr = assocHandlers->Next(1, &handler, &ulFetched); + if (FAILED(hr) || hr == S_FALSE || !ulFetched) break; + + LPWSTR name = 0; + if (SUCCEEDED(handler->GetUIName(&name))) { + LPWSTR icon = 0; + int iconindex = 0; + if (SUCCEEDED(handler->GetIconLocation(&icon, &iconindex)) && icon) { + handlers.push_back(OpenWithApp(QString::fromWCharArray(name), _iconToBitmap(icon, iconindex), handler)); + CoTaskMemFree(icon); + } else { + handlers.push_back(OpenWithApp(QString::fromWCharArray(name), handler)); + } + CoTaskMemFree(name); + } else { + handler->Release(); + } + } while (hr != S_FALSE); + assocHandlers->Release(); + } + + if (!handlers.isEmpty()) { + HMENU menu = CreatePopupMenu(); + std::sort(handlers.begin(), handlers.end(), OpenWithAppLess); + for (int32 i = 0, l = handlers.size(); i < l; ++i) { + MENUITEMINFO menuInfo = { 0 }; + menuInfo.cbSize = sizeof(menuInfo); + menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; + menuInfo.fType = MFT_STRING; + menuInfo.wID = i + 1; + if (handlers.at(i).icon) { + menuInfo.fMask |= MIIM_BITMAP; + menuInfo.hbmpItem = handlers.at(i).icon; + } + + QString name = handlers.at(i).name; + if (name.size() > 512) name = name.mid(0, 512); + WCHAR nameArr[1024]; + name.toWCharArray(nameArr); + nameArr[name.size()] = 0; + menuInfo.dwTypeData = nameArr; + InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); + } + MENUITEMINFO sepInfo = { 0 }; + sepInfo.cbSize = sizeof(sepInfo); + sepInfo.fMask = MIIM_STRING | MIIM_DATA; + sepInfo.fType = MFT_SEPARATOR; + InsertMenuItem(menu, GetMenuItemCount(menu), true, &sepInfo); + + MENUITEMINFO menuInfo = { 0 }; + menuInfo.cbSize = sizeof(menuInfo); + menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; + menuInfo.fType = MFT_STRING; + menuInfo.wID = handlers.size() + 1; + + QString name = lang(lng_wnd_choose_program_menu); + if (name.size() > 512) name = name.mid(0, 512); + WCHAR nameArr[1024]; + name.toWCharArray(nameArr); + nameArr[name.size()] = 0; + menuInfo.dwTypeData = nameArr; + InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); + + int sel = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, x, y, 0, App::wnd()->psHwnd(), 0); + DestroyMenu(menu); + + if (sel > 0) { + if (sel <= handlers.size()) { + IDataObject *dataObj = 0; + if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_DataObject, IID_PPV_ARGS(&dataObj))) && dataObj) { + handlers.at(sel - 1).handler->Invoke(dataObj); + dataObj->Release(); + result = true; + } + } + } else { + result = true; + } + for (int i = 0, l = handlers.size(); i < l; ++i) { + handlers[i].destroy(); + } + } + + pItem->Release(); + } + return result; +} + +void psOpenFile(const QString &name, bool openWith) { + bool mailtoScheme = name.startsWith(qstr("mailto:")); + std::wstring wname = mailtoScheme ? name.toStdWString() : QDir::toNativeSeparators(name).toStdWString(); + + if (openWith && useOpenAs) { + if (shOpenWithDialog) { + OPENASINFO info; + info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC; + if (mailtoScheme) info.oaifInFlags |= OAIF_FILE_IS_URI | OAIF_URL_PROTOCOL; + info.pcszClass = NULL; + info.pcszFile = wname.c_str(); + shOpenWithDialog(0, &info); + } else { + openAs_RunDLL(0, 0, wname.c_str(), SW_SHOWNORMAL); + } + } else { + ShellExecute(0, L"open", wname.c_str(), 0, 0, SW_SHOWNORMAL); + } +} + +void psShowInFolder(const QString &name) { + QString nameEscaped = QDir::toNativeSeparators(name).replace('"', qsl("\"\"")); + ShellExecute(0, 0, qsl("explorer").toStdWString().c_str(), (qsl("/select,") + nameEscaped).toStdWString().c_str(), 0, SW_SHOWNORMAL); +} + + +namespace PlatformSpecific { + + void start() { + } + + void finish() { + delete _psEventFilter; + _psEventFilter = 0; + + if (ToastImageSavedFlag) { + psDeleteDir(cWorkingDir() + qsl("tdata/temp")); + } + } + + namespace ThirdParty { + void start() { + } + + void finish() { + } + } + +} + +namespace { + void _psLogError(const char *str, LSTATUS code) { + LPTSTR errorText = NULL, errorTextDefault = L"(Unknown error)"; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0); + if (!errorText) { + errorText = errorTextDefault; + } + LOG((str).arg(code).arg(QString::fromStdWString(errorText))); + if (errorText != errorTextDefault) { + LocalFree(errorText); + } + } + + bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { + DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + LSTATUS status = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_QUERY_VALUE | KEY_WRITE, rkey); + if (status != ERROR_SUCCESS) { + if (status == ERROR_FILE_NOT_FOUND) { + status = RegCreateKeyEx(HKEY_CURRENT_USER, key, 0, 0, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE | KEY_WRITE, 0, rkey, 0); + if (status != ERROR_SUCCESS) { + QString msg = qsl("App Error: could not create '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); + _psLogError(msg.toUtf8().constData(), status); + return false; + } + } else { + QString msg = qsl("App Error: could not open '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); + _psLogError(msg.toUtf8().constData(), status); + return false; + } + } + return true; + } + + bool _psSetKeyValue(HKEY rkey, LPCWSTR value, QString v) { + static const int bufSize = 4096; + DWORD defaultType, defaultSize = bufSize * 2; + WCHAR defaultStr[bufSize] = { 0 }; + if (RegQueryValueEx(rkey, value, 0, &defaultType, (BYTE*)defaultStr, &defaultSize) != ERROR_SUCCESS || defaultType != REG_SZ || defaultSize != (v.size() + 1) * 2 || QString::fromStdWString(defaultStr) != v) { + WCHAR tmp[bufSize] = { 0 }; + if (!v.isEmpty()) wsprintf(tmp, v.replace(QChar('%'), qsl("%%")).toStdWString().c_str()); + LSTATUS status = RegSetValueEx(rkey, value, 0, REG_SZ, (BYTE*)tmp, (wcslen(tmp) + 1) * sizeof(WCHAR)); + if (status != ERROR_SUCCESS) { + QString msg = qsl("App Error: could not set %1, error %2").arg(value ? ('\'' + QString::fromStdWString(value) + '\'') : qsl("(Default)")).arg("%1: %2"); + _psLogError(msg.toUtf8().constData(), status); + return false; + } + } + return true; + } +} + +void RegisterCustomScheme() { +#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME + DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); + + HKEY rkey; + QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); + + if (!_psOpenRegKey(L"Software\\Classes\\tg", &rkey)) return; + if (!_psSetKeyValue(rkey, L"URL Protocol", QString())) return; + if (!_psSetKeyValue(rkey, 0, qsl("URL:Telegram Link"))) return; + + if (!_psOpenRegKey(L"Software\\Classes\\tg\\DefaultIcon", &rkey)) return; + if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return; + + if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell", &rkey)) return; + if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; + if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; + if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return; +#endif +} + +void psNewVersion() { + RegisterCustomScheme(); + if (Local::oldSettingsVersion() < 8051) { + CheckPinnedAppUserModelId(); + } +} + +void psExecUpdater() { + QString targs = qsl("-update"); + if (cLaunchMode() == LaunchModeAutoStart) targs += qsl(" -autostart"); + if (cDebug()) targs += qsl(" -debug"); + if (cStartInTray()) targs += qsl(" -startintray"); + if (cWriteProtected()) targs += qsl(" -writeprotected \"") + cExeDir() + '"'; + + QString updaterPath = cWriteProtected() ? (cWorkingDir() + qsl("tupdates/temp/Updater.exe")) : (cExeDir() + qsl("Updater.exe")); + + QString updater(QDir::toNativeSeparators(updaterPath)), wdir(QDir::toNativeSeparators(cWorkingDir())); + + DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + "Updater.exe").arg(targs)); + HINSTANCE r = ShellExecute(0, cWriteProtected() ? L"runas" : 0, updater.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); + if (long(r) < 32) { + DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(updater).arg(wdir).arg(long(r))); + psDeleteDir(cWorkingDir() + qsl("tupdates/temp")); + } +} + +void psExecTelegram(const QString &crashreport) { + QString targs = crashreport.isEmpty() ? qsl("-noupdate") : ('"' + crashreport + '"'); + if (crashreport.isEmpty()) { + if (cRestartingToSettings()) targs += qsl(" -tosettings"); + if (cLaunchMode() == LaunchModeAutoStart) targs += qsl(" -autostart"); + if (cDebug()) targs += qsl(" -debug"); + if (cStartInTray()) targs += qsl(" -startintray"); + if (cTestMode()) targs += qsl(" -testmode"); + if (cDataFile() != qsl("data")) targs += qsl(" -key \"") + cDataFile() + '"'; + } + QString telegram(QDir::toNativeSeparators(cExeDir() + cExeName())), wdir(QDir::toNativeSeparators(cWorkingDir())); + + DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + cExeName()).arg(targs)); + Logs::closeMain(); + SignalHandlers::finish(); + HINSTANCE r = ShellExecute(0, 0, telegram.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); + if (long(r) < 32) { + DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(telegram).arg(wdir).arg(long(r))); + } +} + +void _manageAppLnk(bool create, bool silent, int path_csidl, const wchar_t *args, const wchar_t *description) { + WCHAR startupFolder[MAX_PATH]; + HRESULT hr = SHGetFolderPath(0, path_csidl, 0, SHGFP_TYPE_CURRENT, startupFolder); + if (SUCCEEDED(hr)) { + QString lnk = QString::fromWCharArray(startupFolder) + '\\' + QString::fromWCharArray(AppFile) + qsl(".lnk"); + if (create) { + ComPtr shellLink; + hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + if (SUCCEEDED(hr)) { + ComPtr persistFile; + + QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()), dir = QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()); + shellLink->SetArguments(args); + shellLink->SetPath(exe.toStdWString().c_str()); + shellLink->SetWorkingDirectory(dir.toStdWString().c_str()); + shellLink->SetDescription(description); + + ComPtr propertyStore; + hr = shellLink.As(&propertyStore); + if (SUCCEEDED(hr)) { + PROPVARIANT appIdPropVar; + hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + if (SUCCEEDED(hr)) { + hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + PropVariantClear(&appIdPropVar); + if (SUCCEEDED(hr)) { + hr = propertyStore->Commit(); + } + } + } + + hr = shellLink.As(&persistFile); + if (SUCCEEDED(hr)) { + hr = persistFile->Save(lnk.toStdWString().c_str(), TRUE); + } else { + if (!silent) LOG(("App Error: could not create interface IID_IPersistFile %1").arg(hr)); + } + } else { + if (!silent) LOG(("App Error: could not create instance of IID_IShellLink %1").arg(hr)); + } + } else { + QFile::remove(lnk); + } + } else { + if (!silent) LOG(("App Error: could not get CSIDL %1 folder %2").arg(path_csidl).arg(hr)); + } +} + +void psAutoStart(bool start, bool silent) { + _manageAppLnk(start, silent, CSIDL_STARTUP, L"-autostart", L"Telegram autorun link.\nYou can disable autorun in Telegram settings."); +} + +void psSendToMenu(bool send, bool silent) { + _manageAppLnk(send, silent, CSIDL_SENDTO, L"-sendpath", L"Telegram send to link.\nYou can disable send to menu item in Telegram settings."); +} + +void psUpdateOverlayed(TWidget *widget) { + bool wm = widget->testAttribute(Qt::WA_Mapped), wv = widget->testAttribute(Qt::WA_WState_Visible); + if (!wm) widget->setAttribute(Qt::WA_Mapped, true); + if (!wv) widget->setAttribute(Qt::WA_WState_Visible, true); + widget->update(); + QEvent e(QEvent::UpdateRequest); + widget->event(&e); + if (!wm) widget->setAttribute(Qt::WA_Mapped, false); + if (!wv) widget->setAttribute(Qt::WA_WState_Visible, false); +} + +static const WCHAR *_programName = AppName; // folder in APPDATA, if current path is unavailable for writing +static const WCHAR *_exeName = L"Telegram.exe"; + +// Stack walk code is inspired by http://www.codeproject.com/Articles/11132/Walking-the-callstack + +static const int StackEntryMaxNameLength = MAX_SYM_NAME + 1; + +typedef BOOL(FAR STDAPICALLTYPE *t_SymCleanup)( + _In_ HANDLE hProcess +); +t_SymCleanup symCleanup = 0; + +typedef PVOID (FAR STDAPICALLTYPE *t_SymFunctionTableAccess64)( + _In_ HANDLE hProcess, + _In_ DWORD64 AddrBase +); +t_SymFunctionTableAccess64 symFunctionTableAccess64 = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_SymGetLineFromAddr64)( + _In_ HANDLE hProcess, + _In_ DWORD64 dwAddr, + _Out_ PDWORD pdwDisplacement, + _Out_ PIMAGEHLP_LINEW64 Line +); +t_SymGetLineFromAddr64 symGetLineFromAddr64 = 0; + +typedef DWORD64 (FAR STDAPICALLTYPE *t_SymGetModuleBase64)( + _In_ HANDLE hProcess, + _In_ DWORD64 qwAddr +); +t_SymGetModuleBase64 symGetModuleBase64 = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_SymGetModuleInfo64)( + _In_ HANDLE hProcess, + _In_ DWORD64 qwAddr, + _Out_ PIMAGEHLP_MODULEW64 ModuleInfo +); +t_SymGetModuleInfo64 symGetModuleInfo64 = 0; + +typedef DWORD (FAR STDAPICALLTYPE *t_SymGetOptions)( + VOID +); +t_SymGetOptions symGetOptions = 0; + +typedef DWORD (FAR STDAPICALLTYPE *t_SymSetOptions)( + _In_ DWORD SymOptions +); +t_SymSetOptions symSetOptions = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_SymGetSymFromAddr64)( + IN HANDLE hProcess, + IN DWORD64 dwAddr, + OUT PDWORD64 pdwDisplacement, + OUT PIMAGEHLP_SYMBOL64 Symbol +); +t_SymGetSymFromAddr64 symGetSymFromAddr64 = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_SymInitialize)( + _In_ HANDLE hProcess, + _In_opt_ PCWSTR UserSearchPath, + _In_ BOOL fInvadeProcess +); +t_SymInitialize symInitialize = 0; + +typedef DWORD64 (FAR STDAPICALLTYPE *t_SymLoadModule64)( + _In_ HANDLE hProcess, + _In_opt_ HANDLE hFile, + _In_opt_ PCSTR ImageName, + _In_opt_ PCSTR ModuleName, + _In_ DWORD64 BaseOfDll, + _In_ DWORD SizeOfDll +); +t_SymLoadModule64 symLoadModule64; + +typedef BOOL (FAR STDAPICALLTYPE *t_StackWalk64)( + _In_ DWORD MachineType, + _In_ HANDLE hProcess, + _In_ HANDLE hThread, + _Inout_ LPSTACKFRAME64 StackFrame, + _Inout_ PVOID ContextRecord, + _In_opt_ PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, + _In_opt_ PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, + _In_opt_ PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, + _In_opt_ PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress +); +t_StackWalk64 stackWalk64 = 0; + +typedef DWORD (FAR STDAPICALLTYPE *t_UnDecorateSymbolName)( + PCSTR DecoratedName, + PSTR UnDecoratedName, + DWORD UndecoratedLength, + DWORD Flags +); +t_UnDecorateSymbolName unDecorateSymbolName = 0; + +typedef BOOL(FAR STDAPICALLTYPE *t_SymGetSearchPath)( + _In_ HANDLE hProcess, + _Out_writes_(SearchPathLength) PWSTR SearchPath, + _In_ DWORD SearchPathLength +); +t_SymGetSearchPath symGetSearchPath = 0; + +BOOL __stdcall ReadProcessMemoryRoutine64( + _In_ HANDLE hProcess, + _In_ DWORD64 qwBaseAddress, + _Out_writes_bytes_(nSize) PVOID lpBuffer, + _In_ DWORD nSize, + _Out_ LPDWORD lpNumberOfBytesRead +) { + SIZE_T st; + BOOL bRet = ReadProcessMemory(hProcess, (LPVOID)qwBaseAddress, lpBuffer, nSize, &st); + *lpNumberOfBytesRead = (DWORD)st; + + return bRet; +} + +// **************************************** ToolHelp32 ************************ +#define MAX_MODULE_NAME32 255 +#define TH32CS_SNAPMODULE 0x00000008 +#pragma pack( push, 8 ) +typedef struct tagMODULEENTRY32 +{ + DWORD dwSize; + DWORD th32ModuleID; // This module + DWORD th32ProcessID; // owning process + DWORD GlblcntUsage; // Global usage count on the module + DWORD ProccntUsage; // Module usage count in th32ProcessID's context + BYTE * modBaseAddr; // Base address of module in th32ProcessID's context + DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr + HMODULE hModule; // The hModule of this module in th32ProcessID's context + char szModule[MAX_MODULE_NAME32 + 1]; + char szExePath[MAX_PATH]; +} MODULEENTRY32; +typedef MODULEENTRY32 *PMODULEENTRY32; +typedef MODULEENTRY32 *LPMODULEENTRY32; +#pragma pack( pop ) + +typedef HANDLE (FAR STDAPICALLTYPE *t_CreateToolhelp32Snapshot)(DWORD dwFlags, DWORD th32ProcessID); +t_CreateToolhelp32Snapshot createToolhelp32Snapshot = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_Module32First)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); +t_Module32First module32First = 0; + +typedef BOOL (FAR STDAPICALLTYPE *t_Module32Next)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); +t_Module32Next module32Next = 0; + +bool LoadDbgHelp(bool extended = false) { + if (stackWalk64 && (!extended || symInitialize)) return true; + + HMODULE hDll = 0; + + WCHAR szTemp[4096]; + if (GetModuleFileName(NULL, szTemp, 4096) > 0) { + wcscat_s(szTemp, L".local"); + if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES) { + // ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows" + if (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0) { + wcscat_s(szTemp, L"\\Debugging Tools for Windows\\dbghelp.dll"); + // now check if the file exists: + if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { + hDll = LoadLibrary(szTemp); + } + } + // Still not found? Then try to load the 64-Bit version: + if (!hDll && (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0)) { + wcscat_s(szTemp, L"\\Debugging Tools for Windows 64-Bit\\dbghelp.dll"); + if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { + hDll = LoadLibrary(szTemp); + } + } + } + } + if (!hDll) { + hDll = LoadLibrary(L"DBGHELP.DLL"); + } + + if (!hDll) return false; + + stackWalk64 = (t_StackWalk64)GetProcAddress(hDll, "StackWalk64"); + symFunctionTableAccess64 = (t_SymFunctionTableAccess64)GetProcAddress(hDll, "SymFunctionTableAccess64"); + symGetModuleBase64 = (t_SymGetModuleBase64)GetProcAddress(hDll, "SymGetModuleBase64"); + + if (!stackWalk64 || + !symFunctionTableAccess64 || + !symGetModuleBase64) { + stackWalk64 = 0; + return false; + } + + if (extended) { + HANDLE hProcess = GetCurrentProcess(); + DWORD dwProcessId = GetCurrentProcessId(); + + symGetLineFromAddr64 = (t_SymGetLineFromAddr64)GetProcAddress(hDll, "SymGetLineFromAddrW64"); + symGetModuleInfo64 = (t_SymGetModuleInfo64)GetProcAddress(hDll, "SymGetModuleInfoW64"); + symGetSymFromAddr64 = (t_SymGetSymFromAddr64)GetProcAddress(hDll, "SymGetSymFromAddr64"); + unDecorateSymbolName = (t_UnDecorateSymbolName)GetProcAddress(hDll, "UnDecorateSymbolName"); + symInitialize = (t_SymInitialize)GetProcAddress(hDll, "SymInitializeW"); + symCleanup = (t_SymCleanup)GetProcAddress(hDll, "SymCleanup"); + symGetSearchPath = (t_SymGetSearchPath)GetProcAddress(hDll, "SymGetSearchPathW"); + symGetOptions = (t_SymGetOptions)GetProcAddress(hDll, "SymGetOptions"); + symSetOptions = (t_SymSetOptions)GetProcAddress(hDll, "SymSetOptions"); + symLoadModule64 = (t_SymLoadModule64)GetProcAddress(hDll, "SymLoadModule64"); + if (!symGetModuleInfo64 || + !symGetLineFromAddr64 || + !symGetSymFromAddr64 || + !unDecorateSymbolName || + !symInitialize || + !symCleanup || + !symGetOptions || + !symSetOptions || + !symLoadModule64) { + symInitialize = 0; + return false; + } + + const size_t nSymPathLen = 10 * MAX_PATH; + WCHAR szSymPath[nSymPathLen] = { 0 }; + + wcscat_s(szSymPath, nSymPathLen, L".;..;"); + + WCHAR szTemp[MAX_PATH + 1] = { 0 }; + if (GetCurrentDirectory(MAX_PATH, szTemp) > 0) { + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + } + + if (GetModuleFileName(NULL, szTemp, MAX_PATH) > 0) { + for (WCHAR *p = (szTemp + wcslen(szTemp) - 1); p >= szTemp; --p) { + if ((*p == '\\') || (*p == '/') || (*p == ':')) { + *p = 0; + break; + } + } + if (wcslen(szTemp) > 0) { + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + } + } + if (GetEnvironmentVariable(L"_NT_SYMBOL_PATH", szTemp, MAX_PATH) > 0) { + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + } + if (GetEnvironmentVariable(L"_NT_ALTERNATE_SYMBOL_PATH", szTemp, MAX_PATH) > 0) { + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + } + if (GetEnvironmentVariable(L"SYSTEMROOT", szTemp, MAX_PATH) > 0) { + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + + // also add the "system32"-directory: + wcscat_s(szTemp, MAX_PATH, L"\\system32"); + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L";"); + } + + if (GetEnvironmentVariable(L"SYSTEMDRIVE", szTemp, MAX_PATH) > 0) { + wcscat_s(szSymPath, nSymPathLen, L"SRV*"); + wcscat_s(szSymPath, nSymPathLen, szTemp); + wcscat_s(szSymPath, nSymPathLen, L"\\websymbols*http://msdl.microsoft.com/download/symbols;"); + } else { + wcscat_s(szSymPath, nSymPathLen, L"SRV*c:\\websymbols*http://msdl.microsoft.com/download/symbols;"); + } + + if (symInitialize(hProcess, szSymPath, FALSE) == FALSE) { + symInitialize = 0; + return false; + } + + DWORD symOptions = symGetOptions(); + symOptions |= SYMOPT_LOAD_LINES; + symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; + symOptions = symSetOptions(symOptions); + + const WCHAR *dllname[] = { L"kernel32.dll", L"tlhelp32.dll" }; + HINSTANCE hToolhelp = NULL; + + HANDLE hSnap; + MODULEENTRY32 me; + me.dwSize = sizeof(me); + BOOL keepGoing; + size_t i; + + for (i = 0; i < (sizeof(dllname) / sizeof(dllname[0])); i++) { + hToolhelp = LoadLibrary(dllname[i]); + if (!hToolhelp) continue; + + createToolhelp32Snapshot = (t_CreateToolhelp32Snapshot)GetProcAddress(hToolhelp, "CreateToolhelp32Snapshot"); + module32First = (t_Module32First)GetProcAddress(hToolhelp, "Module32First"); + module32Next = (t_Module32Next)GetProcAddress(hToolhelp, "Module32Next"); + if (createToolhelp32Snapshot && module32First && module32Next) { + break; // found the functions! + } + FreeLibrary(hToolhelp); + hToolhelp = NULL; + } + + if (hToolhelp == NULL) { + return false; + } + + hSnap = createToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId); + if (hSnap == (HANDLE)-1) + return FALSE; + + keepGoing = !!module32First(hSnap, &me); + int cnt = 0; + while (keepGoing) { + symLoadModule64(hProcess, 0, me.szExePath, me.szModule, (DWORD64)me.modBaseAddr, me.modBaseSize); + ++cnt; + keepGoing = !!module32Next(hSnap, &me); + } + CloseHandle(hSnap); + FreeLibrary(hToolhelp); + + return (cnt > 0); + } + + return true; +} + +struct StackEntry { + DWORD64 offset; // if 0, we have no valid entry + CHAR name[StackEntryMaxNameLength]; + CHAR undName[StackEntryMaxNameLength]; + CHAR undFullName[StackEntryMaxNameLength]; + DWORD64 offsetFromSmybol; + DWORD offsetFromLine; + DWORD lineNumber; + WCHAR lineFileName[StackEntryMaxNameLength]; + DWORD symType; + LPCSTR symTypeString; + WCHAR moduleName[StackEntryMaxNameLength]; + DWORD64 baseOfImage; + WCHAR loadedImageName[StackEntryMaxNameLength]; +}; + +enum StackEntryType { + StackEntryFirst, + StackEntryNext, + StackEntryLast, +}; + +char GetModuleInfoData[2 * sizeof(IMAGEHLP_MODULEW64)]; +BOOL _getModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULEW64 *pModuleInfo) { + pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULEW64); + + memcpy(GetModuleInfoData, pModuleInfo, sizeof(IMAGEHLP_MODULEW64)); + if (symGetModuleInfo64(hProcess, baseAddr, (IMAGEHLP_MODULEW64*)GetModuleInfoData) != FALSE) { + // only copy as much memory as is reserved... + memcpy(pModuleInfo, GetModuleInfoData, sizeof(IMAGEHLP_MODULEW64)); + pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULEW64); + return TRUE; + } + return FALSE; +} + +void psWriteDump() { +} + +char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile) { + if (!LoadDbgHelp(true)) { + return qsl("ERROR: could not init dbghelp.dll!"); + } + + HANDLE hProcess = GetCurrentProcess(); + + QString initial = QString::fromUtf8(crashdump), result; + QStringList lines = initial.split('\n'); + result.reserve(initial.size()); + int32 i = 0, l = lines.size(); + QString versionstr; + uint64 version = 0, betaversion = 0; + for (; i < l; ++i) { + result.append(lines.at(i)).append('\n'); + QString line = lines.at(i).trimmed(); + if (line.startsWith(qstr("Version: "))) { + versionstr = line.mid(qstr("Version: ").size()).trimmed(); + version = versionstr.toULongLong(); + if (versionstr.endsWith(qstr("beta"))) { + if (version % 1000) { + betaversion = version; + } else { + version /= 1000; + } + } + ++i; + break; + } + } + + // maybe need to launch another executable + QString tolaunch; + if ((betaversion && betaversion != cBetaVersion()) || (!betaversion && version && version != AppVersion)) { + QString path = cExeDir(); + QRegularExpressionMatch m = QRegularExpression("deploy/\\d+\\.\\d+/\\d+\\.\\d+\\.\\d+(/|\\.dev/|_\\d+/)(Telegram/)?$").match(path); + if (m.hasMatch()) { + QString base = path.mid(0, m.capturedStart()) + qstr("deploy/"); + int32 major = version / 1000000, minor = (version % 1000000) / 1000, micro = (version % 1000); + base += qsl("%1.%2/%3.%4.%5").arg(major).arg(minor).arg(major).arg(minor).arg(micro); + if (betaversion) { + base += qsl("_%1").arg(betaversion); + } else if (QDir(base + qstr(".dev")).exists()) { + base += qstr(".dev"); + } + if (QFile(base + qstr("/Telegram/Telegram.exe")).exists()) { + base += qstr("/Telegram"); + } + tolaunch = base + qstr("Telegram.exe"); + } + } + if (!tolaunch.isEmpty()) { + result.append(qsl("ERROR: for this crashdump executable '%1' should be used!").arg(tolaunch)); + } + + while (i < l) { + for (; i < l; ++i) { + result.append(lines.at(i)).append('\n'); + QString line = lines.at(i).trimmed(); + if (line == qstr("Backtrace:")) { + ++i; + break; + } + } + + IMAGEHLP_SYMBOL64 *pSym = NULL; + IMAGEHLP_MODULEW64 Module; + IMAGEHLP_LINEW64 Line; + + pSym = (IMAGEHLP_SYMBOL64*)ImageHlpSymbol64; + memset(pSym, 0, sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength); + pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); + pSym->MaxNameLength = StackEntryMaxNameLength; + + memset(&Line, 0, sizeof(Line)); + Line.SizeOfStruct = sizeof(Line); + + memset(&Module, 0, sizeof(Module)); + Module.SizeOfStruct = sizeof(Module); + + StackEntry csEntry; + for (int32 start = i; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + result.append(qsl("%1. ").arg(i + 1 - start)); + if (!QRegularExpression(qsl("^\\d+$")).match(line).hasMatch()) { + if (!lines.at(i).startsWith(qstr("ERROR: "))) { + result.append(qstr("BAD LINE: ")); + } + result.append(line).append('\n'); + continue; + } + + DWORD64 address = line.toULongLong(); + + csEntry.offset = address; + csEntry.name[0] = 0; + csEntry.undName[0] = 0; + csEntry.undFullName[0] = 0; + csEntry.offsetFromSmybol = 0; + csEntry.offsetFromLine = 0; + csEntry.lineFileName[0] = 0; + csEntry.lineNumber = 0; + csEntry.loadedImageName[0] = 0; + csEntry.moduleName[0] = 0; + + if (symGetSymFromAddr64(hProcess, address, &(csEntry.offsetFromSmybol), pSym) != FALSE) { + // TODO: Mache dies sicher...! + strcpy_s(csEntry.name, pSym->Name); + + unDecorateSymbolName(pSym->Name, csEntry.undName, StackEntryMaxNameLength, UNDNAME_NAME_ONLY); + unDecorateSymbolName(pSym->Name, csEntry.undFullName, StackEntryMaxNameLength, UNDNAME_COMPLETE); + + if (symGetLineFromAddr64) { + if (symGetLineFromAddr64(hProcess, address, &(csEntry.offsetFromLine), &Line) != FALSE) { + csEntry.lineNumber = Line.LineNumber; + + // TODO: Mache dies sicher...! + wcscpy_s(csEntry.lineFileName, Line.FileName); + } + } + } else { + result.append("ERROR: could not get Sym from Addr! for ").append(QString::number(address)).append('\n'); + continue; + } + + if (_getModuleInfo(hProcess, address, &Module) != FALSE) { + // TODO: Mache dies sicher...! + wcscpy_s(csEntry.moduleName, Module.ModuleName); + } + if (csEntry.name[0] == 0) { + strcpy_s(csEntry.name, "(function-name not available)"); + } + if (csEntry.undName[0] != 0) { + strcpy_s(csEntry.name, csEntry.undName); + } + if (csEntry.undFullName[0] != 0) { + strcpy_s(csEntry.name, csEntry.undFullName); + } + if (csEntry.lineFileName[0] == 0) { + if (csEntry.moduleName[0] == 0) { + wcscpy_s(csEntry.moduleName, L"module-name not available"); + } + result.append(csEntry.name).append(qsl(" (%1) 0x%3").arg(QString::fromWCharArray(csEntry.moduleName)).arg(address, 0, 16)).append('\n'); + } else { + QString file = QString::fromWCharArray(csEntry.lineFileName).toLower(); + int32 index = file.indexOf(qstr("tbuild\\tdesktop\\telegram\\")); + if (index >= 0) { + file = file.mid(index + qstr("tbuild\\tdesktop\\telegram\\").size()); + if (file.startsWith(qstr("sourcefiles\\"))) { + file = file.mid(qstr("sourcefiles\\").size()); + } + } + result.append(csEntry.name).append(qsl(" (%1 - %2) 0x%3").arg(file).arg(csEntry.lineNumber).arg(address, 0, 16)).append('\n'); + } + } + } + + symCleanup(hProcess); + return result; +} + +void psWriteStackTrace() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + if (!LoadDbgHelp()) { + SignalHandlers::dump() << "ERROR: Could not load dbghelp.dll!\n"; + return; + } + + HANDLE hThread = GetCurrentThread(), hProcess = GetCurrentProcess(); + const CONTEXT *context = NULL; + LPVOID pUserData = NULL; + + CONTEXT c; + int frameNum; + + memset(&c, 0, sizeof(CONTEXT)); + c.ContextFlags = CONTEXT_FULL; + RtlCaptureContext(&c); + + // init STACKFRAME for first call + STACKFRAME64 s; // in/out stackframe + memset(&s, 0, sizeof(s)); + DWORD imageType; +#ifdef _M_IX86 + // normally, call ImageNtHeader() and use machine info from PE header + imageType = IMAGE_FILE_MACHINE_I386; + s.AddrPC.Offset = c.Eip; + s.AddrPC.Mode = AddrModeFlat; + s.AddrFrame.Offset = c.Ebp; + s.AddrFrame.Mode = AddrModeFlat; + s.AddrStack.Offset = c.Esp; + s.AddrStack.Mode = AddrModeFlat; +#elif _M_X64 + imageType = IMAGE_FILE_MACHINE_AMD64; + s.AddrPC.Offset = c.Rip; + s.AddrPC.Mode = AddrModeFlat; + s.AddrFrame.Offset = c.Rsp; + s.AddrFrame.Mode = AddrModeFlat; + s.AddrStack.Offset = c.Rsp; + s.AddrStack.Mode = AddrModeFlat; +#elif _M_IA64 + imageType = IMAGE_FILE_MACHINE_IA64; + s.AddrPC.Offset = c.StIIP; + s.AddrPC.Mode = AddrModeFlat; + s.AddrFrame.Offset = c.IntSp; + s.AddrFrame.Mode = AddrModeFlat; + s.AddrBStore.Offset = c.RsBSP; + s.AddrBStore.Mode = AddrModeFlat; + s.AddrStack.Offset = c.IntSp; + s.AddrStack.Mode = AddrModeFlat; +#else +#error "Platform not supported!" +#endif + + for (frameNum = 0; frameNum < 1024; ++frameNum) { + // get next stack frame (StackWalk64(), SymFunctionTableAccess64(), SymGetModuleBase64()) + // if this returns ERROR_INVALID_ADDRESS (487) or ERROR_NOACCESS (998), you can + // assume that either you are done, or that the stack is so hosed that the next + // deeper frame could not be found. + // CONTEXT need not to be suplied if imageTyp is IMAGE_FILE_MACHINE_I386! + if (!stackWalk64(imageType, hProcess, hThread, &s, &c, ReadProcessMemoryRoutine64, symFunctionTableAccess64, symGetModuleBase64, NULL)) { + SignalHandlers::dump() << "ERROR: Call to StackWalk64() failed!\n"; + return; + } + + if (s.AddrPC.Offset == s.AddrReturn.Offset) { + SignalHandlers::dump() << s.AddrPC.Offset << "\n"; + SignalHandlers::dump() << "ERROR: StackWalk64() endless callstack!"; + return; + } + if (s.AddrPC.Offset != 0) { // we seem to have a valid PC + SignalHandlers::dump() << s.AddrPC.Offset << "\n"; + } + + if (s.AddrReturn.Offset == 0) { + break; + } + } +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS +} + +class StringReferenceWrapper { +public: + + StringReferenceWrapper(_In_reads_(length) PCWSTR stringRef, _In_ UINT32 length) throw() { + HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); + if (!SUCCEEDED(hr)) { + RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); + } + } + + ~StringReferenceWrapper() { + windowsDeleteString(_hstring); + } + + template + StringReferenceWrapper(_In_reads_(N) wchar_t const (&stringRef)[N]) throw() { + UINT32 length = N - 1; + HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); + if (!SUCCEEDED(hr)) { + RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); + } + } + + template + StringReferenceWrapper(_In_reads_(_) wchar_t(&stringRef)[_]) throw() { + UINT32 length; + HRESULT hr = SizeTToUInt32(wcslen(stringRef), &length); + if (!SUCCEEDED(hr)) { + RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); + } + + windowsCreateStringReference(stringRef, length, &_header, &_hstring); + } + + HSTRING Get() const throw() { + return _hstring; + } + +private: + HSTRING _hstring; + HSTRING_HEADER _header; + +}; + +HRESULT SetNodeValueString(_In_ HSTRING inputString, _In_ IXmlNode *node, _In_ IXmlDocument *xml) { + ComPtr inputText; + + HRESULT hr = xml->CreateTextNode(inputString, &inputText); + if (!SUCCEEDED(hr)) return hr; + ComPtr inputTextNode; + + hr = inputText.As(&inputTextNode); + if (!SUCCEEDED(hr)) return hr; + + ComPtr pAppendedChild; + return node->AppendChild(inputTextNode.Get(), &pAppendedChild); +} + +HRESULT SetAudioSilent(_In_ IXmlDocument *toastXml) { + ComPtr nodeList; + HRESULT hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"audio").Get(), &nodeList); + if (!SUCCEEDED(hr)) return hr; + + ComPtr audioNode; + hr = nodeList->Item(0, &audioNode); + if (!SUCCEEDED(hr)) return hr; + + if (audioNode) { + ComPtr audioElement; + hr = audioNode.As(&audioElement); + if (!SUCCEEDED(hr)) return hr; + + hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); + if (!SUCCEEDED(hr)) return hr; + } else { + ComPtr audioElement; + hr = toastXml->CreateElement(StringReferenceWrapper(L"audio").Get(), &audioElement); + if (!SUCCEEDED(hr)) return hr; + + hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); + if (!SUCCEEDED(hr)) return hr; + + ComPtr audioNode; + hr = audioElement.As(&audioNode); + if (!SUCCEEDED(hr)) return hr; + + ComPtr nodeList; + hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"toast").Get(), &nodeList); + if (!SUCCEEDED(hr)) return hr; + + ComPtr toastNode; + hr = nodeList->Item(0, &toastNode); + if (!SUCCEEDED(hr)) return hr; + + ComPtr appendedNode; + hr = toastNode->AppendChild(audioNode.Get(), &appendedNode); + } + return hr; +} + +HRESULT SetImageSrc(_In_z_ const wchar_t *imagePath, _In_ IXmlDocument *toastXml) { + wchar_t imageSrc[MAX_PATH] = L"file:///"; + HRESULT hr = StringCchCat(imageSrc, ARRAYSIZE(imageSrc), imagePath); + if (!SUCCEEDED(hr)) return hr; + + ComPtr nodeList; + hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"image").Get(), &nodeList); + if (!SUCCEEDED(hr)) return hr; + + ComPtr imageNode; + hr = nodeList->Item(0, &imageNode); + if (!SUCCEEDED(hr)) return hr; + + ComPtr attributes; + hr = imageNode->get_Attributes(&attributes); + if (!SUCCEEDED(hr)) return hr; + + ComPtr srcAttribute; + hr = attributes->GetNamedItem(StringReferenceWrapper(L"src").Get(), &srcAttribute); + if (!SUCCEEDED(hr)) return hr; + + return SetNodeValueString(StringReferenceWrapper(imageSrc).Get(), srcAttribute.Get(), toastXml); +} + +typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastActivatedEventHandler; +typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastDismissedEventHandler; +typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastFailedEventHandler; + +class ToastEventHandler : public Implements { +public: + + ToastEventHandler::ToastEventHandler(const PeerId &peer, MsgId msg) : _ref(1), _peerId(peer), _msgId(msg) { + } + ~ToastEventHandler() { + } + + // DesktopToastActivatedEventHandler + IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IInspectable* args) { + ToastNotifications::iterator i = toastNotifications.find(_peerId); + if (i != toastNotifications.cend()) { + i.value().remove(_msgId); + if (i.value().isEmpty()) { + toastNotifications.erase(i); + } + } + if (App::wnd()) { + History *history = App::history(_peerId); + + App::wnd()->showFromTray(); + if (App::passcoded()) { + App::wnd()->setInnerFocus(); + App::wnd()->notifyClear(); + } else { + App::wnd()->hideSettings(); + bool tomsg = !history->peer->isUser() && (_msgId > 0); + if (tomsg) { + HistoryItem *item = App::histItemById(peerToChannel(_peerId), _msgId); + if (!item || !item->mentionsMe()) { + tomsg = false; + } + } + Ui::showPeerHistory(history, tomsg ? _msgId : ShowAtUnreadMsgId); + App::wnd()->notifyClear(history); + } + SetForegroundWindow(App::wnd()->psHwnd()); + } + return S_OK; + } + + // DesktopToastDismissedEventHandler + IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastDismissedEventArgs *e) { + ToastDismissalReason tdr; + if (SUCCEEDED(e->get_Reason(&tdr))) { + switch (tdr) { + case ToastDismissalReason_ApplicationHidden: + break; + case ToastDismissalReason_UserCanceled: + case ToastDismissalReason_TimedOut: + default: + ToastNotifications::iterator i = toastNotifications.find(_peerId); + if (i != toastNotifications.cend()) { + i.value().remove(_msgId); + if (i.value().isEmpty()) { + toastNotifications.erase(i); + } + } + break; + } + } + return S_OK; + } + + // DesktopToastFailedEventHandler + IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastFailedEventArgs *e) { + ToastNotifications::iterator i = toastNotifications.find(_peerId); + if (i != toastNotifications.cend()) { + i.value().remove(_msgId); + if (i.value().isEmpty()) { + toastNotifications.erase(i); + } + } + return S_OK; + } + + // IUnknown + IFACEMETHODIMP_(ULONG) AddRef() { + return InterlockedIncrement(&_ref); + } + + IFACEMETHODIMP_(ULONG) Release() { + ULONG l = InterlockedDecrement(&_ref); + if (l == 0) delete this; + return l; + } + + IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _COM_Outptr_ void **ppv) { + if (IsEqualIID(riid, IID_IUnknown)) + *ppv = static_cast(static_cast(this)); + else if (IsEqualIID(riid, __uuidof(DesktopToastActivatedEventHandler))) + *ppv = static_cast(this); + else if (IsEqualIID(riid, __uuidof(DesktopToastDismissedEventHandler))) + *ppv = static_cast(this); + else if (IsEqualIID(riid, __uuidof(DesktopToastFailedEventHandler))) + *ppv = static_cast(this); + else *ppv = nullptr; + + if (*ppv) { + reinterpret_cast(*ppv)->AddRef(); + return S_OK; + } + + return E_NOINTERFACE; + } + +private: + + ULONG _ref; + PeerId _peerId; + MsgId _msgId; +}; + +template +_Check_return_ __inline HRESULT _1_GetActivationFactory(_In_ HSTRING activatableClassId, _COM_Outptr_ T** factory) { + return roGetActivationFactory(activatableClassId, IID_INS_ARGS(factory)); +} + +template +inline HRESULT wrap_GetActivationFactory(_In_ HSTRING activatableClassId, _Inout_ Details::ComPtrRef factory) throw() { + return _1_GetActivationFactory(activatableClassId, factory.ReleaseAndGetAddressOf()); +} + +QString toastImage(const StorageKey &key, PeerData *peer) { + uint64 ms = getms(true); + ToastImages::iterator i = toastImages.find(key); + if (i != toastImages.cend()) { + if (i->until) { + i->until = ms + NotifyDeletePhotoAfter; + if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); + } + } else { + ToastImage v; + if (key.first) { + v.until = ms + NotifyDeletePhotoAfter; + if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); + } else { + v.until = 0; + } + v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); + if (key.first || key.second) { + peer->saveUserpic(v.path); + } else { + App::wnd()->iconLarge().save(v.path, "PNG"); + } + i = toastImages.insert(key, v); + ToastImageSavedFlag = true; + } + return i->path; +} + +bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg) { + if (!useToast || !toastNotificationManager || !toastNotifier || !toastNotificationFactory) return false; + + ComPtr toastXml; + bool withSubtitle = !subtitle.isEmpty(); + + HRESULT hr = toastNotificationManager->GetTemplateContent(withSubtitle ? ToastTemplateType_ToastImageAndText04 : ToastTemplateType_ToastImageAndText02, &toastXml); + if (!SUCCEEDED(hr)) return false; + + hr = SetAudioSilent(toastXml.Get()); + if (!SUCCEEDED(hr)) return false; + + StorageKey key; + QString imagePath; + if (showpix) { + key = peer->userpicUniqueKey(); + } else { + key = StorageKey(0, 0); + } + QString image = toastImage(key, peer); + std::wstring wimage = QDir::toNativeSeparators(image).toStdWString(); + + hr = SetImageSrc(wimage.c_str(), toastXml.Get()); + if (!SUCCEEDED(hr)) return false; + + ComPtr nodeList; + hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"text").Get(), &nodeList); + if (!SUCCEEDED(hr)) return false; + + UINT32 nodeListLength; + hr = nodeList->get_Length(&nodeListLength); + if (!SUCCEEDED(hr)) return false; + + if (nodeListLength < (withSubtitle ? 3U : 2U)) return false; + + { + ComPtr textNode; + hr = nodeList->Item(0, &textNode); + if (!SUCCEEDED(hr)) return false; + + std::wstring wtitle = title.toStdWString(); + hr = SetNodeValueString(StringReferenceWrapper(wtitle.data(), wtitle.size()).Get(), textNode.Get(), toastXml.Get()); + if (!SUCCEEDED(hr)) return false; + } + if (withSubtitle) { + ComPtr textNode; + hr = nodeList->Item(1, &textNode); + if (!SUCCEEDED(hr)) return false; + + std::wstring wsubtitle = subtitle.toStdWString(); + hr = SetNodeValueString(StringReferenceWrapper(wsubtitle.data(), wsubtitle.size()).Get(), textNode.Get(), toastXml.Get()); + if (!SUCCEEDED(hr)) return false; + } + { + ComPtr textNode; + hr = nodeList->Item(withSubtitle ? 2 : 1, &textNode); + if (!SUCCEEDED(hr)) return false; + + std::wstring wmsg = msg.toStdWString(); + hr = SetNodeValueString(StringReferenceWrapper(wmsg.data(), wmsg.size()).Get(), textNode.Get(), toastXml.Get()); + if (!SUCCEEDED(hr)) return false; + } + + ComPtr toast; + hr = toastNotificationFactory->CreateToastNotification(toastXml.Get(), &toast); + if (!SUCCEEDED(hr)) return false; + + EventRegistrationToken activatedToken, dismissedToken, failedToken; + ComPtr eventHandler(new ToastEventHandler(peer->id, msgId)); + + hr = toast->add_Activated(eventHandler.Get(), &activatedToken); + if (!SUCCEEDED(hr)) return false; + + hr = toast->add_Dismissed(eventHandler.Get(), &dismissedToken); + if (!SUCCEEDED(hr)) return false; + + hr = toast->add_Failed(eventHandler.Get(), &failedToken); + if (!SUCCEEDED(hr)) return false; + + ToastNotifications::iterator i = toastNotifications.find(peer->id); + if (i != toastNotifications.cend()) { + QMap::iterator j = i->find(msgId); + if (j != i->cend()) { + ComPtr notify = j->p; + i->erase(j); + toastNotifier->Hide(notify.Get()); + i = toastNotifications.find(peer->id); + } + } + if (i == toastNotifications.cend()) { + i = toastNotifications.insert(peer->id, QMap()); + } + hr = toastNotifier->Show(toast.Get()); + if (!SUCCEEDED(hr)) { + i = toastNotifications.find(peer->id); + if (i != toastNotifications.cend() && i->isEmpty()) toastNotifications.erase(i); + return false; + } + toastNotifications[peer->id].insert(msgId, toast); + + return true; +} + +QString pinnedPath() { + static const int maxFileLen = MAX_PATH * 10; + WCHAR wstrPath[maxFileLen]; + if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + return appData.absolutePath() + qsl("/Microsoft/Internet Explorer/Quick Launch/User Pinned/TaskBar/"); + } + return QString(); +} + +void CheckPinnedAppUserModelId() { + if (!propVariantToString) return; + + static const int maxFileLen = MAX_PATH * 10; + + HRESULT hr = CoInitialize(0); + if (!SUCCEEDED(hr)) return; + + QString path = pinnedPath(); + std::wstring p = QDir::toNativeSeparators(path).toStdWString(); + + WCHAR src[MAX_PATH]; + GetModuleFileName(GetModuleHandle(0), src, MAX_PATH); + BY_HANDLE_FILE_INFORMATION srcinfo = { 0 }; + HANDLE srcfile = CreateFile(src, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (srcfile == INVALID_HANDLE_VALUE) return; + BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); + CloseHandle(srcfile); + if (!srcres) return; + LOG(("Checking..")); + WIN32_FIND_DATA findData; + HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); + if (findHandle == INVALID_HANDLE_VALUE) { + LOG(("Init Error: could not find files in pinned folder")); + return; + } + do { + std::wstring fname = p + findData.cFileName; + LOG(("Checking %1").arg(QString::fromStdWString(fname))); + if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + continue; + } else { + DWORD attributes = GetFileAttributes(fname.c_str()); + if (attributes >= 0xFFFFFFF) continue; // file does not exist + + ComPtr shellLink; + HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + if (!SUCCEEDED(hr)) continue; + + ComPtr persistFile; + hr = shellLink.As(&persistFile); + if (!SUCCEEDED(hr)) continue; + + hr = persistFile->Load(fname.c_str(), STGM_READWRITE); + if (!SUCCEEDED(hr)) continue; + + WCHAR dst[MAX_PATH]; + hr = shellLink->GetPath(dst, MAX_PATH, 0, 0); + if (!SUCCEEDED(hr)) continue; + + BY_HANDLE_FILE_INFORMATION dstinfo = { 0 }; + HANDLE dstfile = CreateFile(dst, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (dstfile == INVALID_HANDLE_VALUE) continue; + BOOL dstres = GetFileInformationByHandle(dstfile, &dstinfo); + CloseHandle(dstfile); + if (!dstres) continue; + + if (srcinfo.dwVolumeSerialNumber == dstinfo.dwVolumeSerialNumber && srcinfo.nFileIndexLow == dstinfo.nFileIndexLow && srcinfo.nFileIndexHigh == dstinfo.nFileIndexHigh) { + ComPtr propertyStore; + hr = shellLink.As(&propertyStore); + if (!SUCCEEDED(hr)) return; + + PROPVARIANT appIdPropVar; + hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); + if (!SUCCEEDED(hr)) return; + LOG(("Reading..")); + WCHAR already[MAX_PATH]; + hr = propVariantToString(appIdPropVar, already, MAX_PATH); + if (SUCCEEDED(hr)) { + if (std::wstring(AppUserModelId()) == already) { + LOG(("Already!")); + PropVariantClear(&appIdPropVar); + return; + } + } + if (appIdPropVar.vt != VT_EMPTY) { + PropVariantClear(&appIdPropVar); + return; + } + PropVariantClear(&appIdPropVar); + + hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + if (!SUCCEEDED(hr)) return; + + hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + PropVariantClear(&appIdPropVar); + if (!SUCCEEDED(hr)) return; + + hr = propertyStore->Commit(); + if (!SUCCEEDED(hr)) return; + + if (persistFile->IsDirty() == S_OK) { + persistFile->Save(fname.c_str(), TRUE); + } + return; + } + } + } while (FindNextFile(findHandle, &findData)); + DWORD errorCode = GetLastError(); + if (errorCode && errorCode != ERROR_NO_MORE_FILES) { // everything is found + LOG(("Init Error: could not find some files in pinned folder")); + return; + } + FindClose(findHandle); +} + +QString systemShortcutPath() { + static const int maxFileLen = MAX_PATH * 10; + WCHAR wstrPath[maxFileLen]; + if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + return appData.absolutePath() + qsl("/Microsoft/Windows/Start Menu/Programs/"); + } + return QString(); +} + +void CleanupAppUserModelIdShortcut() { + static const int maxFileLen = MAX_PATH * 10; + + QString path = systemShortcutPath() + qsl("Telegram.lnk"); + std::wstring p = QDir::toNativeSeparators(path).toStdWString(); + + DWORD attributes = GetFileAttributes(p.c_str()); + if (attributes >= 0xFFFFFFF) return; // file does not exist + + ComPtr shellLink; + HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + if (!SUCCEEDED(hr)) return; + + ComPtr persistFile; + hr = shellLink.As(&persistFile); + if (!SUCCEEDED(hr)) return; + + hr = persistFile->Load(p.c_str(), STGM_READWRITE); + if (!SUCCEEDED(hr)) return; + + WCHAR szGotPath[MAX_PATH]; + WIN32_FIND_DATA wfd; + hr = shellLink->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH); + if (!SUCCEEDED(hr)) return; + + if (QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString() == szGotPath) { + QFile().remove(path); + } +} + +bool ValidateAppUserModelIdShortcutAt(const QString &path) { + static const int maxFileLen = MAX_PATH * 10; + + std::wstring p = QDir::toNativeSeparators(path).toStdWString(); + + DWORD attributes = GetFileAttributes(p.c_str()); + if (attributes >= 0xFFFFFFF) return false; // file does not exist + + ComPtr shellLink; + HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + if (!SUCCEEDED(hr)) return false; + + ComPtr persistFile; + hr = shellLink.As(&persistFile); + if (!SUCCEEDED(hr)) return false; + + hr = persistFile->Load(p.c_str(), STGM_READWRITE); + if (!SUCCEEDED(hr)) return false; + + ComPtr propertyStore; + hr = shellLink.As(&propertyStore); + if (!SUCCEEDED(hr)) return false; + + PROPVARIANT appIdPropVar; + hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); + if (!SUCCEEDED(hr)) return false; + + WCHAR already[MAX_PATH]; + hr = propVariantToString(appIdPropVar, already, MAX_PATH); + if (SUCCEEDED(hr)) { + if (std::wstring(AppUserModelId()) == already) { + PropVariantClear(&appIdPropVar); + return true; + } + } + if (appIdPropVar.vt != VT_EMPTY) { + PropVariantClear(&appIdPropVar); + return false; + } + PropVariantClear(&appIdPropVar); + + hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + if (!SUCCEEDED(hr)) return false; + + hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + PropVariantClear(&appIdPropVar); + if (!SUCCEEDED(hr)) return false; + + hr = propertyStore->Commit(); + if (!SUCCEEDED(hr)) return false; + + if (persistFile->IsDirty() == S_OK) { + persistFile->Save(p.c_str(), TRUE); + } + + return true; +} + +bool ValidateAppUserModelIdShortcut() { + if (!useToast) return false; + + QString path = systemShortcutPath(); + if (path.isEmpty()) return false; + + if (cBetaVersion()) { + path += qsl("TelegramBeta.lnk"); + if (ValidateAppUserModelIdShortcutAt(path)) return true; + } else { + if (ValidateAppUserModelIdShortcutAt(path + qsl("Telegram Desktop/Telegram.lnk"))) return true; + if (ValidateAppUserModelIdShortcutAt(path + qsl("Telegram Win (Unofficial)/Telegram.lnk"))) return true; + + path += qsl("Telegram.lnk"); + if (ValidateAppUserModelIdShortcutAt(path)) return true; + } + + ComPtr shellLink; + HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + if (!SUCCEEDED(hr)) return false; + + hr = shellLink->SetPath(QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString().c_str()); + if (!SUCCEEDED(hr)) return false; + + hr = shellLink->SetArguments(L""); + if (!SUCCEEDED(hr)) return false; + + hr = shellLink->SetWorkingDirectory(QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()).toStdWString().c_str()); + if (!SUCCEEDED(hr)) return false; + + ComPtr propertyStore; + hr = shellLink.As(&propertyStore); + if (!SUCCEEDED(hr)) return false; + + PROPVARIANT appIdPropVar; + hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + if (!SUCCEEDED(hr)) return false; + + hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + PropVariantClear(&appIdPropVar); + if (!SUCCEEDED(hr)) return false; + + PROPVARIANT startPinPropVar; + hr = InitPropVariantFromUInt32(APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL, &startPinPropVar); + if (!SUCCEEDED(hr)) return false; + + hr = propertyStore->SetValue(pkey_AppUserModel_StartPinOption, startPinPropVar); + PropVariantClear(&startPinPropVar); + if (!SUCCEEDED(hr)) return false; + + hr = propertyStore->Commit(); + if (!SUCCEEDED(hr)) return false; + + ComPtr persistFile; + hr = shellLink.As(&persistFile); + if (!SUCCEEDED(hr)) return false; + + hr = persistFile->Save(QDir::toNativeSeparators(path).toStdWString().c_str(), TRUE); + if (!SUCCEEDED(hr)) return false; + + return true; +} + +bool InitToastManager() { + if (!useToast || !ValidateAppUserModelIdShortcut()) return false; + if (!SUCCEEDED(setCurrentProcessExplicitAppUserModelID(AppUserModelId()))) { + return false; + } + if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), &toastNotificationManager))) { + return false; + } + if (!SUCCEEDED(toastNotificationManager->CreateToastNotifierWithId(StringReferenceWrapper(AppUserModelId(), wcslen(AppUserModelId())).Get(), &toastNotifier))) { + return false; + } + if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(), &toastNotificationFactory))) { + return false; + } + QDir().mkpath(cWorkingDir() + qsl("tdata/temp")); + return true; +} + +bool psLaunchMaps(const LocationCoords &coords) { + return QDesktopServices::openUrl(qsl("bingmaps:?lvl=16&collection=point.%1_%2_Point").arg(coords.lat).arg(coords.lon)); +} diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_win.h similarity index 100% rename from Telegram/SourceFiles/pspecific_wnd.h rename to Telegram/SourceFiles/pspecific_win.h diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_winrt.cpp similarity index 100% rename from Telegram/SourceFiles/pspecific_wnd.cpp rename to Telegram/SourceFiles/pspecific_winrt.cpp diff --git a/Telegram/SourceFiles/pspecific_winrt.h b/Telegram/SourceFiles/pspecific_winrt.h new file mode 100644 index 000000000..0f149ad29 --- /dev/null +++ b/Telegram/SourceFiles/pspecific_winrt.h @@ -0,0 +1,198 @@ + +/* +This file is part of Telegram Desktop, +the official desktop version of Telegram 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. + +In addition, as a special exception, the copyright holders give permission +to link the code of portions of this program with the OpenSSL library. + +Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org +*/ +#pragma once + +inline QString psServerPrefix() { + return qsl("Global\\"); +} +inline void psCheckLocalSocket(const QString &) { +} + +class NotifyWindow; + +class PsMainWindow : public QMainWindow { + Q_OBJECT + +public: + PsMainWindow(QWidget *parent = 0); + + int32 psResizeRowWidth() const { + return 0;//st::wndResizeAreaWidth; + } + + void psInitFrameless(); + void psInitSize(); + HWND psHwnd() const; + HMENU psMenu() const; + + void psFirstShow(); + void psInitSysMenu(); + void psUpdateSysMenu(Qt::WindowState state); + void psUpdateMargins(); + void psUpdatedPosition(); + + bool psHandleTitle(); + + void psFlash(); + void psNotifySettingGot(); + + void psUpdateWorkmode(); + + void psRefreshTaskbarIcon(); + + bool psPosInited() const { + return posInited; + } + + void psActivateNotify(NotifyWindow *w); + void psClearNotifies(PeerId peerId = 0); + void psNotifyShown(NotifyWindow *w); + void psPlatformNotify(HistoryItem *item, int32 fwdCount); + + void psUpdateCounter(); + + bool psHasNativeNotifications(); + void psCleanNotifyPhotosIn(int32 dt); + + virtual QImage iconWithCounter(int size, int count, style::color bg, bool smallIcon) = 0; + + ~PsMainWindow(); + +public slots: + + void psUpdateDelegate(); + void psSavePosition(Qt::WindowState state = Qt::WindowActive); + void psShowTrayMenu(); + + void psCleanNotifyPhotos(); + +protected: + + bool psHasTrayIcon() const { + return trayIcon; + } + + bool posInited; + QSystemTrayIcon *trayIcon; + PopupMenu *trayIconMenu; + QImage icon256, iconbig256; + QIcon wndIcon; + + void psTrayMenuUpdated(); + void psSetupTrayIcon(); + + QTimer psUpdatedPositionTimer; + +private: + HWND ps_hWnd; + HWND ps_tbHider_hWnd; + HMENU ps_menu; + HICON ps_iconBig, ps_iconSmall, ps_iconOverlay; + + SingleTimer ps_cleanNotifyPhotosTimer; + + void psDestroyIcons(); +}; + +void psWriteDump(); +void psWriteStackTrace(); +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); + +void psDeleteDir(const QString &dir); + +void psUserActionDone(); +bool psIdleSupported(); +uint64 psIdleTime(); + +bool psSkipAudioNotify(); +bool psSkipDesktopNotify(); + +QStringList psInitLogs(); +void psClearInitLogs(); + +void psActivateProcess(uint64 pid = 0); +QString psLocalServerPrefix(); +QString psCurrentCountry(); +QString psCurrentLanguage(); +QString psAppDataPath(); +QString psAppDataPathOld(); +QString psDownloadPath(); +QString psCurrentExeDirectory(int argc, char *argv[]); +QString psCurrentExeName(int argc, char *argv[]); +void psAutoStart(bool start, bool silent = false); +void psSendToMenu(bool send, bool silent = false); + +QRect psDesktopRect(); +void psShowOverAll(QWidget *w, bool canFocus = true); +void psBringToBack(QWidget *w); + +int psCleanup(); +int psFixPrevious(); + +void psExecUpdater(); +void psExecTelegram(const QString &arg = QString()); + +bool psShowOpenWithMenu(int x, int y, const QString &file); + +void psPostprocessFile(const QString &name); +void psOpenFile(const QString &name, bool openWith = false); +void psShowInFolder(const QString &name); + +QAbstractNativeEventFilter *psNativeEventFilter(); + +void psNewVersion(); + +void psUpdateOverlayed(TWidget *widget); +inline QString psConvertFileUrl(const QString &url) { + return url; +} +inline QByteArray psDownloadPathBookmark(const QString &path) { + return QByteArray(); +} +inline QByteArray psPathBookmark(const QString &path) { + return QByteArray(); +} +inline void psDownloadPathEnableAccess() { +} + +class PsFileBookmark { +public: + PsFileBookmark(const QByteArray &bookmark) { + } + bool check() const { + return true; + } + bool enable() const { + return true; + } + void disable() const { + } + const QString &name(const QString &original) const { + return original; + } + QByteArray bookmark() const { + return QByteArray(); + } + +}; + +bool psLaunchMaps(const LocationCoords &coords); diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 15192dbd9..0bd01d56d 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -263,9 +263,16 @@ HEADERS += \ win32 { SOURCES += \ - ./SourceFiles/pspecific_wnd.cpp + ./SourceFiles/pspecific_win.cpp HEADERS += \ - ./SourceFiles/pspecific_wnd.h + ./SourceFiles/pspecific_win.h +} + +winrt { +SOURCES += \ + ./SourceFiles/pspecific_winrt.cpp +HEADERS += \ + ./SourceFiles/pspecific_winrt.h } macx { diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index e3c7032b1..c3b16f57e 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -68,7 +68,7 @@ - AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + TDESKTOP_DISABLE_CRASH_REPORTS;AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl_debug\Debug\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\..\..\Libraries\breakpad\src;.\ThirdParty\minizip;.\SourceFiles;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase false @@ -370,10 +370,15 @@ true true - + true true + + true + true + true + true true @@ -628,7 +633,11 @@ true true - + + true + true + + true true @@ -912,7 +921,11 @@ true true - + + true + true + + true true @@ -1041,7 +1054,10 @@ true true - + + + true + @@ -1062,6 +1078,21 @@ + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing pspecific_winrt.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_winrt.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing pspecific_winrt.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_winrt.h" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing pspecific_winrt.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_winrt.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + true + @@ -1074,7 +1105,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/types.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/types.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1083,7 +1114,7 @@ Moc%27ing window.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/window.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/window.h" Moc%27ing window.h... Moc%27ing window.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1115,7 +1146,7 @@ Moc%27ing application.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/application.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/application.h" Moc%27ing application.h... Moc%27ing application.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1138,7 +1169,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing apiwrap.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/apiwrap.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/apiwrap.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing apiwrap.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1148,7 +1179,7 @@ Moc%27ing aboutbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/aboutbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/aboutbox.h" Moc%27ing aboutbox.h... Moc%27ing aboutbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1162,7 +1193,7 @@ Moc%27ing addcontactbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/addcontactbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/addcontactbox.h" Moc%27ing addcontactbox.h... Moc%27ing addcontactbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1176,7 +1207,7 @@ Moc%27ing confirmbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/confirmbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/confirmbox.h" Moc%27ing confirmbox.h... Moc%27ing confirmbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1190,7 +1221,7 @@ Moc%27ing connectionbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/connectionbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/connectionbox.h" Moc%27ing connectionbox.h... Moc%27ing connectionbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1204,7 +1235,7 @@ Moc%27ing contactsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/contactsbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/contactsbox.h" Moc%27ing contactsbox.h... Moc%27ing contactsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1218,7 +1249,7 @@ Moc%27ing photocropbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photocropbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photocropbox.h" Moc%27ing photocropbox.h... Moc%27ing photocropbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1232,7 +1263,7 @@ Moc%27ing photosendbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photosendbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photosendbox.h" Moc%27ing photosendbox.h... Moc%27ing photosendbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1246,7 +1277,7 @@ Moc%27ing emojibox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/emojibox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/emojibox.h" Moc%27ing emojibox.h... Moc%27ing emojibox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1260,7 +1291,7 @@ Moc%27ing downloadpathbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/downloadpathbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/downloadpathbox.h" Moc%27ing downloadpathbox.h... Moc%27ing downloadpathbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1279,7 +1310,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing audio.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/audio.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/audio.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing audio.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1293,7 +1324,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/usernamebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/usernamebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1307,7 +1338,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1321,7 +1352,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/backgroundbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/backgroundbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1335,7 +1366,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/autolockbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/autolockbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1349,7 +1380,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/passcodebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/passcodebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1363,7 +1394,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/sessionsbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/sessionsbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1377,7 +1408,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/abstractbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/abstractbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1391,7 +1422,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/stickersetbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/stickersetbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1405,7 +1436,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/autoupdater.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/autoupdater.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1415,7 +1446,7 @@ Moc%27ing animation.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/animation.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/animation.h" Moc%27ing animation.h... Moc%27ing animation.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1429,7 +1460,7 @@ Moc%27ing button.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/button.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/button.h" Moc%27ing button.h... Moc%27ing button.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1443,7 +1474,7 @@ Moc%27ing flatbutton.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatbutton.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatbutton.h" Moc%27ing flatbutton.h... Moc%27ing flatbutton.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1457,7 +1488,7 @@ Moc%27ing flatinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatinput.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatinput.h" Moc%27ing flatinput.h... Moc%27ing flatinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1471,7 +1502,7 @@ Moc%27ing countryinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/countryinput.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/countryinput.h" Moc%27ing countryinput.h... Moc%27ing countryinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1486,7 +1517,7 @@ Moc%27ing scrollarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/scrollarea.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/scrollarea.h" Moc%27ing scrollarea.h... Moc%27ing scrollarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1500,7 +1531,7 @@ Moc%27ing dialogswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dialogswidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dialogswidget.h" Moc%27ing dialogswidget.h... Moc%27ing dialogswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1514,7 +1545,7 @@ Moc%27ing flattextarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flattextarea.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flattextarea.h" Moc%27ing flattextarea.h... Moc%27ing flattextarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1528,7 +1559,7 @@ Moc%27ing fileuploader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/fileuploader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/fileuploader.h" Moc%27ing fileuploader.h... Moc%27ing fileuploader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1542,7 +1573,7 @@ Moc%27ing dropdown.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dropdown.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dropdown.h" Moc%27ing dropdown.h... Moc%27ing dropdown.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1563,7 +1594,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing popupmenu.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing popupmenu.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1573,7 +1604,7 @@ Moc%27ing flatcheckbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatcheckbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatcheckbox.h" Moc%27ing flatcheckbox.h... Moc%27ing flatcheckbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1608,7 +1639,7 @@ Moc%27ing flatlabel.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatlabel.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatlabel.h" Moc%27ing flatlabel.h... Moc%27ing flatlabel.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1622,7 +1653,7 @@ Moc%27ing twidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/twidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/twidget.h" Moc%27ing twidget.h... Moc%27ing twidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1641,7 +1672,7 @@ "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" @@ -1652,7 +1683,7 @@ Moc%27ing historywidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/historywidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/historywidget.h" Moc%27ing historywidget.h... Moc%27ing historywidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1666,7 +1697,7 @@ Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" Moc%27ing introwidget.h... Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1680,7 +1711,7 @@ Moc%27ing introcode.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introcode.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introcode.h" Moc%27ing introcode.h... Moc%27ing introcode.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1694,7 +1725,7 @@ Moc%27ing introphone.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introphone.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introphone.h" Moc%27ing introphone.h... Moc%27ing introphone.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1708,7 +1739,7 @@ Moc%27ing introsignup.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introsignup.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introsignup.h" Moc%27ing introsignup.h... Moc%27ing introsignup.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1727,7 +1758,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing intropwdcheck.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/intropwdcheck.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/intropwdcheck.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing intropwdcheck.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1737,7 +1768,7 @@ Moc%27ing layerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/layerwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/layerwidget.h" Moc%27ing layerwidget.h... Moc%27ing layerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1751,7 +1782,7 @@ Moc%27ing localimageloader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localimageloader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localimageloader.h" Moc%27ing localimageloader.h... Moc%27ing localimageloader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1772,7 +1803,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing localstorage.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localstorage.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localstorage.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing localstorage.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1802,7 +1833,7 @@ Moc%27ing mtpConnection.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpConnection.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpConnection.h" Moc%27ing mtpConnection.h... Moc%27ing mtpConnection.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1816,7 +1847,7 @@ Moc%27ing mainwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mainwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mainwidget.h" Moc%27ing mainwidget.h... Moc%27ing mainwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1830,7 +1861,7 @@ Moc%27ing mtp.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtp.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtp.h" Moc%27ing mtp.h... Moc%27ing mtp.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1849,7 +1880,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mediaview.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mediaview.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1859,7 +1890,7 @@ Moc%27ing mtpFileLoader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpFileLoader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpFileLoader.h" Moc%27ing mtpFileLoader.h... Moc%27ing mtpFileLoader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1875,7 +1906,7 @@ Moc%27ing mtpDC.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpDC.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpDC.h" Moc%27ing mtpDC.h... Moc%27ing mtpDC.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1891,7 +1922,7 @@ Moc%27ing mtpSession.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpSession.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpSession.h" Moc%27ing mtpSession.h... Moc%27ing mtpSession.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1905,7 +1936,7 @@ Moc%27ing settingswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/settingswidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/settingswidget.h" Moc%27ing settingswidget.h... Moc%27ing settingswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1919,7 +1950,7 @@ Moc%27ing profilewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/profilewidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/profilewidget.h" Moc%27ing profilewidget.h... Moc%27ing profilewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1930,19 +1961,19 @@ $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) - - Moc%27ing pspecific_wnd.h... + + Moc%27ing pspecific_win.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_wnd.h" - Moc%27ing pspecific_wnd.h... - Moc%27ing pspecific_wnd.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_win.h" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + Moc%27ing pspecific_win.h... + Moc%27ing pspecific_win.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_wnd.h" - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_wnd.h" - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_win.h" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_win.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) @@ -1953,7 +1984,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing overviewwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/overviewwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/overviewwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing overviewwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1967,7 +1998,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/passcodewidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/passcodewidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1981,7 +2012,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/playerwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/playerwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1997,7 +2028,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_linux.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_linux.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_linux.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_linux.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2014,7 +2045,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_mac.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_mac.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_mac.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_mac.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2053,7 +2084,7 @@ Moc%27ing sysbuttons.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/sysbuttons.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/sysbuttons.h" Moc%27ing sysbuttons.h... Moc%27ing sysbuttons.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2067,7 +2098,7 @@ Moc%27ing title.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/title.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/title.h" Moc%27ing title.h... Moc%27ing title.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index a0da01041..b1fff4cc4 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -165,9 +165,6 @@ gui - - Source Files - Source Files @@ -285,15 +282,6 @@ Generated Files\Release - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - Generated Files\Deploy @@ -909,6 +897,30 @@ intro + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + Source Files + + + Source Files + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + @@ -1084,9 +1096,6 @@ gui - - Source Files - Source Files @@ -1234,6 +1243,12 @@ intro + + Source Files + + + Source Files + diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index 961347559..ad9983289 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -125,7 +125,8 @@ GeneratedFiles/Debug/moc_application.cpp: ../../Libraries/QtStatic/qtbase/includ SourceFiles/pspecific.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QMainWindow \ SourceFiles/pspecific_mac.h \ - SourceFiles/pspecific_wnd.h \ + SourceFiles/pspecific_win.h \ + SourceFiles/pspecific_winrt.h \ SourceFiles/gui/boxshadow.h \ SourceFiles/application.h /usr/local/Qt-5.5.1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -I/usr/local/Qt-5.5.1/mkspecs/macx-clang -I. -I/usr/local/Qt-5.5.1/include/QtGui/5.5.1/QtGui -I/usr/local/Qt-5.5.1/include/QtCore/5.5.1/QtCore -I/usr/local/Qt-5.5.1/include -I./SourceFiles -I./GeneratedFiles -I../../Libraries/lzma/C -I../../Libraries/libexif-0.6.20 -I/usr/local/Qt-5.5.1/include -I/usr/local/Qt-5.5.1/include/QtMultimedia -I/usr/local/Qt-5.5.1/include/QtWidgets -I/usr/local/Qt-5.5.1/include/QtNetwork -I/usr/local/Qt-5.5.1/include/QtGui -I/usr/local/Qt-5.5.1/include/QtCore -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/backward -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.1/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include SourceFiles/application.h -o GeneratedFiles/Debug/moc_application.cpp @@ -284,7 +285,8 @@ GeneratedFiles/Debug/moc_window.cpp: SourceFiles/title.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QMainWindow \ ../../Libraries/QtStatic/qtbase/include/QtNetwork/QNetworkReply \ SourceFiles/pspecific_mac.h \ - SourceFiles/pspecific_wnd.h \ + SourceFiles/pspecific_win.h \ + SourceFiles/pspecific_winrt.h \ SourceFiles/passcodewidget.h \ SourceFiles/gui/boxshadow.h \ SourceFiles/window.h From 27856d830ba734750d4076bad594eee88b378b66 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 20 Mar 2016 18:08:13 +0300 Subject: [PATCH 08/10] using operator new/delete instead of malloc/free --- Telegram/SourceFiles/logs.cpp | 2 +- Telegram/SourceFiles/types.h | 4 +- Telegram/Telegram.vcxproj | 132 +++++++++++++++++----------------- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index d4ba079b2..612eebff1 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -1044,7 +1044,7 @@ namespace SignalHandlers { void finish() { #ifndef TDESKTOP_DISABLE_CRASH_REPORTS - FinishBreakpad(); + FinishCrashHandler(); if (CrashDumpFile) { fclose(CrashDumpFile); CrashDumpFile = nullptr; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index b630a481e..4ec1d299c 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -663,7 +663,7 @@ public: if (mask) { const InterfacesMetadata *meta = GetInterfacesMetadata(mask); int32 size = sizeof(const InterfacesMetadata *) + meta->size; - void *data = malloc(size); + void *data = operator new(size); if (!data) { // terminate if we can't allocate memory throw "Can't allocate memory!"; } @@ -719,7 +719,7 @@ public: InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); } } - free(_data); + operator delete(_data); } } diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index c3b16f57e..f6d50ce38 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -68,7 +68,7 @@ - TDESKTOP_DISABLE_CRASH_REPORTS;AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl_debug\Debug\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\..\..\Libraries\breakpad\src;.\ThirdParty\minizip;.\SourceFiles;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase false @@ -1086,7 +1086,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_winrt.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_winrt.h" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_winrt.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_winrt.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1105,7 +1105,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/types.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/types.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1114,7 +1114,7 @@ Moc%27ing window.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/window.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/window.h" Moc%27ing window.h... Moc%27ing window.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1146,7 +1146,7 @@ Moc%27ing application.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/application.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/application.h" Moc%27ing application.h... Moc%27ing application.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1169,7 +1169,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing apiwrap.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/apiwrap.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/apiwrap.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing apiwrap.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1179,7 +1179,7 @@ Moc%27ing aboutbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/aboutbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/aboutbox.h" Moc%27ing aboutbox.h... Moc%27ing aboutbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1193,7 +1193,7 @@ Moc%27ing addcontactbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/addcontactbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/addcontactbox.h" Moc%27ing addcontactbox.h... Moc%27ing addcontactbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1207,7 +1207,7 @@ Moc%27ing confirmbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/confirmbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/confirmbox.h" Moc%27ing confirmbox.h... Moc%27ing confirmbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1221,7 +1221,7 @@ Moc%27ing connectionbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/connectionbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/connectionbox.h" Moc%27ing connectionbox.h... Moc%27ing connectionbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1235,7 +1235,7 @@ Moc%27ing contactsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/contactsbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/contactsbox.h" Moc%27ing contactsbox.h... Moc%27ing contactsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1249,7 +1249,7 @@ Moc%27ing photocropbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photocropbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photocropbox.h" Moc%27ing photocropbox.h... Moc%27ing photocropbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1263,7 +1263,7 @@ Moc%27ing photosendbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photosendbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/photosendbox.h" Moc%27ing photosendbox.h... Moc%27ing photosendbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1277,7 +1277,7 @@ Moc%27ing emojibox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/emojibox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/emojibox.h" Moc%27ing emojibox.h... Moc%27ing emojibox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1291,7 +1291,7 @@ Moc%27ing downloadpathbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/downloadpathbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/downloadpathbox.h" Moc%27ing downloadpathbox.h... Moc%27ing downloadpathbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1310,7 +1310,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing audio.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/audio.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/audio.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing audio.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1324,7 +1324,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/usernamebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/usernamebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1338,7 +1338,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/languagebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1352,7 +1352,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/backgroundbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/backgroundbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1366,7 +1366,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/autolockbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/autolockbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1380,7 +1380,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/passcodebox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/passcodebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1394,7 +1394,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/sessionsbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/sessionsbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1408,7 +1408,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/abstractbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/abstractbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1422,7 +1422,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/stickersetbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/boxes/stickersetbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1436,7 +1436,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/autoupdater.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/autoupdater.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1446,7 +1446,7 @@ Moc%27ing animation.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/animation.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/animation.h" Moc%27ing animation.h... Moc%27ing animation.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1460,7 +1460,7 @@ Moc%27ing button.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/button.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/button.h" Moc%27ing button.h... Moc%27ing button.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1474,7 +1474,7 @@ Moc%27ing flatbutton.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatbutton.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatbutton.h" Moc%27ing flatbutton.h... Moc%27ing flatbutton.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1488,7 +1488,7 @@ Moc%27ing flatinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatinput.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatinput.h" Moc%27ing flatinput.h... Moc%27ing flatinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1502,7 +1502,7 @@ Moc%27ing countryinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/countryinput.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/countryinput.h" Moc%27ing countryinput.h... Moc%27ing countryinput.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1517,7 +1517,7 @@ Moc%27ing scrollarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/scrollarea.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/scrollarea.h" Moc%27ing scrollarea.h... Moc%27ing scrollarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1531,7 +1531,7 @@ Moc%27ing dialogswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dialogswidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dialogswidget.h" Moc%27ing dialogswidget.h... Moc%27ing dialogswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1545,7 +1545,7 @@ Moc%27ing flattextarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flattextarea.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flattextarea.h" Moc%27ing flattextarea.h... Moc%27ing flattextarea.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1559,7 +1559,7 @@ Moc%27ing fileuploader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/fileuploader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/fileuploader.h" Moc%27ing fileuploader.h... Moc%27ing fileuploader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1573,7 +1573,7 @@ Moc%27ing dropdown.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dropdown.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/dropdown.h" Moc%27ing dropdown.h... Moc%27ing dropdown.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1594,7 +1594,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing popupmenu.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing popupmenu.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1604,7 +1604,7 @@ Moc%27ing flatcheckbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatcheckbox.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatcheckbox.h" Moc%27ing flatcheckbox.h... Moc%27ing flatcheckbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1639,7 +1639,7 @@ Moc%27ing flatlabel.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatlabel.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/flatlabel.h" Moc%27ing flatlabel.h... Moc%27ing flatlabel.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1653,7 +1653,7 @@ Moc%27ing twidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/twidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/gui/twidget.h" Moc%27ing twidget.h... Moc%27ing twidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1672,7 +1672,7 @@ "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -DQT_NO_DEBUG -DNDEBUG -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl\Release\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/history.h" @@ -1683,7 +1683,7 @@ Moc%27ing historywidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/historywidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/historywidget.h" Moc%27ing historywidget.h... Moc%27ing historywidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1697,7 +1697,7 @@ Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introwidget.h" Moc%27ing introwidget.h... Moc%27ing introwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1711,7 +1711,7 @@ Moc%27ing introcode.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introcode.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introcode.h" Moc%27ing introcode.h... Moc%27ing introcode.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1725,7 +1725,7 @@ Moc%27ing introphone.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introphone.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introphone.h" Moc%27ing introphone.h... Moc%27ing introphone.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1739,7 +1739,7 @@ Moc%27ing introsignup.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introsignup.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/introsignup.h" Moc%27ing introsignup.h... Moc%27ing introsignup.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1758,7 +1758,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing intropwdcheck.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/intropwdcheck.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/intro/intropwdcheck.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing intropwdcheck.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1768,7 +1768,7 @@ Moc%27ing layerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/layerwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/layerwidget.h" Moc%27ing layerwidget.h... Moc%27ing layerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1782,7 +1782,7 @@ Moc%27ing localimageloader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localimageloader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localimageloader.h" Moc%27ing localimageloader.h... Moc%27ing localimageloader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1803,7 +1803,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing localstorage.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localstorage.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/localstorage.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing localstorage.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1833,7 +1833,7 @@ Moc%27ing mtpConnection.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpConnection.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpConnection.h" Moc%27ing mtpConnection.h... Moc%27ing mtpConnection.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1847,7 +1847,7 @@ Moc%27ing mainwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mainwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mainwidget.h" Moc%27ing mainwidget.h... Moc%27ing mainwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1861,7 +1861,7 @@ Moc%27ing mtp.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtp.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtp.h" Moc%27ing mtp.h... Moc%27ing mtp.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1880,7 +1880,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mediaview.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mediaview.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1890,7 +1890,7 @@ Moc%27ing mtpFileLoader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpFileLoader.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpFileLoader.h" Moc%27ing mtpFileLoader.h... Moc%27ing mtpFileLoader.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1906,7 +1906,7 @@ Moc%27ing mtpDC.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpDC.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpDC.h" Moc%27ing mtpDC.h... Moc%27ing mtpDC.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1922,7 +1922,7 @@ Moc%27ing mtpSession.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpSession.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/mtproto/mtpSession.h" Moc%27ing mtpSession.h... Moc%27ing mtpSession.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1936,7 +1936,7 @@ Moc%27ing settingswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/settingswidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/settingswidget.h" Moc%27ing settingswidget.h... Moc%27ing settingswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1950,7 +1950,7 @@ Moc%27ing profilewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/profilewidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/profilewidget.h" Moc%27ing profilewidget.h... Moc%27ing profilewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1964,7 +1964,7 @@ Moc%27ing pspecific_win.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/pspecific_win.h" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_win.h" Moc%27ing pspecific_win.h... Moc%27ing pspecific_win.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1984,7 +1984,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing overviewwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/overviewwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/overviewwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing overviewwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1998,7 +1998,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/passcodewidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/passcodewidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2012,7 +2012,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/playerwidget.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/playerwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2028,7 +2028,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_linux.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_linux.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_linux.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_linux.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2045,7 +2045,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_mac.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_mac.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/pspecific_mac.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_mac.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2084,7 +2084,7 @@ Moc%27ing sysbuttons.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/sysbuttons.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/sysbuttons.h" Moc%27ing sysbuttons.h... Moc%27ing sysbuttons.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2098,7 +2098,7 @@ Moc%27ing title.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DTDESKTOP_DISABLE_CRASH_REPORTS -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/title.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore" "-I.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui" "-fstdafx.h" "-f../../SourceFiles/title.h" Moc%27ing title.h... Moc%27ing title.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp From a2f5acdff11c0dd7418269fcc96e0d8d57ef33ba Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 20 Mar 2016 21:34:20 +0300 Subject: [PATCH 09/10] some winrt macro changes --- Telegram/SourceFiles/boxes/aboutbox.cpp | 6 + Telegram/SourceFiles/gui/filedialog.cpp | 6 +- Telegram/SourceFiles/gui/text.cpp | 5 +- Telegram/SourceFiles/main.cpp | 4 + Telegram/SourceFiles/pspecific_winrt.cpp | 4606 ++++++++++------------ Telegram/SourceFiles/pspecific_winrt.h | 3 +- Telegram/SourceFiles/stdafx.cpp | 9 +- Telegram/SourceFiles/stdafx.h | 13 +- Telegram/SourceFiles/window.cpp | 12 +- Telegram/SourceFiles/window.h | 6 +- 10 files changed, 2059 insertions(+), 2611 deletions(-) diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index 913465e84..87e01f6a3 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -107,6 +107,7 @@ void AboutBox::paintEvent(QPaintEvent *e) { paintTitle(p, qsl("Telegram Desktop")); } +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS QString _getCrashReportFile(const QMimeData *m) { if (!m || m->urls().size() != 1) return QString(); @@ -115,19 +116,24 @@ QString _getCrashReportFile(const QMimeData *m) { return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); } +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS void AboutBox::dragEnterEvent(QDragEnterEvent *e) { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS if (!_getCrashReportFile(e->mimeData()).isEmpty()) { e->setDropAction(Qt::CopyAction); e->accept(); } +#endif } void AboutBox::dropEvent(QDropEvent *e) { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS if (!_getCrashReportFile(e->mimeData()).isEmpty()) { e->acceptProposedAction(); showCrashReportWindow(_getCrashReportFile(e->mimeData())); } +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS } QString telegramFaqLink() { diff --git a/Telegram/SourceFiles/gui/filedialog.cpp b/Telegram/SourceFiles/gui/filedialog.cpp index b606613d0..50684f661 100644 --- a/Telegram/SourceFiles/gui/filedialog.cpp +++ b/Telegram/SourceFiles/gui/filedialog.cpp @@ -149,7 +149,7 @@ bool _filedialogGetFiles(QStringList &files, QByteArray &remoteContent, const QS cSetDialogLastPath(path); Local::writeUserSettings(); } - + if (res == QDialog::Accepted) { if (multipleFiles > 0) { files = dialog.selectedFiles(); @@ -157,9 +157,9 @@ bool _filedialogGetFiles(QStringList &files, QByteArray &remoteContent, const QS files = dialog.selectedFiles().mid(0, 1); } if (multipleFiles >= 0) { -#ifdef Q_OS_WIN +#if defined Q_OS_WIN && !defined Q_OS_WINRT remoteContent = dialog.selectedRemoteContent(); -#endif +#endif // Q_OS_WIN && !Q_OS_WINRT } return true; } diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 000c239bd..da7e31e60 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -1654,6 +1654,7 @@ public: *_getSymbolUpon = true; return false; } else if (_p) { +#ifndef TDESKTOP_WINRT // temp QTextCharFormat format; QTextItemInt gf(glyphs.mid(glyphsStart, glyphsEnd - glyphsStart), &_e->fnt, engine.layoutData->string.unicode() + itemStart, @@ -1662,7 +1663,7 @@ public: gf.width = itemWidth; gf.justified = false; gf.initWithScriptItem(si); - +#endif // !TDESKTOP_WINRT if (_localFrom + itemStart < _selectedTo && _localFrom + itemEnd > _selectedFrom) { QFixed selX = x, selWidth = itemWidth; if (_localFrom + itemEnd > _selectedTo || _localFrom + itemStart < _selectedFrom) { @@ -1703,7 +1704,9 @@ public: _p->fillRect(QRectF(selX.toReal(), _y + _yDelta, selWidth.toReal(), _fontHeight), _textStyle->selectBg->b); } +#ifndef TDESKTOP_WINRT // temp _p->drawTextItem(QPointF(x.toReal(), textY), gf); +#endif // !TDESKTOP_WINRT } x += itemWidth; diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index b79c0f7ad..85096528f 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -30,8 +30,10 @@ int main(int argc, char *argv[]) { return psFixPrevious(); } else if (cLaunchMode() == LaunchModeCleanup) { return psCleanup(); +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS } else if (cLaunchMode() == LaunchModeShowCrash) { return showCrashReportWindow(QFileInfo(cStartUrl()).absoluteFilePath()); +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS } // both are finished in Application::closeApplication @@ -72,4 +74,6 @@ int main(int argc, char *argv[]) { SignalHandlers::finish(); PlatformSpecific::finish(); Logs::finish(); + + return result; } diff --git a/Telegram/SourceFiles/pspecific_winrt.cpp b/Telegram/SourceFiles/pspecific_winrt.cpp index 72adf5222..ae9f029a4 100644 --- a/Telegram/SourceFiles/pspecific_winrt.cpp +++ b/Telegram/SourceFiles/pspecific_winrt.cpp @@ -29,35 +29,35 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "passcodewidget.h" -#include +//#include #include -#include -#include -#include -#include +//#include +//#include +//#include +//#include -#pragma warning(push) -#pragma warning(disable:4091) -#include -#include -#pragma warning(pop) +//#pragma warning(push) +//#pragma warning(disable:4091) +//#include +//#include +//#pragma warning(pop) -#include -#include -#include -#include +//#include +//#include +//#include +//#include -#include +//#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include #include @@ -86,10 +86,10 @@ const WCHAR *AppUserModelId() { static const PROPERTYKEY pkey_AppUserModel_ID = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 5 }; static const PROPERTYKEY pkey_AppUserModel_StartPinOption = { { 0x9F4C2855, 0x9F79, 0x4B39, { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3 } }, 12 }; -using namespace Microsoft::WRL; -using namespace ABI::Windows::UI::Notifications; -using namespace ABI::Windows::Data::Xml::Dom; -using namespace Windows::Foundation; +//using namespace Microsoft::WRL; +//using namespace ABI::Windows::UI::Notifications; +//using namespace ABI::Windows::Data::Xml::Dom; +//using namespace Windows::Foundation; namespace { QStringList _initLogs; @@ -111,610 +111,610 @@ namespace { UINT tbCreatedMsgId = 0; - ComPtr taskbarList; - - ComPtr toastNotificationManager; - ComPtr toastNotifier; - ComPtr toastNotificationFactory; - struct ToastNotificationPtr { - ToastNotificationPtr() { - } - ToastNotificationPtr(const ComPtr &ptr) : p(ptr) { - } - ComPtr p; - }; - typedef QMap > ToastNotifications; - ToastNotifications toastNotifications; - struct ToastImage { - uint64 until; - QString path; - }; - typedef QMap ToastImages; - ToastImages toastImages; - bool ToastImageSavedFlag = false; - - HWND createTaskbarHider() { - HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); - HWND hWnd = 0; - - QString cn = QString("TelegramTaskbarHider"); - LPCWSTR _cn = (LPCWSTR)cn.utf16(); - WNDCLASSEX wc; - - wc.cbSize = sizeof(wc); - wc.style = 0; - wc.lpfnWndProc = DefWindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = appinst; - wc.hIcon = 0; - wc.hCursor = 0; - wc.hbrBackground = 0; - wc.lpszMenuName = NULL; - wc.lpszClassName = _cn; - wc.hIconSm = 0; - if (!RegisterClassEx(&wc)) { - DEBUG_LOG(("Application Error: could not register taskbar hider window class, error: %1").arg(GetLastError())); - return hWnd; - } - - hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); - if (!hWnd) { - DEBUG_LOG(("Application Error: could not create taskbar hider window class, error: %1").arg(GetLastError())); - return hWnd; - } - return hWnd; - } - - enum { - _PsShadowMoved = 0x01, - _PsShadowResized = 0x02, - _PsShadowShown = 0x04, - _PsShadowHidden = 0x08, - _PsShadowActivate = 0x10, - }; - - enum { - _PsInitHor = 0x01, - _PsInitVer = 0x02, - }; - - int32 _psSize = 0; - class _PsShadowWindows { - public: - - _PsShadowWindows() : screenDC(0), max_w(0), max_h(0), _x(0), _y(0), _w(0), _h(0), hidden(true), r(0), g(0), b(0), noKeyColor(RGB(255, 255, 255)) { - for (int i = 0; i < 4; ++i) { - dcs[i] = 0; - bitmaps[i] = 0; - hwnds[i] = 0; - } - } - - void setColor(QColor c) { - r = c.red(); - g = c.green(); - b = c.blue(); - - if (!hwnds[0]) return; - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - for (int i = 0; i < 4; ++i) { - Gdiplus::Graphics graphics(dcs[i]); - graphics.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - if ((i % 2) && _h || !(i % 2) && _w) { - graphics.FillRectangle(&brush, 0, 0, (i % 2) ? _size : _w, (i % 2) ? _h : _size); - } - } - initCorners(); - - _x = _y = _w = _h = 0; - update(_PsShadowMoved | _PsShadowResized); - } - - bool init(QColor c) { - style::rect topLeft = st::wndShadow; - _fullsize = topLeft.width(); - _shift = st::wndShadowShift; - QImage cornersImage(_fullsize, _fullsize, QImage::Format_ARGB32_Premultiplied); - { - QPainter p(&cornersImage); - p.drawPixmap(QPoint(0, 0), App::sprite(), topLeft); - } - if (rtl()) cornersImage = cornersImage.mirrored(true, false); - uchar *bits = cornersImage.bits(); - if (bits) { - for ( - quint32 *p = (quint32*)bits, *end = (quint32*)(bits + cornersImage.byteCount()); - p < end; - ++p - ) { - *p = (*p ^ 0x00ffffff) << 24; - } - } - - _metaSize = _fullsize + 2 * _shift; - _alphas.reserve(_metaSize); - _colors.reserve(_metaSize * _metaSize); - for (int32 j = 0; j < _metaSize; ++j) { - for (int32 i = 0; i < _metaSize; ++i) { - _colors.push_back((i < 2 * _shift || j < 2 * _shift) ? 1 : qMax(BYTE(1), BYTE(cornersImage.pixel(QPoint(i - 2 * _shift, j - 2 * _shift)) >> 24))); - } - } - uchar prev = 0; - for (int32 i = 0; i < _metaSize; ++i) { - uchar a = _colors[(_metaSize - 1) * _metaSize + i]; - if (a < prev) break; - - _alphas.push_back(a); - prev = a; - } - _psSize = _size = _alphas.size() - 2 * _shift; - - setColor(c); - - Gdiplus::GdiplusStartupInput gdiplusStartupInput; - ULONG_PTR gdiplusToken; - Gdiplus::Status gdiRes = Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); - - if (gdiRes != Gdiplus::Ok) { - LOG(("Application Error: could not init GDI+, error: %1").arg((int)gdiRes)); - return false; - } - blend.AlphaFormat = AC_SRC_ALPHA; - blend.SourceConstantAlpha = 255; - blend.BlendFlags = 0; - blend.BlendOp = AC_SRC_OVER; - - screenDC = GetDC(0); - if (!screenDC) { - LOG(("Application Error: could not GetDC(0), error: %2").arg(GetLastError())); - return false; - } - - QRect avail(Sandbox::availableGeometry()); - max_w = avail.width(); - if (max_w < st::wndMinWidth) max_w = st::wndMinWidth; - max_h = avail.height(); - if (max_h < st::wndMinHeight) max_h = st::wndMinHeight; - - HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); - HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; - - for (int i = 0; i < 4; ++i) { - QString cn = QString("TelegramShadow%1").arg(i); - LPCWSTR _cn = (LPCWSTR)cn.utf16(); - WNDCLASSEX wc; - - wc.cbSize = sizeof(wc); - wc.style = 0; - wc.lpfnWndProc = wndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = appinst; - wc.hIcon = 0; - wc.hCursor = 0; - wc.hbrBackground = 0; - wc.lpszMenuName = NULL; - wc.lpszClassName = _cn; - wc.hIconSm = 0; - if (!RegisterClassEx(&wc)) { - LOG(("Application Error: could not register shadow window class %1, error: %2").arg(i).arg(GetLastError())); - destroy(); - return false; - } - - hwnds[i] = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); - if (!hwnds[i]) { - LOG(("Application Error: could not create shadow window class %1, error: %2").arg(i).arg(GetLastError())); - destroy(); - return false; - } - SetWindowLong(hwnds[i], GWL_HWNDPARENT, (LONG)hwnd); - - dcs[i] = CreateCompatibleDC(screenDC); - if (!dcs[i]) { - LOG(("Application Error: could not create dc for shadow window class %1, error: %2").arg(i).arg(GetLastError())); - destroy(); - return false; - } - - bitmaps[i] = CreateCompatibleBitmap(screenDC, (i % 2) ? _size : max_w, (i % 2) ? max_h : _size); - if (!bitmaps[i]) { - LOG(("Application Error: could not create bitmap for shadow window class %1, error: %2").arg(i).arg(GetLastError())); - destroy(); - return false; - } - - SelectObject(dcs[i], bitmaps[i]); - } - - initCorners(); - return true; - } - - void initCorners(int directions = (_PsInitHor | _PsInitVer)) { - bool hor = (directions & _PsInitHor), ver = (directions & _PsInitVer); - Gdiplus::Graphics graphics0(dcs[0]), graphics1(dcs[1]), graphics2(dcs[2]), graphics3(dcs[3]); - graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - if (hor) graphics0.FillRectangle(&brush, 0, 0, _fullsize - (_size - _shift), 2 * _shift); - - if (ver) { - graphics1.FillRectangle(&brush, 0, 0, _size, 2 * _shift); - graphics3.FillRectangle(&brush, 0, 0, _size, 2 * _shift); - graphics1.FillRectangle(&brush, _size - _shift, 2 * _shift, _shift, _fullsize); - graphics3.FillRectangle(&brush, 0, 2 * _shift, _shift, _fullsize); - } - - if (hor) { - for (int j = 2 * _shift; j < _size; ++j) { - for (int k = 0; k < _fullsize - (_size - _shift); ++k) { - brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); - graphics0.FillRectangle(&brush, k, j, 1, 1); - graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); - } - } - for (int j = _size; j < _size + 2 * _shift; ++j) { - for (int k = 0; k < _fullsize - (_size - _shift); ++k) { - brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); - graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); - } - } - } - if (ver) { - for (int j = 2 * _shift; j < _fullsize + 2 * _shift; ++j) { - for (int k = _shift; k < _size; ++k) { - brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + (k + _shift)], r, g, b)); - graphics1.FillRectangle(&brush, _size - k - 1, j, 1, 1); - graphics3.FillRectangle(&brush, k, j, 1, 1); - } - } - } - } - void verCorners(int h, Gdiplus::Graphics *pgraphics1, Gdiplus::Graphics *pgraphics3) { - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - pgraphics1->FillRectangle(&brush, _size - _shift, h - _fullsize, _shift, _fullsize); - pgraphics3->FillRectangle(&brush, 0, h - _fullsize, _shift, _fullsize); - for (int j = 0; j < _fullsize; ++j) { - for (int k = _shift; k < _size; ++k) { - brush.SetColor(Gdiplus::Color(_colors[(j + 2 * _shift) * _metaSize + k + _shift], r, g, b)); - pgraphics1->FillRectangle(&brush, _size - k - 1, h - j - 1, 1, 1); - pgraphics3->FillRectangle(&brush, k, h - j - 1, 1, 1); - } - } - } - void horCorners(int w, Gdiplus::Graphics *pgraphics0, Gdiplus::Graphics *pgraphics2) { - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - pgraphics0->FillRectangle(&brush, w - 2 * _size - (_fullsize - (_size - _shift)), 0, _fullsize - (_size - _shift), 2 * _shift); - for (int j = 2 * _shift; j < _size; ++j) { - for (int k = 0; k < _fullsize - (_size - _shift); ++k) { - brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); - pgraphics0->FillRectangle(&brush, w - 2 * _size - k - 1, j, 1, 1); - pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); - } - } - for (int j = _size; j < _size + 2 * _shift; ++j) { - for (int k = 0; k < _fullsize - (_size - _shift); ++k) { - brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); - pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); - } - } - } - - void update(int changes, WINDOWPOS *pos = 0) { - HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; - if (!hwnd || !hwnds[0]) return; - - if (changes == _PsShadowActivate) { - for (int i = 0; i < 4; ++i) { - SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - } - return; - } - - if (changes & _PsShadowHidden) { - if (!hidden) { - for (int i = 0; i < 4; ++i) { - hidden = true; - ShowWindow(hwnds[i], SW_HIDE); - } - } - return; - } - if (!App::wnd()->psPosInited()) return; - - int x = _x, y = _y, w = _w, h = _h; - if (pos && (!(pos->flags & SWP_NOMOVE) || !(pos->flags & SWP_NOSIZE) || !(pos->flags & SWP_NOREPOSITION))) { - if (!(pos->flags & SWP_NOMOVE)) { - x = pos->x - _size; - y = pos->y - _size; - } else if (pos->flags & SWP_NOSIZE) { - for (int i = 0; i < 4; ++i) { - SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - } - return; - } - if (!(pos->flags & SWP_NOSIZE)) { - w = pos->cx + 2 * _size; - h = pos->cy + 2 * _size; - } - } else { - RECT r; - GetWindowRect(hwnd, &r); - x = r.left - _size; - y = r.top - _size; - w = r.right + _size - x; - h = r.bottom + _size - y; - } - if (h < 2 * _fullsize + 2 * _shift) { - h = 2 * _fullsize + 2 * _shift; - } - if (w < 2 * (_fullsize + _shift)) { - w = 2 * (_fullsize + _shift); - } - - if (w != _w) { - int from = (_w > 2 * (_fullsize + _shift)) ? (_w - _size - _fullsize - _shift) : (_fullsize - (_size - _shift)); - int to = w - _size - _fullsize - _shift; - if (w > max_w) { - from = _fullsize - (_size - _shift); - max_w *= 2; - for (int i = 0; i < 4; i += 2) { - DeleteObject(bitmaps[i]); - bitmaps[i] = CreateCompatibleBitmap(screenDC, max_w, _size); - SelectObject(dcs[i], bitmaps[i]); - } - initCorners(_PsInitHor); - } - Gdiplus::Graphics graphics0(dcs[0]), graphics2(dcs[2]); - graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - if (to > from) { - graphics0.FillRectangle(&brush, from, 0, to - from, 2 * _shift); - for (int i = 2 * _shift; i < _size; ++i) { - Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); - graphics0.DrawLine(&pen, from, i, to, i); - graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); - } - for (int i = _size; i < _size + 2 * _shift; ++i) { - Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); - graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); - } - } - if (_w > w) { - graphics0.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); - graphics2.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); - } - horCorners(w, &graphics0, &graphics2); - POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }, f = { 0, 0 }; - SIZE s = { w - 2 * _size, _size }; - updateWindow(0, &p0, &s); - updateWindow(2, &p2, &s); - } else if (x != _x || y != _y) { - POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }; - updateWindow(0, &p0); - updateWindow(2, &p2); - } else if (h != _h) { - POINT p2 = { x + _size, y + h - _size }; - updateWindow(2, &p2); - } - - if (h != _h) { - int from = (_h > 2 * _fullsize + 2 * _shift) ? (_h - _fullsize) : (_fullsize + 2 * _shift); - int to = h - _fullsize; - if (h > max_h) { - from = (_fullsize + 2 * _shift); - max_h *= 2; - for (int i = 1; i < 4; i += 2) { - DeleteObject(bitmaps[i]); - bitmaps[i] = CreateCompatibleBitmap(dcs[i], _size, max_h); - SelectObject(dcs[i], bitmaps[i]); - } - initCorners(_PsInitVer); - } - Gdiplus::Graphics graphics1(dcs[1]), graphics3(dcs[3]); - graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); - - Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); - if (to > from) { - graphics1.FillRectangle(&brush, _size - _shift, from, _shift, to - from); - graphics3.FillRectangle(&brush, 0, from, _shift, to - from); - for (int i = 2 * _shift; i < _size + _shift; ++i) { - Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); - graphics1.DrawLine(&pen, _size + _shift - i - 1, from, _size + _shift - i - 1, to); - graphics3.DrawLine(&pen, i - _shift, from, i - _shift, to); - } - } - if (_h > h) { - graphics1.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); - graphics3.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); - } - verCorners(h, &graphics1, &graphics3); - - POINT p1 = {x + w - _size, y}, p3 = {x, y}, f = {0, 0}; - SIZE s = { _size, h }; - updateWindow(1, &p1, &s); - updateWindow(3, &p3, &s); - } else if (x != _x || y != _y) { - POINT p1 = { x + w - _size, y }, p3 = { x, y }; - updateWindow(1, &p1); - updateWindow(3, &p3); - } else if (w != _w) { - POINT p1 = { x + w - _size, y }; - updateWindow(1, &p1); - } - _x = x; - _y = y; - _w = w; - _h = h; - - if (hidden && (changes & _PsShadowShown)) { - for (int i = 0; i < 4; ++i) { - SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOACTIVATE); - } - hidden = false; - } - } - - void updateWindow(int i, POINT *p, SIZE *s = 0) { - static POINT f = {0, 0}; - if (s) { - UpdateLayeredWindow(hwnds[i], (s ? screenDC : 0), p, s, (s ? dcs[i] : 0), (s ? (&f) : 0), noKeyColor, &blend, ULW_ALPHA); - } else { - SetWindowPos(hwnds[i], 0, p->x, p->y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER); - } - } - - void destroy() { - for (int i = 0; i < 4; ++i) { - if (dcs[i]) DeleteDC(dcs[i]); - if (bitmaps[i]) DeleteObject(bitmaps[i]); - if (hwnds[i]) DestroyWindow(hwnds[i]); - dcs[i] = 0; - bitmaps[i] = 0; - hwnds[i] = 0; - } - if (screenDC) ReleaseDC(0, screenDC); - } - - private: - - int _x, _y, _w, _h; - int _metaSize, _fullsize, _size, _shift; - QVector _alphas, _colors; - - bool hidden; - - HWND hwnds[4]; - HDC dcs[4], screenDC; - HBITMAP bitmaps[4]; - int max_w, max_h; - BLENDFUNCTION blend; - - BYTE r, g, b; - COLORREF noKeyColor; - - static LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - - }; - _PsShadowWindows _psShadowWindows; - - LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - if (finished) return DefWindowProc(hwnd, msg, wParam, lParam); - - int i; - for (i = 0; i < 4; ++i) { - if (_psShadowWindows.hwnds[i] && hwnd == _psShadowWindows.hwnds[i]) { - break; - } - } - if (i == 4) return DefWindowProc(hwnd, msg, wParam, lParam); - - switch (msg) { - case WM_CLOSE: - App::wnd()->close(); - break; - - case WM_NCHITTEST: { - int32 xPos = GET_X_LPARAM(lParam), yPos = GET_Y_LPARAM(lParam); - switch (i) { - case 0: return HTTOP; - case 1: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPRIGHT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMRIGHT : HTRIGHT); - case 2: return HTBOTTOM; - case 3: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPLEFT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMLEFT : HTLEFT); - } - return HTTRANSPARENT; - } break; - - case WM_NCACTIVATE: return DefWindowProc(hwnd, msg, wParam, lParam); - case WM_NCLBUTTONDOWN: - case WM_NCLBUTTONUP: - case WM_NCLBUTTONDBLCLK: - case WM_NCMBUTTONDOWN: - case WM_NCMBUTTONUP: - case WM_NCMBUTTONDBLCLK: - case WM_NCRBUTTONDOWN: - case WM_NCRBUTTONUP: - case WM_NCRBUTTONDBLCLK: - case WM_NCXBUTTONDOWN: - case WM_NCXBUTTONUP: - case WM_NCXBUTTONDBLCLK: - case WM_NCMOUSEHOVER: - case WM_NCMOUSELEAVE: - case WM_NCMOUSEMOVE: - case WM_NCPOINTERUPDATE: - case WM_NCPOINTERDOWN: - case WM_NCPOINTERUP: - if (App::wnd() && App::wnd()->psHwnd()) { - if (msg == WM_NCLBUTTONDOWN) { - ::SetForegroundWindow(App::wnd()->psHwnd()); - } - LRESULT res = SendMessage(App::wnd()->psHwnd(), msg, wParam, lParam); - return res; - } - return 0; - break; - case WM_ACTIVATE: - if (App::wnd() && App::wnd()->psHwnd() && wParam == WA_ACTIVE) { - if ((HWND)lParam != App::wnd()->psHwnd()) { - ::SetForegroundWindow(hwnd); - ::SetWindowPos(App::wnd()->psHwnd(), hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - } - } - return DefWindowProc(hwnd, msg, wParam, lParam); - break; - default: - return DefWindowProc(hwnd, msg, wParam, lParam); - } - return 0; - } - - QColor _shActive(0, 0, 0), _shInactive(0, 0, 0); - - typedef HRESULT (FAR STDAPICALLTYPE *f_setWindowTheme)(HWND hWnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList); - f_setWindowTheme setWindowTheme = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_openAs_RunDLL)(HWND hWnd, HINSTANCE hInstance, LPCWSTR lpszCmdLine, int nCmdShow); - f_openAs_RunDLL openAs_RunDLL = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_shOpenWithDialog)(HWND hwndParent, const OPENASINFO *poainfo); - f_shOpenWithDialog shOpenWithDialog = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_shAssocEnumHandlers)(PCWSTR pszExtra, ASSOC_FILTER afFilter, IEnumAssocHandlers **ppEnumHandler); - f_shAssocEnumHandlers shAssocEnumHandlers = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_shCreateItemFromParsingName)(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); - f_shCreateItemFromParsingName shCreateItemFromParsingName = 0; - - typedef BOOL (FAR STDAPICALLTYPE *f_wtsRegisterSessionNotification)(HWND hWnd, DWORD dwFlags); - f_wtsRegisterSessionNotification wtsRegisterSessionNotification = 0; - - typedef BOOL (FAR STDAPICALLTYPE *f_wtsUnRegisterSessionNotification)(HWND hWnd); - f_wtsUnRegisterSessionNotification wtsUnRegisterSessionNotification = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_shQueryUserNotificationState)(QUERY_USER_NOTIFICATION_STATE *pquns); - f_shQueryUserNotificationState shQueryUserNotificationState = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_setCurrentProcessExplicitAppUserModelID)(__in PCWSTR AppID); - f_setCurrentProcessExplicitAppUserModelID setCurrentProcessExplicitAppUserModelID = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_roGetActivationFactory)(_In_ HSTRING activatableClassId, _In_ REFIID iid, _COM_Outptr_ void ** factory); - f_roGetActivationFactory roGetActivationFactory = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_windowsCreateStringReference)(_In_reads_opt_(length + 1) PCWSTR sourceString, UINT32 length, _Out_ HSTRING_HEADER * hstringHeader, _Outptr_result_maybenull_ _Result_nullonfailure_ HSTRING * string); - f_windowsCreateStringReference windowsCreateStringReference = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_windowsDeleteString)(_In_opt_ HSTRING string); - f_windowsDeleteString windowsDeleteString = 0; - - typedef HRESULT (FAR STDAPICALLTYPE *f_propVariantToString)(_In_ REFPROPVARIANT propvar, _Out_writes_(cch) PWSTR psz, _In_ UINT cch); - f_propVariantToString propVariantToString = 0; + //ComPtr taskbarList; + + //ComPtr toastNotificationManager; + //ComPtr toastNotifier; + //ComPtr toastNotificationFactory; + //struct ToastNotificationPtr { + // ToastNotificationPtr() { + // } + // ToastNotificationPtr(const ComPtr &ptr) : p(ptr) { + // } + // ComPtr p; + //}; + //typedef QMap > ToastNotifications; + //ToastNotifications toastNotifications; + //struct ToastImage { + // uint64 until; + // QString path; + //}; + //typedef QMap ToastImages; + //ToastImages toastImages; + //bool ToastImageSavedFlag = false; + + //HWND createTaskbarHider() { + // HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); + // HWND hWnd = 0; + + // QString cn = QString("TelegramTaskbarHider"); + // LPCWSTR _cn = (LPCWSTR)cn.utf16(); + // WNDCLASSEX wc; + + // wc.cbSize = sizeof(wc); + // wc.style = 0; + // wc.lpfnWndProc = DefWindowProc; + // wc.cbClsExtra = 0; + // wc.cbWndExtra = 0; + // wc.hInstance = appinst; + // wc.hIcon = 0; + // wc.hCursor = 0; + // wc.hbrBackground = 0; + // wc.lpszMenuName = NULL; + // wc.lpszClassName = _cn; + // wc.hIconSm = 0; + // if (!RegisterClassEx(&wc)) { + // DEBUG_LOG(("Application Error: could not register taskbar hider window class, error: %1").arg(GetLastError())); + // return hWnd; + // } + + // hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); + // if (!hWnd) { + // DEBUG_LOG(("Application Error: could not create taskbar hider window class, error: %1").arg(GetLastError())); + // return hWnd; + // } + // return hWnd; + //} + + //enum { + // _PsShadowMoved = 0x01, + // _PsShadowResized = 0x02, + // _PsShadowShown = 0x04, + // _PsShadowHidden = 0x08, + // _PsShadowActivate = 0x10, + //}; + + //enum { + // _PsInitHor = 0x01, + // _PsInitVer = 0x02, + //}; + + //int32 _psSize = 0; + //class _PsShadowWindows { + //public: + + // _PsShadowWindows() : screenDC(0), max_w(0), max_h(0), _x(0), _y(0), _w(0), _h(0), hidden(true), r(0), g(0), b(0), noKeyColor(RGB(255, 255, 255)) { + // for (int i = 0; i < 4; ++i) { + // dcs[i] = 0; + // bitmaps[i] = 0; + // hwnds[i] = 0; + // } + // } + + // void setColor(QColor c) { + // r = c.red(); + // g = c.green(); + // b = c.blue(); + + // if (!hwnds[0]) return; + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // for (int i = 0; i < 4; ++i) { + // Gdiplus::Graphics graphics(dcs[i]); + // graphics.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // if ((i % 2) && _h || !(i % 2) && _w) { + // graphics.FillRectangle(&brush, 0, 0, (i % 2) ? _size : _w, (i % 2) ? _h : _size); + // } + // } + // initCorners(); + + // _x = _y = _w = _h = 0; + // update(_PsShadowMoved | _PsShadowResized); + // } + + // bool init(QColor c) { + // style::rect topLeft = st::wndShadow; + // _fullsize = topLeft.width(); + // _shift = st::wndShadowShift; + // QImage cornersImage(_fullsize, _fullsize, QImage::Format_ARGB32_Premultiplied); + // { + // QPainter p(&cornersImage); + // p.drawPixmap(QPoint(0, 0), App::sprite(), topLeft); + // } + // if (rtl()) cornersImage = cornersImage.mirrored(true, false); + // uchar *bits = cornersImage.bits(); + // if (bits) { + // for ( + // quint32 *p = (quint32*)bits, *end = (quint32*)(bits + cornersImage.byteCount()); + // p < end; + // ++p + // ) { + // *p = (*p ^ 0x00ffffff) << 24; + // } + // } + + // _metaSize = _fullsize + 2 * _shift; + // _alphas.reserve(_metaSize); + // _colors.reserve(_metaSize * _metaSize); + // for (int32 j = 0; j < _metaSize; ++j) { + // for (int32 i = 0; i < _metaSize; ++i) { + // _colors.push_back((i < 2 * _shift || j < 2 * _shift) ? 1 : qMax(BYTE(1), BYTE(cornersImage.pixel(QPoint(i - 2 * _shift, j - 2 * _shift)) >> 24))); + // } + // } + // uchar prev = 0; + // for (int32 i = 0; i < _metaSize; ++i) { + // uchar a = _colors[(_metaSize - 1) * _metaSize + i]; + // if (a < prev) break; + + // _alphas.push_back(a); + // prev = a; + // } + // _psSize = _size = _alphas.size() - 2 * _shift; + + // setColor(c); + + // Gdiplus::GdiplusStartupInput gdiplusStartupInput; + // ULONG_PTR gdiplusToken; + // Gdiplus::Status gdiRes = Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + + // if (gdiRes != Gdiplus::Ok) { + // LOG(("Application Error: could not init GDI+, error: %1").arg((int)gdiRes)); + // return false; + // } + // blend.AlphaFormat = AC_SRC_ALPHA; + // blend.SourceConstantAlpha = 255; + // blend.BlendFlags = 0; + // blend.BlendOp = AC_SRC_OVER; + + // screenDC = GetDC(0); + // if (!screenDC) { + // LOG(("Application Error: could not GetDC(0), error: %2").arg(GetLastError())); + // return false; + // } + + // QRect avail(Sandbox::availableGeometry()); + // max_w = avail.width(); + // if (max_w < st::wndMinWidth) max_w = st::wndMinWidth; + // max_h = avail.height(); + // if (max_h < st::wndMinHeight) max_h = st::wndMinHeight; + + // HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); + // HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; + + // for (int i = 0; i < 4; ++i) { + // QString cn = QString("TelegramShadow%1").arg(i); + // LPCWSTR _cn = (LPCWSTR)cn.utf16(); + // WNDCLASSEX wc; + + // wc.cbSize = sizeof(wc); + // wc.style = 0; + // wc.lpfnWndProc = wndProc; + // wc.cbClsExtra = 0; + // wc.cbWndExtra = 0; + // wc.hInstance = appinst; + // wc.hIcon = 0; + // wc.hCursor = 0; + // wc.hbrBackground = 0; + // wc.lpszMenuName = NULL; + // wc.lpszClassName = _cn; + // wc.hIconSm = 0; + // if (!RegisterClassEx(&wc)) { + // LOG(("Application Error: could not register shadow window class %1, error: %2").arg(i).arg(GetLastError())); + // destroy(); + // return false; + // } + + // hwnds[i] = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, _cn, 0, WS_POPUP, 0, 0, 0, 0, 0, 0, appinst, 0); + // if (!hwnds[i]) { + // LOG(("Application Error: could not create shadow window class %1, error: %2").arg(i).arg(GetLastError())); + // destroy(); + // return false; + // } + // SetWindowLong(hwnds[i], GWL_HWNDPARENT, (LONG)hwnd); + + // dcs[i] = CreateCompatibleDC(screenDC); + // if (!dcs[i]) { + // LOG(("Application Error: could not create dc for shadow window class %1, error: %2").arg(i).arg(GetLastError())); + // destroy(); + // return false; + // } + + // bitmaps[i] = CreateCompatibleBitmap(screenDC, (i % 2) ? _size : max_w, (i % 2) ? max_h : _size); + // if (!bitmaps[i]) { + // LOG(("Application Error: could not create bitmap for shadow window class %1, error: %2").arg(i).arg(GetLastError())); + // destroy(); + // return false; + // } + + // SelectObject(dcs[i], bitmaps[i]); + // } + + // initCorners(); + // return true; + // } + + // void initCorners(int directions = (_PsInitHor | _PsInitVer)) { + // bool hor = (directions & _PsInitHor), ver = (directions & _PsInitVer); + // Gdiplus::Graphics graphics0(dcs[0]), graphics1(dcs[1]), graphics2(dcs[2]), graphics3(dcs[3]); + // graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // if (hor) graphics0.FillRectangle(&brush, 0, 0, _fullsize - (_size - _shift), 2 * _shift); + + // if (ver) { + // graphics1.FillRectangle(&brush, 0, 0, _size, 2 * _shift); + // graphics3.FillRectangle(&brush, 0, 0, _size, 2 * _shift); + // graphics1.FillRectangle(&brush, _size - _shift, 2 * _shift, _shift, _fullsize); + // graphics3.FillRectangle(&brush, 0, 2 * _shift, _shift, _fullsize); + // } + + // if (hor) { + // for (int j = 2 * _shift; j < _size; ++j) { + // for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + // brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + // graphics0.FillRectangle(&brush, k, j, 1, 1); + // graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); + // } + // } + // for (int j = _size; j < _size + 2 * _shift; ++j) { + // for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + // brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + // graphics2.FillRectangle(&brush, k, _size - (j - 2 * _shift) - 1, 1, 1); + // } + // } + // } + // if (ver) { + // for (int j = 2 * _shift; j < _fullsize + 2 * _shift; ++j) { + // for (int k = _shift; k < _size; ++k) { + // brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + (k + _shift)], r, g, b)); + // graphics1.FillRectangle(&brush, _size - k - 1, j, 1, 1); + // graphics3.FillRectangle(&brush, k, j, 1, 1); + // } + // } + // } + // } + // void verCorners(int h, Gdiplus::Graphics *pgraphics1, Gdiplus::Graphics *pgraphics3) { + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // pgraphics1->FillRectangle(&brush, _size - _shift, h - _fullsize, _shift, _fullsize); + // pgraphics3->FillRectangle(&brush, 0, h - _fullsize, _shift, _fullsize); + // for (int j = 0; j < _fullsize; ++j) { + // for (int k = _shift; k < _size; ++k) { + // brush.SetColor(Gdiplus::Color(_colors[(j + 2 * _shift) * _metaSize + k + _shift], r, g, b)); + // pgraphics1->FillRectangle(&brush, _size - k - 1, h - j - 1, 1, 1); + // pgraphics3->FillRectangle(&brush, k, h - j - 1, 1, 1); + // } + // } + // } + // void horCorners(int w, Gdiplus::Graphics *pgraphics0, Gdiplus::Graphics *pgraphics2) { + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // pgraphics0->FillRectangle(&brush, w - 2 * _size - (_fullsize - (_size - _shift)), 0, _fullsize - (_size - _shift), 2 * _shift); + // for (int j = 2 * _shift; j < _size; ++j) { + // for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + // brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + // pgraphics0->FillRectangle(&brush, w - 2 * _size - k - 1, j, 1, 1); + // pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); + // } + // } + // for (int j = _size; j < _size + 2 * _shift; ++j) { + // for (int k = 0; k < _fullsize - (_size - _shift); ++k) { + // brush.SetColor(Gdiplus::Color(_colors[j * _metaSize + k + (_size + _shift)], r, g, b)); + // pgraphics2->FillRectangle(&brush, w - 2 * _size - k - 1, _size - (j - 2 * _shift) - 1, 1, 1); + // } + // } + // } + + // void update(int changes, WINDOWPOS *pos = 0) { + // HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; + // if (!hwnd || !hwnds[0]) return; + + // if (changes == _PsShadowActivate) { + // for (int i = 0; i < 4; ++i) { + // SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + // } + // return; + // } + + // if (changes & _PsShadowHidden) { + // if (!hidden) { + // for (int i = 0; i < 4; ++i) { + // hidden = true; + // ShowWindow(hwnds[i], SW_HIDE); + // } + // } + // return; + // } + // if (!App::wnd()->psPosInited()) return; + + // int x = _x, y = _y, w = _w, h = _h; + // if (pos && (!(pos->flags & SWP_NOMOVE) || !(pos->flags & SWP_NOSIZE) || !(pos->flags & SWP_NOREPOSITION))) { + // if (!(pos->flags & SWP_NOMOVE)) { + // x = pos->x - _size; + // y = pos->y - _size; + // } else if (pos->flags & SWP_NOSIZE) { + // for (int i = 0; i < 4; ++i) { + // SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + // } + // return; + // } + // if (!(pos->flags & SWP_NOSIZE)) { + // w = pos->cx + 2 * _size; + // h = pos->cy + 2 * _size; + // } + // } else { + // RECT r; + // GetWindowRect(hwnd, &r); + // x = r.left - _size; + // y = r.top - _size; + // w = r.right + _size - x; + // h = r.bottom + _size - y; + // } + // if (h < 2 * _fullsize + 2 * _shift) { + // h = 2 * _fullsize + 2 * _shift; + // } + // if (w < 2 * (_fullsize + _shift)) { + // w = 2 * (_fullsize + _shift); + // } + + // if (w != _w) { + // int from = (_w > 2 * (_fullsize + _shift)) ? (_w - _size - _fullsize - _shift) : (_fullsize - (_size - _shift)); + // int to = w - _size - _fullsize - _shift; + // if (w > max_w) { + // from = _fullsize - (_size - _shift); + // max_w *= 2; + // for (int i = 0; i < 4; i += 2) { + // DeleteObject(bitmaps[i]); + // bitmaps[i] = CreateCompatibleBitmap(screenDC, max_w, _size); + // SelectObject(dcs[i], bitmaps[i]); + // } + // initCorners(_PsInitHor); + // } + // Gdiplus::Graphics graphics0(dcs[0]), graphics2(dcs[2]); + // graphics0.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // graphics2.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // if (to > from) { + // graphics0.FillRectangle(&brush, from, 0, to - from, 2 * _shift); + // for (int i = 2 * _shift; i < _size; ++i) { + // Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + // graphics0.DrawLine(&pen, from, i, to, i); + // graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); + // } + // for (int i = _size; i < _size + 2 * _shift; ++i) { + // Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + // graphics2.DrawLine(&pen, from, _size - (i - 2 * _shift) - 1, to, _size - (i - 2 * _shift) - 1); + // } + // } + // if (_w > w) { + // graphics0.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); + // graphics2.FillRectangle(&brush, w - _size - _fullsize - _shift, 0, _fullsize - (_size - _shift), _size); + // } + // horCorners(w, &graphics0, &graphics2); + // POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }, f = { 0, 0 }; + // SIZE s = { w - 2 * _size, _size }; + // updateWindow(0, &p0, &s); + // updateWindow(2, &p2, &s); + // } else if (x != _x || y != _y) { + // POINT p0 = { x + _size, y }, p2 = { x + _size, y + h - _size }; + // updateWindow(0, &p0); + // updateWindow(2, &p2); + // } else if (h != _h) { + // POINT p2 = { x + _size, y + h - _size }; + // updateWindow(2, &p2); + // } + + // if (h != _h) { + // int from = (_h > 2 * _fullsize + 2 * _shift) ? (_h - _fullsize) : (_fullsize + 2 * _shift); + // int to = h - _fullsize; + // if (h > max_h) { + // from = (_fullsize + 2 * _shift); + // max_h *= 2; + // for (int i = 1; i < 4; i += 2) { + // DeleteObject(bitmaps[i]); + // bitmaps[i] = CreateCompatibleBitmap(dcs[i], _size, max_h); + // SelectObject(dcs[i], bitmaps[i]); + // } + // initCorners(_PsInitVer); + // } + // Gdiplus::Graphics graphics1(dcs[1]), graphics3(dcs[3]); + // graphics1.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + // graphics3.SetCompositingMode(Gdiplus::CompositingModeSourceCopy); + + // Gdiplus::SolidBrush brush(Gdiplus::Color(_alphas[0], r, g, b)); + // if (to > from) { + // graphics1.FillRectangle(&brush, _size - _shift, from, _shift, to - from); + // graphics3.FillRectangle(&brush, 0, from, _shift, to - from); + // for (int i = 2 * _shift; i < _size + _shift; ++i) { + // Gdiplus::Pen pen(Gdiplus::Color(_alphas[i], r, g, b)); + // graphics1.DrawLine(&pen, _size + _shift - i - 1, from, _size + _shift - i - 1, to); + // graphics3.DrawLine(&pen, i - _shift, from, i - _shift, to); + // } + // } + // if (_h > h) { + // graphics1.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); + // graphics3.FillRectangle(&brush, 0, h - _fullsize, _size, _fullsize); + // } + // verCorners(h, &graphics1, &graphics3); + + // POINT p1 = {x + w - _size, y}, p3 = {x, y}, f = {0, 0}; + // SIZE s = { _size, h }; + // updateWindow(1, &p1, &s); + // updateWindow(3, &p3, &s); + // } else if (x != _x || y != _y) { + // POINT p1 = { x + w - _size, y }, p3 = { x, y }; + // updateWindow(1, &p1); + // updateWindow(3, &p3); + // } else if (w != _w) { + // POINT p1 = { x + w - _size, y }; + // updateWindow(1, &p1); + // } + // _x = x; + // _y = y; + // _w = w; + // _h = h; + + // if (hidden && (changes & _PsShadowShown)) { + // for (int i = 0; i < 4; ++i) { + // SetWindowPos(hwnds[i], hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOACTIVATE); + // } + // hidden = false; + // } + // } + + // void updateWindow(int i, POINT *p, SIZE *s = 0) { + // static POINT f = {0, 0}; + // if (s) { + // UpdateLayeredWindow(hwnds[i], (s ? screenDC : 0), p, s, (s ? dcs[i] : 0), (s ? (&f) : 0), noKeyColor, &blend, ULW_ALPHA); + // } else { + // SetWindowPos(hwnds[i], 0, p->x, p->y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER); + // } + // } + + // void destroy() { + // for (int i = 0; i < 4; ++i) { + // if (dcs[i]) DeleteDC(dcs[i]); + // if (bitmaps[i]) DeleteObject(bitmaps[i]); + // if (hwnds[i]) DestroyWindow(hwnds[i]); + // dcs[i] = 0; + // bitmaps[i] = 0; + // hwnds[i] = 0; + // } + // if (screenDC) ReleaseDC(0, screenDC); + // } + + //private: + + // int _x, _y, _w, _h; + // int _metaSize, _fullsize, _size, _shift; + // QVector _alphas, _colors; + + // bool hidden; + + // HWND hwnds[4]; + // HDC dcs[4], screenDC; + // HBITMAP bitmaps[4]; + // int max_w, max_h; + // BLENDFUNCTION blend; + + // BYTE r, g, b; + // COLORREF noKeyColor; + + // static LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + + //}; + //_PsShadowWindows _psShadowWindows; + + //LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + // if (finished) return DefWindowProc(hwnd, msg, wParam, lParam); + + // int i; + // for (i = 0; i < 4; ++i) { + // if (_psShadowWindows.hwnds[i] && hwnd == _psShadowWindows.hwnds[i]) { + // break; + // } + // } + // if (i == 4) return DefWindowProc(hwnd, msg, wParam, lParam); + + // switch (msg) { + // case WM_CLOSE: + // App::wnd()->close(); + // break; + + // case WM_NCHITTEST: { + // int32 xPos = GET_X_LPARAM(lParam), yPos = GET_Y_LPARAM(lParam); + // switch (i) { + // case 0: return HTTOP; + // case 1: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPRIGHT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMRIGHT : HTRIGHT); + // case 2: return HTBOTTOM; + // case 3: return (yPos < _psShadowWindows._y + _psSize) ? HTTOPLEFT : ((yPos >= _psShadowWindows._y + _psShadowWindows._h - _psSize) ? HTBOTTOMLEFT : HTLEFT); + // } + // return HTTRANSPARENT; + // } break; + + // case WM_NCACTIVATE: return DefWindowProc(hwnd, msg, wParam, lParam); + // case WM_NCLBUTTONDOWN: + // case WM_NCLBUTTONUP: + // case WM_NCLBUTTONDBLCLK: + // case WM_NCMBUTTONDOWN: + // case WM_NCMBUTTONUP: + // case WM_NCMBUTTONDBLCLK: + // case WM_NCRBUTTONDOWN: + // case WM_NCRBUTTONUP: + // case WM_NCRBUTTONDBLCLK: + // case WM_NCXBUTTONDOWN: + // case WM_NCXBUTTONUP: + // case WM_NCXBUTTONDBLCLK: + // case WM_NCMOUSEHOVER: + // case WM_NCMOUSELEAVE: + // case WM_NCMOUSEMOVE: + // case WM_NCPOINTERUPDATE: + // case WM_NCPOINTERDOWN: + // case WM_NCPOINTERUP: + // if (App::wnd() && App::wnd()->psHwnd()) { + // if (msg == WM_NCLBUTTONDOWN) { + // ::SetForegroundWindow(App::wnd()->psHwnd()); + // } + // LRESULT res = SendMessage(App::wnd()->psHwnd(), msg, wParam, lParam); + // return res; + // } + // return 0; + // break; + // case WM_ACTIVATE: + // if (App::wnd() && App::wnd()->psHwnd() && wParam == WA_ACTIVE) { + // if ((HWND)lParam != App::wnd()->psHwnd()) { + // ::SetForegroundWindow(hwnd); + // ::SetWindowPos(App::wnd()->psHwnd(), hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + // } + // } + // return DefWindowProc(hwnd, msg, wParam, lParam); + // break; + // default: + // return DefWindowProc(hwnd, msg, wParam, lParam); + // } + // return 0; + //} + + //QColor _shActive(0, 0, 0), _shInactive(0, 0, 0); + + //typedef HRESULT (FAR STDAPICALLTYPE *f_setWindowTheme)(HWND hWnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList); + //f_setWindowTheme setWindowTheme = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_openAs_RunDLL)(HWND hWnd, HINSTANCE hInstance, LPCWSTR lpszCmdLine, int nCmdShow); + //f_openAs_RunDLL openAs_RunDLL = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_shOpenWithDialog)(HWND hwndParent, const OPENASINFO *poainfo); + //f_shOpenWithDialog shOpenWithDialog = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_shAssocEnumHandlers)(PCWSTR pszExtra, ASSOC_FILTER afFilter, IEnumAssocHandlers **ppEnumHandler); + //f_shAssocEnumHandlers shAssocEnumHandlers = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_shCreateItemFromParsingName)(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); + //f_shCreateItemFromParsingName shCreateItemFromParsingName = 0; + + //typedef BOOL (FAR STDAPICALLTYPE *f_wtsRegisterSessionNotification)(HWND hWnd, DWORD dwFlags); + //f_wtsRegisterSessionNotification wtsRegisterSessionNotification = 0; + + //typedef BOOL (FAR STDAPICALLTYPE *f_wtsUnRegisterSessionNotification)(HWND hWnd); + //f_wtsUnRegisterSessionNotification wtsUnRegisterSessionNotification = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_shQueryUserNotificationState)(QUERY_USER_NOTIFICATION_STATE *pquns); + //f_shQueryUserNotificationState shQueryUserNotificationState = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_setCurrentProcessExplicitAppUserModelID)(__in PCWSTR AppID); + //f_setCurrentProcessExplicitAppUserModelID setCurrentProcessExplicitAppUserModelID = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_roGetActivationFactory)(_In_ HSTRING activatableClassId, _In_ REFIID iid, _COM_Outptr_ void ** factory); + //f_roGetActivationFactory roGetActivationFactory = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_windowsCreateStringReference)(_In_reads_opt_(length + 1) PCWSTR sourceString, UINT32 length, _Out_ HSTRING_HEADER * hstringHeader, _Outptr_result_maybenull_ _Result_nullonfailure_ HSTRING * string); + //f_windowsCreateStringReference windowsCreateStringReference = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_windowsDeleteString)(_In_opt_ HSTRING string); + //f_windowsDeleteString windowsDeleteString = 0; + + //typedef HRESULT (FAR STDAPICALLTYPE *f_propVariantToString)(_In_ REFPROPVARIANT propvar, _Out_writes_(cch) PWSTR psz, _In_ UINT cch); + //f_propVariantToString propVariantToString = 0; template bool loadFunction(HINSTANCE dll, LPCSTR name, TFunction &func) { @@ -735,63 +735,63 @@ namespace { setupPropSys(); setupCombase(); - useTheme = !!setWindowTheme; + //useTheme = !!setWindowTheme; } void setupUx() { - HINSTANCE procId = LoadLibrary(L"UXTHEME.DLL"); + //HINSTANCE procId = LoadLibrary(L"UXTHEME.DLL"); - loadFunction(procId, "SetWindowTheme", setWindowTheme); + //loadFunction(procId, "SetWindowTheme", setWindowTheme); } void setupShell() { - HINSTANCE procId = LoadLibrary(L"SHELL32.DLL"); - setupOpenWith(procId); - setupOpenAs(procId); - setupShellapi(procId); - setupAppUserModel(procId); + //HINSTANCE procId = LoadLibrary(L"SHELL32.DLL"); + //setupOpenWith(procId); + //setupOpenAs(procId); + //setupShellapi(procId); + //setupAppUserModel(procId); } void setupOpenWith(HINSTANCE procId) { - if (!loadFunction(procId, "SHAssocEnumHandlers", shAssocEnumHandlers)) return; - if (!loadFunction(procId, "SHCreateItemFromParsingName", shCreateItemFromParsingName)) return; - useOpenWith = true; + //if (!loadFunction(procId, "SHAssocEnumHandlers", shAssocEnumHandlers)) return; + //if (!loadFunction(procId, "SHCreateItemFromParsingName", shCreateItemFromParsingName)) return; + //useOpenWith = true; } void setupOpenAs(HINSTANCE procId) { - if (!loadFunction(procId, "SHOpenWithDialog", shOpenWithDialog) && !loadFunction(procId, "OpenAs_RunDLLW", openAs_RunDLL)) return; - useOpenAs = true; + //if (!loadFunction(procId, "SHOpenWithDialog", shOpenWithDialog) && !loadFunction(procId, "OpenAs_RunDLLW", openAs_RunDLL)) return; + //useOpenAs = true; } void setupShellapi(HINSTANCE procId) { - if (!loadFunction(procId, "SHQueryUserNotificationState", shQueryUserNotificationState)) return; - useShellapi = true; + //if (!loadFunction(procId, "SHQueryUserNotificationState", shQueryUserNotificationState)) return; + //useShellapi = true; } void setupAppUserModel(HINSTANCE procId) { - if (!loadFunction(procId, "SetCurrentProcessExplicitAppUserModelID", setCurrentProcessExplicitAppUserModelID)) return; + //if (!loadFunction(procId, "SetCurrentProcessExplicitAppUserModelID", setCurrentProcessExplicitAppUserModelID)) return; } void setupWtsapi() { - HINSTANCE procId = LoadLibrary(L"WTSAPI32.DLL"); + //HINSTANCE procId = LoadLibrary(L"WTSAPI32.DLL"); - if (!loadFunction(procId, "WTSRegisterSessionNotification", wtsRegisterSessionNotification)) return; - if (!loadFunction(procId, "WTSUnRegisterSessionNotification", wtsUnRegisterSessionNotification)) return; - useWtsapi = true; + //if (!loadFunction(procId, "WTSRegisterSessionNotification", wtsRegisterSessionNotification)) return; + //if (!loadFunction(procId, "WTSUnRegisterSessionNotification", wtsUnRegisterSessionNotification)) return; + //useWtsapi = true; } void setupCombase() { - if (!setCurrentProcessExplicitAppUserModelID) return; + //if (!setCurrentProcessExplicitAppUserModelID) return; - HINSTANCE procId = LoadLibrary(L"COMBASE.DLL"); - setupToast(procId); + //HINSTANCE procId = LoadLibrary(L"COMBASE.DLL"); + //setupToast(procId); } void setupPropSys() { - HINSTANCE procId = LoadLibrary(L"PROPSYS.DLL"); - if (!loadFunction(procId, "PropVariantToString", propVariantToString)) return; + //HINSTANCE procId = LoadLibrary(L"PROPSYS.DLL"); + //if (!loadFunction(procId, "PropVariantToString", propVariantToString)) return; } void setupToast(HINSTANCE procId) { - if (!propVariantToString) return; - if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) return; - if (!loadFunction(procId, "RoGetActivationFactory", roGetActivationFactory)) return; + //if (!propVariantToString) return; + //if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) return; + //if (!loadFunction(procId, "RoGetActivationFactory", roGetActivationFactory)) return; - HINSTANCE otherProcId = LoadLibrary(L"api-ms-win-core-winrt-string-l1-1-0.dll"); - if (!loadFunction(otherProcId, "WindowsCreateStringReference", windowsCreateStringReference)) return; - if (!loadFunction(otherProcId, "WindowsDeleteString", windowsDeleteString)) return; + //HINSTANCE otherProcId = LoadLibrary(L"api-ms-win-core-winrt-string-l1-1-0.dll"); + //if (!loadFunction(otherProcId, "WindowsCreateStringReference", windowsCreateStringReference)) return; + //if (!loadFunction(otherProcId, "WindowsDeleteString", windowsDeleteString)) return; - useToast = true; + //useToast = true; } }; _PsInitializer _psInitializer; @@ -817,12 +817,12 @@ namespace { } bool mainWindowEvent(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result) { - if (tbCreatedMsgId && msg == tbCreatedMsgId) { - HRESULT hr = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&taskbarList)); - if (!SUCCEEDED(hr)) { - taskbarList.Reset(); - } - } + //if (tbCreatedMsgId && msg == tbCreatedMsgId) { + // HRESULT hr = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&taskbarList)); + // if (!SUCCEEDED(hr)) { + // taskbarList.Reset(); + // } + //} switch (msg) { case WM_TIMECHANGE: { @@ -845,12 +845,12 @@ namespace { if (LOWORD(wParam) == WA_CLICKACTIVE) { App::wnd()->inactivePress(true); } - if (LOWORD(wParam) != WA_INACTIVE) { - _psShadowWindows.setColor(_shActive); - _psShadowWindows.update(_PsShadowActivate); - } else { - _psShadowWindows.setColor(_shInactive); - } + //if (LOWORD(wParam) != WA_INACTIVE) { + // _psShadowWindows.setColor(_shActive); + // _psShadowWindows.update(_PsShadowActivate); + //} else { + // _psShadowWindows.setColor(_shInactive); + //} if (Global::started()) { QMetaObject::invokeMethod(App::wnd(), "updateCounter", Qt::QueuedConnection); App::wnd()->update(); @@ -859,39 +859,39 @@ namespace { case WM_NCPAINT: if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return false; *result = 0; return true; - case WM_NCCALCSIZE: { - WINDOWPLACEMENT wp; - wp.length = sizeof(WINDOWPLACEMENT); - if (GetWindowPlacement(hWnd, &wp) && wp.showCmd == SW_SHOWMAXIMIZED) { - LPNCCALCSIZE_PARAMS params = (LPNCCALCSIZE_PARAMS)lParam; - LPRECT r = (wParam == TRUE) ? ¶ms->rgrc[0] : (LPRECT)lParam; - HMONITOR hMonitor = MonitorFromPoint({ (r->left + r->right) / 2, (r->top + r->bottom) / 2 }, MONITOR_DEFAULTTONEAREST); - if (hMonitor) { - MONITORINFO mi; - mi.cbSize = sizeof(mi); - if (GetMonitorInfo(hMonitor, &mi)) { - *r = mi.rcWork; - } - } - } - *result = 0; - return true; - } + //case WM_NCCALCSIZE: { + // WINDOWPLACEMENT wp; + // wp.length = sizeof(WINDOWPLACEMENT); + // if (GetWindowPlacement(hWnd, &wp) && wp.showCmd == SW_SHOWMAXIMIZED) { + // LPNCCALCSIZE_PARAMS params = (LPNCCALCSIZE_PARAMS)lParam; + // LPRECT r = (wParam == TRUE) ? ¶ms->rgrc[0] : (LPRECT)lParam; + // HMONITOR hMonitor = MonitorFromPoint({ (r->left + r->right) / 2, (r->top + r->bottom) / 2 }, MONITOR_DEFAULTTONEAREST); + // if (hMonitor) { + // MONITORINFO mi; + // mi.cbSize = sizeof(mi); + // if (GetMonitorInfo(hMonitor, &mi)) { + // *r = mi.rcWork; + // } + // } + // } + // *result = 0; + // return true; + //} - case WM_NCACTIVATE: { - *result = DefWindowProc(hWnd, msg, wParam, -1); - } return true; + //case WM_NCACTIVATE: { + // *result = DefWindowProc(hWnd, msg, wParam, -1); + //} return true; - case WM_WINDOWPOSCHANGING: - case WM_WINDOWPOSCHANGED: { - WINDOWPLACEMENT wp; - wp.length = sizeof(WINDOWPLACEMENT); - if (GetWindowPlacement(hWnd, &wp) && (wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) { - _psShadowWindows.update(_PsShadowHidden); - } else { - _psShadowWindows.update(_PsShadowMoved | _PsShadowResized, (WINDOWPOS*)lParam); - } - } return false; + //case WM_WINDOWPOSCHANGING: + //case WM_WINDOWPOSCHANGED: { + // WINDOWPLACEMENT wp; + // wp.length = sizeof(WINDOWPLACEMENT); + // if (GetWindowPlacement(hWnd, &wp) && (wp.showCmd == SW_SHOWMAXIMIZED || wp.showCmd == SW_SHOWMINIMIZED)) { + // _psShadowWindows.update(_PsShadowHidden); + // } else { + // _psShadowWindows.update(_PsShadowMoved | _PsShadowResized, (WINDOWPOS*)lParam); + // } + //} return false; case WM_SIZE: { if (App::wnd()) { @@ -908,93 +908,93 @@ namespace { App::wnd()->psUpdatedPosition(); } App::wnd()->psUpdateMargins(); - int changes = (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXIMIZED) ? _PsShadowHidden : (_PsShadowResized | _PsShadowShown); - _psShadowWindows.update(changes); + //int changes = (wParam == SIZE_MINIMIZED || wParam == SIZE_MAXIMIZED) ? _PsShadowHidden : (_PsShadowResized | _PsShadowShown); + //_psShadowWindows.update(changes); } } } return false; - case WM_SHOWWINDOW: { - LONG style = GetWindowLong(hWnd, GWL_STYLE); - int changes = _PsShadowResized | ((wParam && !(style & (WS_MAXIMIZE | WS_MINIMIZE))) ? _PsShadowShown : _PsShadowHidden); - _psShadowWindows.update(changes); - } return false; + //case WM_SHOWWINDOW: { + // LONG style = GetWindowLong(hWnd, GWL_STYLE); + // int changes = _PsShadowResized | ((wParam && !(style & (WS_MAXIMIZE | WS_MINIMIZE))) ? _PsShadowShown : _PsShadowHidden); + // _psShadowWindows.update(changes); + //} return false; case WM_MOVE: { - _psShadowWindows.update(_PsShadowMoved); + //_psShadowWindows.update(_PsShadowMoved); App::wnd()->psUpdatedPosition(); } return false; - case WM_NCHITTEST: { - POINTS p = MAKEPOINTS(lParam); - RECT r; - GetWindowRect(hWnd, &r); - HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); - switch (res) { - case HitTestClient: - case HitTestSysButton: *result = HTCLIENT; break; - case HitTestIcon: *result = HTCAPTION; break; - case HitTestCaption: *result = HTCAPTION; break; - case HitTestTop: *result = HTTOP; break; - case HitTestTopRight: *result = HTTOPRIGHT; break; - case HitTestRight: *result = HTRIGHT; break; - case HitTestBottomRight: *result = HTBOTTOMRIGHT; break; - case HitTestBottom: *result = HTBOTTOM; break; - case HitTestBottomLeft: *result = HTBOTTOMLEFT; break; - case HitTestLeft: *result = HTLEFT; break; - case HitTestTopLeft: *result = HTTOPLEFT; break; - case HitTestNone: - default: *result = HTTRANSPARENT; break; - }; - } return true; + //case WM_NCHITTEST: { + // POINTS p = MAKEPOINTS(lParam); + // RECT r; + // GetWindowRect(hWnd, &r); + // HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + // switch (res) { + // case HitTestClient: + // case HitTestSysButton: *result = HTCLIENT; break; + // case HitTestIcon: *result = HTCAPTION; break; + // case HitTestCaption: *result = HTCAPTION; break; + // case HitTestTop: *result = HTTOP; break; + // case HitTestTopRight: *result = HTTOPRIGHT; break; + // case HitTestRight: *result = HTRIGHT; break; + // case HitTestBottomRight: *result = HTBOTTOMRIGHT; break; + // case HitTestBottom: *result = HTBOTTOM; break; + // case HitTestBottomLeft: *result = HTBOTTOMLEFT; break; + // case HitTestLeft: *result = HTLEFT; break; + // case HitTestTopLeft: *result = HTTOPLEFT; break; + // case HitTestNone: + // default: *result = HTTRANSPARENT; break; + // }; + //} return true; - case WM_NCRBUTTONUP: { - SendMessage(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam); - } return true; + //case WM_NCRBUTTONUP: { + // SendMessage(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU, lParam); + //} return true; - case WM_NCLBUTTONDOWN: { - POINTS p = MAKEPOINTS(lParam); - RECT r; - GetWindowRect(hWnd, &r); - HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); - switch (res) { - case HitTestIcon: - if (menuHidden && getms() < menuHidden + 10) { - menuHidden = 0; - if (getms() < menuShown + GetDoubleClickTime()) { - App::wnd()->close(); - } - } else { - QRect icon = App::wnd()->iconRect(); - p.x = r.left - dleft + icon.left(); - p.y = r.top - dtop + icon.top() + icon.height(); - App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); - menuShown = getms(); - menuHidden = 0; - TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); - menuHidden = getms(); - } - return true; - }; - } return false; + //case WM_NCLBUTTONDOWN: { + // POINTS p = MAKEPOINTS(lParam); + // RECT r; + // GetWindowRect(hWnd, &r); + // HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + // switch (res) { + // case HitTestIcon: + // if (menuHidden && getms() < menuHidden + 10) { + // menuHidden = 0; + // if (getms() < menuShown + GetDoubleClickTime()) { + // App::wnd()->close(); + // } + // } else { + // QRect icon = App::wnd()->iconRect(); + // p.x = r.left - dleft + icon.left(); + // p.y = r.top - dtop + icon.top() + icon.height(); + // App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); + // menuShown = getms(); + // menuHidden = 0; + // TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + // menuHidden = getms(); + // } + // return true; + // }; + //} return false; - case WM_NCLBUTTONDBLCLK: { - POINTS p = MAKEPOINTS(lParam); - RECT r; - GetWindowRect(hWnd, &r); - HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); - switch (res) { - case HitTestIcon: App::wnd()->close(); return true; - }; - } return false; + //case WM_NCLBUTTONDBLCLK: { + // POINTS p = MAKEPOINTS(lParam); + // RECT r; + // GetWindowRect(hWnd, &r); + // HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + // switch (res) { + // case HitTestIcon: App::wnd()->close(); return true; + // }; + //} return false; - case WM_SYSCOMMAND: { - if (wParam == SC_MOUSEMENU) { - POINTS p = MAKEPOINTS(lParam); - App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); - TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); - } - } return false; + //case WM_SYSCOMMAND: { + // if (wParam == SC_MOUSEMENU) { + // POINTS p = MAKEPOINTS(lParam); + // App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); + // TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + // } + //} return false; case WM_COMMAND: { if (HIWORD(wParam)) return false; @@ -1015,9 +1015,21 @@ namespace { }; -PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), ps_hWnd(0), ps_menu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)), - ps_iconBig(0), ps_iconSmall(0), ps_iconOverlay(0), trayIcon(0), trayIconMenu(0), posInited(false), ps_tbHider_hWnd(createTaskbarHider()) { - tbCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated"); +PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent) +, ps_hWnd(0) +, ps_menu(0) +, icon256(qsl(":/gui/art/icon256.png")) +, iconbig256(qsl(":/gui/art/iconbig256.png")) +, wndIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)) +, ps_iconBig(0) +, ps_iconSmall(0) +, ps_iconOverlay(0) +, trayIcon(0) +, trayIconMenu(0) +, posInited(false) +//, ps_tbHider_hWnd(createTaskbarHider()) +{ + //tbCreatedMsgId = RegisterWindowMessage(L"TaskbarButtonCreated"); connect(&ps_cleanNotifyPhotosTimer, SIGNAL(timeout()), this, SLOT(psCleanNotifyPhotos())); } @@ -1034,23 +1046,23 @@ void PsMainWindow::psCleanNotifyPhotosIn(int32 dt) { } void PsMainWindow::psCleanNotifyPhotos() { - uint64 ms = getms(true), minuntil = 0; - for (ToastImages::iterator i = toastImages.begin(); i != toastImages.end();) { - if (!i->until) { - ++i; - continue; - } - if (i->until <= ms) { - QFile(i->path).remove(); - i = toastImages.erase(i); - } else { - if (!minuntil || minuntil > i->until) { - minuntil = i->until; - } - ++i; - } - } - if (minuntil) psCleanNotifyPhotosIn(int32(minuntil - ms)); + //uint64 ms = getms(true), minuntil = 0; + //for (ToastImages::iterator i = toastImages.begin(); i != toastImages.end();) { + // if (!i->until) { + // ++i; + // continue; + // } + // if (i->until <= ms) { + // QFile(i->path).remove(); + // i = toastImages.erase(i); + // } else { + // if (!minuntil || minuntil > i->until) { + // minuntil = i->until; + // } + // ++i; + // } + //} + //if (minuntil) psCleanNotifyPhotosIn(int32(minuntil - ms)); } void PsMainWindow::psRefreshTaskbarIcon() { @@ -1091,19 +1103,19 @@ void PsMainWindow::psUpdateWorkmode() { switch (cWorkMode()) { case dbiwmWindowAndTray: { psSetupTrayIcon(); - HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); - if (psOwner) { - SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); - psRefreshTaskbarIcon(); - } + //HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + //if (psOwner) { + // SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); + // psRefreshTaskbarIcon(); + //} } break; case dbiwmTrayOnly: { psSetupTrayIcon(); - HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); - if (!psOwner) { - SetWindowLong(ps_hWnd, GWL_HWNDPARENT, (LONG)ps_tbHider_hWnd); - } + //HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + //if (!psOwner) { + // SetWindowLong(ps_hWnd, GWL_HWNDPARENT, (LONG)ps_tbHider_hWnd); + //} } break; case dbiwmWindowOnly: { @@ -1113,11 +1125,11 @@ void PsMainWindow::psUpdateWorkmode() { } trayIcon = 0; - HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); - if (psOwner) { - SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); - psRefreshTaskbarIcon(); - } + //HWND psOwner = (HWND)GetWindowLong(ps_hWnd, GWL_HWNDPARENT); + //if (psOwner) { + // SetWindowLong(ps_hWnd, GWL_HWNDPARENT, 0); + // psRefreshTaskbarIcon(); + //} } break; } } @@ -1142,29 +1154,29 @@ void PsMainWindow::psUpdateCounter() { QIcon iconSmall, iconBig; iconSmall.addPixmap(QPixmap::fromImage(iconWithCounter(16, counter, bg, true), Qt::ColorOnly)); iconSmall.addPixmap(QPixmap::fromImage(iconWithCounter(32, counter, bg, true), Qt::ColorOnly)); - iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(32, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); - iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(64, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); + //iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(32, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); + //iconBig.addPixmap(QPixmap::fromImage(iconWithCounter(64, taskbarList.Get() ? 0 : counter, bg, false), Qt::ColorOnly)); if (trayIcon) { trayIcon->setIcon(iconSmall); } setWindowTitle((counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram")); - psDestroyIcons(); - ps_iconSmall = _qt_createHIcon(iconSmall, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); - ps_iconBig = _qt_createHIcon(iconBig, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); - SendMessage(ps_hWnd, WM_SETICON, 0, (LPARAM)ps_iconSmall); - SendMessage(ps_hWnd, WM_SETICON, 1, (LPARAM)(ps_iconBig ? ps_iconBig : ps_iconSmall)); - if (taskbarList.Get()) { - if (counter > 0) { - QIcon iconOverlay; - iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-16, counter, bg, false), Qt::ColorOnly)); - iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-32, counter, bg, false), Qt::ColorOnly)); - ps_iconOverlay = _qt_createHIcon(iconOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); - } - QString description = counter > 0 ? QString("%1 unread messages").arg(counter) : qsl("No unread messages"); - taskbarList->SetOverlayIcon(ps_hWnd, ps_iconOverlay, description.toStdWString().c_str()); - } - SetWindowPos(ps_hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); + //psDestroyIcons(); + //ps_iconSmall = _qt_createHIcon(iconSmall, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); + //ps_iconBig = _qt_createHIcon(iconBig, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); + //SendMessage(ps_hWnd, WM_SETICON, 0, (LPARAM)ps_iconSmall); + //SendMessage(ps_hWnd, WM_SETICON, 1, (LPARAM)(ps_iconBig ? ps_iconBig : ps_iconSmall)); + //if (taskbarList.Get()) { + // if (counter > 0) { + // QIcon iconOverlay; + // iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-16, counter, bg, false), Qt::ColorOnly)); + // iconOverlay.addPixmap(QPixmap::fromImage(iconWithCounter(-32, counter, bg, false), Qt::ColorOnly)); + // ps_iconOverlay = _qt_createHIcon(iconOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); + // } + // QString description = counter > 0 ? QString("%1 unread messages").arg(counter) : qsl("No unread messages"); + // taskbarList->SetOverlayIcon(ps_hWnd, ps_iconOverlay, description.toStdWString().c_str()); + //} + //SetWindowPos(ps_hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } void PsMainWindow::psUpdateDelegate() { @@ -1180,14 +1192,14 @@ namespace { _In_ LPRECT lprcMonitor, _In_ LPARAM dwData ) { - MONITORINFOEX info; - info.cbSize = sizeof(info); - GetMonitorInfo(hMonitor, &info); - if (dwData == hashCrc32(info.szDevice, sizeof(info.szDevice))) { - enumMonitor = hMonitor; - enumMonitorWork = info.rcWork; - return FALSE; - } + //MONITORINFOEX info; + //info.cbSize = sizeof(info); + //GetMonitorInfo(hMonitor, &info); + //if (dwData == hashCrc32(info.szDevice, sizeof(info.szDevice))) { + // enumMonitor = hMonitor; + // enumMonitorWork = info.rcWork; + // return FALSE; + //} return TRUE; } } @@ -1203,7 +1215,7 @@ void PsMainWindow::psInitSize() { if (pos.w && pos.h) { if (pos.y < 0) pos.y = 0; enumMonitor = 0; - EnumDisplayMonitors(0, 0, &_monitorEnumProc, pos.moncrc); + //EnumDisplayMonitors(0, 0, &_monitorEnumProc, pos.moncrc); if (enumMonitor) { int32 w = enumMonitorWork.right - enumMonitorWork.left, h = enumMonitorWork.bottom - enumMonitorWork.top; if (w >= st::wndMinWidth && h >= st::wndMinHeight) { @@ -1222,7 +1234,7 @@ void PsMainWindow::psInitSize() { } bool InitToastManager(); -bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg); +//bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg); void CheckPinnedAppUserModelId(); void CleanupAppUserModelIdShortcut(); @@ -1235,13 +1247,12 @@ void PsMainWindow::psInitFrameless() { if (!ps_hWnd) return; - if (useWtsapi) wtsRegisterSessionNotification(ps_hWnd, NOTIFY_FOR_THIS_SESSION); + //if (useWtsapi) wtsRegisterSessionNotification(ps_hWnd, NOTIFY_FOR_THIS_SESSION); if (frameless) { setWindowFlags(Qt::FramelessWindowHint); } -// RegisterApplicationRestart(NULL, 0); if (!InitToastManager()) { useToast = false; } @@ -1258,26 +1269,26 @@ void PsMainWindow::psSavePosition(Qt::WindowState state) { if (state == Qt::WindowMaximized) { curPos.maximized = 1; } else { - RECT w; - GetWindowRect(ps_hWnd, &w); - curPos.x = w.left; - curPos.y = w.top; - curPos.w = w.right - w.left; - curPos.h = w.bottom - w.top; + //RECT w; + //GetWindowRect(ps_hWnd, &w); + //curPos.x = w.left; + //curPos.y = w.top; + //curPos.w = w.right - w.left; + //curPos.h = w.bottom - w.top; curPos.maximized = 0; } - HMONITOR hMonitor = MonitorFromWindow(ps_hWnd, MONITOR_DEFAULTTONEAREST); - if (hMonitor) { - MONITORINFOEX info; - info.cbSize = sizeof(info); - GetMonitorInfo(hMonitor, &info); - if (!curPos.maximized) { - curPos.x -= info.rcWork.left; - curPos.y -= info.rcWork.top; - } - curPos.moncrc = hashCrc32(info.szDevice, sizeof(info.szDevice)); - } + //HMONITOR hMonitor = MonitorFromWindow(ps_hWnd, MONITOR_DEFAULTTONEAREST); + //if (hMonitor) { + // MONITORINFOEX info; + // info.cbSize = sizeof(info); + // GetMonitorInfo(hMonitor, &info); + // if (!curPos.maximized) { + // curPos.x -= info.rcWork.left; + // curPos.y -= info.rcWork.top; + // } + // curPos.moncrc = hashCrc32(info.szDevice, sizeof(info.szDevice)); + //} if (curPos.w >= st::wndMinWidth && curPos.h >= st::wndMinHeight) { if (curPos.x != pos.x || curPos.y != pos.y || curPos.w != pos.w || curPos.h != pos.h || curPos.moncrc != pos.moncrc || curPos.maximized != pos.maximized) { @@ -1303,12 +1314,12 @@ void PsMainWindow::psFirstShow() { cSetCustomNotifies(true); } - _psShadowWindows.init(_shActive); + //_psShadowWindows.init(_shActive); finished = false; psUpdateMargins(); - _psShadowWindows.update(_PsShadowHidden); + //_psShadowWindows.update(_PsShadowHidden); bool showShadows = true; show(); @@ -1330,7 +1341,7 @@ void PsMainWindow::psFirstShow() { posInited = true; if (showShadows) { - _psShadowWindows.update(_PsShadowMoved | _PsShadowResized | _PsShadowShown); + //_psShadowWindows.update(_PsShadowMoved | _PsShadowResized | _PsShadowShown); } } @@ -1340,7 +1351,7 @@ bool PsMainWindow::psHandleTitle() { void PsMainWindow::psInitSysMenu() { Qt::WindowStates states = windowState(); - ps_menu = GetSystemMenu(ps_hWnd, FALSE); + //ps_menu = GetSystemMenu(ps_hWnd, FALSE); psUpdateSysMenu(windowHandle()->windowState()); } @@ -1353,98 +1364,98 @@ void PsMainWindow::psUpdateSysMenu(Qt::WindowState state) { } else if (state == Qt::WindowMinimized) { menuToDisable = SC_MINIMIZE; } - int itemCount = GetMenuItemCount(ps_menu); - for (int i = 0; i < itemCount; ++i) { - MENUITEMINFO itemInfo = {0}; - itemInfo.cbSize = sizeof(itemInfo); - itemInfo.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID; - if (GetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { - if (itemInfo.fType & MFT_SEPARATOR) { - continue; - } - if (itemInfo.wID && !(itemInfo.fState & MFS_DEFAULT)) { - UINT fOldState = itemInfo.fState, fState = itemInfo.fState & ~MFS_DISABLED; - if (itemInfo.wID == SC_CLOSE) { - fState |= MFS_DEFAULT; - } else if (itemInfo.wID == menuToDisable || (itemInfo.wID != SC_MINIMIZE && itemInfo.wID != SC_MAXIMIZE && itemInfo.wID != SC_RESTORE)) { - fState |= MFS_DISABLED; - } - itemInfo.fMask = MIIM_STATE; - itemInfo.fState = fState; - if (!SetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { - DEBUG_LOG(("PS Error: could not set state %1 to menu item %2, old state %3, error %4").arg(fState).arg(itemInfo.wID).arg(fOldState).arg(GetLastError())); - DestroyMenu(ps_menu); - ps_menu = 0; - break; - } - } - } else { - DEBUG_LOG(("PS Error: could not get state, menu item %1 of %2, error %3").arg(i).arg(itemCount).arg(GetLastError())); - DestroyMenu(ps_menu); - ps_menu = 0; - break; - } - } + //int itemCount = GetMenuItemCount(ps_menu); + //for (int i = 0; i < itemCount; ++i) { + // MENUITEMINFO itemInfo = {0}; + // itemInfo.cbSize = sizeof(itemInfo); + // itemInfo.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID; + // if (GetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { + // if (itemInfo.fType & MFT_SEPARATOR) { + // continue; + // } + // if (itemInfo.wID && !(itemInfo.fState & MFS_DEFAULT)) { + // UINT fOldState = itemInfo.fState, fState = itemInfo.fState & ~MFS_DISABLED; + // if (itemInfo.wID == SC_CLOSE) { + // fState |= MFS_DEFAULT; + // } else if (itemInfo.wID == menuToDisable || (itemInfo.wID != SC_MINIMIZE && itemInfo.wID != SC_MAXIMIZE && itemInfo.wID != SC_RESTORE)) { + // fState |= MFS_DISABLED; + // } + // itemInfo.fMask = MIIM_STATE; + // itemInfo.fState = fState; + // if (!SetMenuItemInfo(ps_menu, i, TRUE, &itemInfo)) { + // DEBUG_LOG(("PS Error: could not set state %1 to menu item %2, old state %3, error %4").arg(fState).arg(itemInfo.wID).arg(fOldState).arg(GetLastError())); + // DestroyMenu(ps_menu); + // ps_menu = 0; + // break; + // } + // } + // } else { + // DEBUG_LOG(("PS Error: could not get state, menu item %1 of %2, error %3").arg(i).arg(itemCount).arg(GetLastError())); + // DestroyMenu(ps_menu); + // ps_menu = 0; + // break; + // } + //} } void PsMainWindow::psUpdateMargins() { if (!ps_hWnd) return; - RECT r, a; + //RECT r, a; - GetClientRect(ps_hWnd, &r); - a = r; + //GetClientRect(ps_hWnd, &r); + //a = r; - LONG style = GetWindowLong(ps_hWnd, GWL_STYLE), styleEx = GetWindowLong(ps_hWnd, GWL_EXSTYLE); - AdjustWindowRectEx(&a, style, false, styleEx); - QMargins margins = QMargins(a.left - r.left, a.top - r.top, r.right - a.right, r.bottom - a.bottom); - if (style & WS_MAXIMIZE) { - RECT w, m; - GetWindowRect(ps_hWnd, &w); - m = w; + //LONG style = GetWindowLong(ps_hWnd, GWL_STYLE), styleEx = GetWindowLong(ps_hWnd, GWL_EXSTYLE); + //AdjustWindowRectEx(&a, style, false, styleEx); + //QMargins margins = QMargins(a.left - r.left, a.top - r.top, r.right - a.right, r.bottom - a.bottom); + //if (style & WS_MAXIMIZE) { + // RECT w, m; + // GetWindowRect(ps_hWnd, &w); + // m = w; - HMONITOR hMonitor = MonitorFromRect(&w, MONITOR_DEFAULTTONEAREST); - if (hMonitor) { - MONITORINFO mi; - mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); - m = mi.rcWork; - } + // HMONITOR hMonitor = MonitorFromRect(&w, MONITOR_DEFAULTTONEAREST); + // if (hMonitor) { + // MONITORINFO mi; + // mi.cbSize = sizeof(mi); + // GetMonitorInfo(hMonitor, &mi); + // m = mi.rcWork; + // } - dleft = w.left - m.left; - dtop = w.top - m.top; + // dleft = w.left - m.left; + // dtop = w.top - m.top; - margins.setLeft(margins.left() - w.left + m.left); - margins.setRight(margins.right() - m.right + w.right); - margins.setBottom(margins.bottom() - m.bottom + w.bottom); - margins.setTop(margins.top() - w.top + m.top); - } else { - dleft = dtop = 0; - } + // margins.setLeft(margins.left() - w.left + m.left); + // margins.setRight(margins.right() - m.right + w.right); + // margins.setBottom(margins.bottom() - m.bottom + w.bottom); + // margins.setTop(margins.top() - w.top + m.top); + //} else { + // dleft = dtop = 0; + //} - QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); - i->setWindowProperty(windowHandle()->handle(), qsl("WindowsCustomMargins"), QVariant::fromValue(margins)); - if (!themeInited) { - themeInited = true; - if (useTheme) { - if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) { - setWindowTheme(ps_hWnd, L" ", L" "); - QApplication::setStyle(QStyleFactory::create(qsl("Windows"))); - } - } - } + //QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); + //i->setWindowProperty(windowHandle()->handle(), qsl("WindowsCustomMargins"), QVariant::fromValue(margins)); + //if (!themeInited) { + // themeInited = true; + // if (useTheme) { + // if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) { + // setWindowTheme(ps_hWnd, L" ", L" "); + // QApplication::setStyle(QStyleFactory::create(qsl("Windows"))); + // } + // } + //} } void PsMainWindow::psFlash() { - if (GetForegroundWindow() == ps_hWnd) return; + //if (GetForegroundWindow() == ps_hWnd) return; - FLASHWINFO info; - info.cbSize = sizeof(info); - info.hwnd = ps_hWnd; - info.dwFlags = FLASHW_ALL; - info.dwTimeout = 0; - info.uCount = 1; - FlashWindowEx(&info); + //FLASHWINFO info; + //info.cbSize = sizeof(info); + //info.hwnd = ps_hWnd; + //info.dwFlags = FLASHW_ALL; + //info.dwTimeout = 0; + //info.uCount = 1; + //FlashWindowEx(&info); } HWND PsMainWindow::psHwnd() const { @@ -1456,40 +1467,40 @@ HMENU PsMainWindow::psMenu() const { } void PsMainWindow::psDestroyIcons() { - if (ps_iconBig) { - DestroyIcon(ps_iconBig); - ps_iconBig = 0; - } - if (ps_iconSmall) { - DestroyIcon(ps_iconSmall); - ps_iconSmall = 0; - } - if (ps_iconOverlay) { - DestroyIcon(ps_iconOverlay); - ps_iconOverlay = 0; - } + //if (ps_iconBig) { + // DestroyIcon(ps_iconBig); + // ps_iconBig = 0; + // } + // if (ps_iconSmall) { + // DestroyIcon(ps_iconSmall); + // ps_iconSmall = 0; + // } + //if (ps_iconOverlay) { + // DestroyIcon(ps_iconOverlay); + // ps_iconOverlay = 0; + //} } PsMainWindow::~PsMainWindow() { - if (useWtsapi) { - QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); - if (HWND hWnd = static_cast(i->nativeResourceForWindow(QByteArrayLiteral("handle"), windowHandle()))) { - wtsUnRegisterSessionNotification(hWnd); - } - } + //if (useWtsapi) { + // QPlatformNativeInterface *i = QGuiApplication::platformNativeInterface(); + // if (HWND hWnd = static_cast(i->nativeResourceForWindow(QByteArrayLiteral("handle"), windowHandle()))) { + // wtsUnRegisterSessionNotification(hWnd); + // } + //} - if (taskbarList) taskbarList.Reset(); + //if (taskbarList) taskbarList.Reset(); - toastNotifications.clear(); - if (toastNotificationManager) toastNotificationManager.Reset(); - if (toastNotifier) toastNotifier.Reset(); - if (toastNotificationFactory) toastNotificationFactory.Reset(); + //toastNotifications.clear(); + //if (toastNotificationManager) toastNotificationManager.Reset(); + //if (toastNotifier) toastNotifier.Reset(); + //if (toastNotificationFactory) toastNotificationFactory.Reset(); finished = true; - if (ps_menu) DestroyMenu(ps_menu); + //if (ps_menu) DestroyMenu(ps_menu); psDestroyIcons(); - _psShadowWindows.destroy(); - if (ps_tbHider_hWnd) DestroyWindow(ps_tbHider_hWnd); + //_psShadowWindows.destroy(); + //if (ps_tbHider_hWnd) DestroyWindow(ps_tbHider_hWnd); } namespace { @@ -1501,15 +1512,15 @@ QRect psDesktopRect() { uint64 tnow = getms(); if (tnow > _monitorLastGot + 1000 || tnow < _monitorLastGot) { _monitorLastGot = tnow; - HMONITOR hMonitor = MonitorFromWindow(App::wnd()->psHwnd(), MONITOR_DEFAULTTONEAREST); - if (hMonitor) { - MONITORINFOEX info; - info.cbSize = sizeof(info); - GetMonitorInfo(hMonitor, &info); - _monitorRect = QRect(info.rcWork.left, info.rcWork.top, info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top); - } else { + //HMONITOR hMonitor = MonitorFromWindow(App::wnd()->psHwnd(), MONITOR_DEFAULTTONEAREST); + //if (hMonitor) { + // MONITORINFOEX info; + // info.cbSize = sizeof(info); + // GetMonitorInfo(hMonitor, &info); + // _monitorRect = QRect(info.rcWork.left, info.rcWork.top, info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top); + //} else { _monitorRect = QApplication::desktop()->availableGeometry(App::wnd()); - } + //} } return _monitorRect; } @@ -1524,28 +1535,28 @@ void PsMainWindow::psActivateNotify(NotifyWindow *w) { } void PsMainWindow::psClearNotifies(PeerId peerId) { - if (!toastNotifier) return; + //if (!toastNotifier) return; - if (peerId) { - ToastNotifications::iterator i = toastNotifications.find(peerId); - if (i != toastNotifications.cend()) { - QMap temp = i.value(); - toastNotifications.erase(i); + //if (peerId) { + // ToastNotifications::iterator i = toastNotifications.find(peerId); + // if (i != toastNotifications.cend()) { + // QMap temp = i.value(); + // toastNotifications.erase(i); - for (QMap::const_iterator j = temp.cbegin(), e = temp.cend(); j != e; ++j) { - toastNotifier->Hide(j->p.Get()); - } - } - } else { - ToastNotifications temp = toastNotifications; - toastNotifications.clear(); + // for (QMap::const_iterator j = temp.cbegin(), e = temp.cend(); j != e; ++j) { + // toastNotifier->Hide(j->p.Get()); + // } + // } + //} else { + // ToastNotifications temp = toastNotifications; + // toastNotifications.clear(); - for (ToastNotifications::const_iterator i = temp.cbegin(), end = temp.cend(); i != end; ++i) { - for (QMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - toastNotifier->Hide(j->p.Get()); - } - } - } + // for (ToastNotifications::const_iterator i = temp.cbegin(), end = temp.cend(); i != end; ++i) { + // for (QMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { + // toastNotifier->Hide(j->p.Get()); + // } + // } + //} } void PsMainWindow::psNotifyShown(NotifyWindow *w) { @@ -1557,7 +1568,7 @@ void PsMainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) { bool showpix = (!App::passcoded() && cNotifyView() <= dbinvShowName); QString msg = (!App::passcoded() && cNotifyView() <= dbinvShowPreview) ? (fwdCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, fwdCount)) : lang(lng_notification_preview); - CreateToast(item->history()->peer, item->id, showpix, title, subtitle, msg); +// CreateToast(item->history()->peer, item->id, showpix, title, subtitle, msg); } QAbstractNativeEventFilter *psNativeEventFilter() { @@ -1571,40 +1582,40 @@ void psDeleteDir(const QString &dir) { WCHAR path[4096]; memcpy(path, wDir.c_str(), (wDir.size() + 1) * sizeof(WCHAR)); path[wDir.size() + 1] = 0; - SHFILEOPSTRUCT file_op = { - NULL, - FO_DELETE, - path, - L"", - FOF_NOCONFIRMATION | - FOF_NOERRORUI | - FOF_SILENT, - false, - 0, - L"" - }; - int res = SHFileOperation(&file_op); + //SHFILEOPSTRUCT file_op = { + // NULL, + // FO_DELETE, + // path, + // L"", + // FOF_NOCONFIRMATION | + // FOF_NOERRORUI | + // FOF_SILENT, + // false, + // 0, + // L"" + //}; + //int res = SHFileOperation(&file_op); } namespace { BOOL CALLBACK _ActivateProcess(HWND hWnd, LPARAM lParam) { - uint64 &processId(*(uint64*)lParam); + //uint64 &processId(*(uint64*)lParam); - DWORD dwProcessId; - ::GetWindowThreadProcessId(hWnd, &dwProcessId); + //DWORD dwProcessId; + //::GetWindowThreadProcessId(hWnd, &dwProcessId); - if ((uint64)dwProcessId == processId) { // found top-level window - static const int32 nameBufSize = 1024; - WCHAR nameBuf[nameBufSize]; - int32 len = GetWindowText(hWnd, nameBuf, nameBufSize); - if (len && len < nameBufSize) { - if (QRegularExpression(qsl("^Telegram(\\s*\\(\\d+\\))?$")).match(QString::fromStdWString(nameBuf)).hasMatch()) { - BOOL res = ::SetForegroundWindow(hWnd); - ::SetFocus(hWnd); - return FALSE; - } - } - } + //if ((uint64)dwProcessId == processId) { // found top-level window + // static const int32 nameBufSize = 1024; + // WCHAR nameBuf[nameBufSize]; + // int32 len = GetWindowText(hWnd, nameBuf, nameBufSize); + // if (len && len < nameBufSize) { + // if (QRegularExpression(qsl("^Telegram(\\s*\\(\\d+\\))?$")).match(QString::fromStdWString(nameBuf)).hasMatch()) { + // BOOL res = ::SetForegroundWindow(hWnd); + // ::SetFocus(hWnd); + // return FALSE; + // } + // } + //} return TRUE; } } @@ -1619,30 +1630,32 @@ void psUserActionDone() { } bool psIdleSupported() { - LASTINPUTINFO lii; - lii.cbSize = sizeof(LASTINPUTINFO); - return GetLastInputInfo(&lii); + //LASTINPUTINFO lii; + //lii.cbSize = sizeof(LASTINPUTINFO); + //return GetLastInputInfo(&lii); + return false; } uint64 psIdleTime() { - LASTINPUTINFO lii; - lii.cbSize = sizeof(LASTINPUTINFO); - return GetLastInputInfo(&lii) ? (GetTickCount() - lii.dwTime) : (getms(true) - _lastUserAction); + //LASTINPUTINFO lii; + //lii.cbSize = sizeof(LASTINPUTINFO); + //return GetLastInputInfo(&lii) ? (GetTickCount() - lii.dwTime) : (getms(true) - _lastUserAction); + return (getms(true) - _lastUserAction); } bool psSkipAudioNotify() { - QUERY_USER_NOTIFICATION_STATE state; - if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { - if (state == QUNS_NOT_PRESENT || state == QUNS_PRESENTATION_MODE) return true; - } + //QUERY_USER_NOTIFICATION_STATE state; + //if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { + // if (state == QUNS_NOT_PRESENT || state == QUNS_PRESENTATION_MODE) return true; + //} return sessionLoggedOff; } bool psSkipDesktopNotify() { - QUERY_USER_NOTIFICATION_STATE state; - if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { - if (state == QUNS_PRESENTATION_MODE || state == QUNS_RUNNING_D3D_FULL_SCREEN/* || state == QUNS_BUSY*/) return true; - } + //QUERY_USER_NOTIFICATION_STATE state; + //if (useShellapi && SUCCEEDED(shQueryUserNotificationState(&state))) { + // if (state == QUNS_PRESENTATION_MODE || state == QUNS_RUNNING_D3D_FULL_SCREEN/* || state == QUNS_BUSY*/) return true; + //} return false; } @@ -1656,17 +1669,17 @@ void psClearInitLogs() { void psActivateProcess(uint64 pid) { if (pid) { - ::EnumWindows((WNDENUMPROC)_ActivateProcess, (LPARAM)&pid); + //::EnumWindows((WNDENUMPROC)_ActivateProcess, (LPARAM)&pid); } } QString psCurrentCountry() { - int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, 0, 0); - if (chCount && chCount < 128) { - WCHAR wstrCountry[128]; - int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, wstrCountry, chCount); - return len ? QString::fromStdWString(std::wstring(wstrCountry)) : QString::fromLatin1(DefaultCountry); - } + //int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, 0, 0); + //if (chCount && chCount < 128) { + // WCHAR wstrCountry[128]; + // int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, wstrCountry, chCount); + // return len ? QString::fromStdWString(std::wstring(wstrCountry)) : QString::fromLatin1(DefaultCountry); + //} return QString::fromLatin1(DefaultCountry); } @@ -1792,56 +1805,56 @@ namespace { } QString psCurrentLanguage() { - int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, 0, 0); - if (chCount && chCount < 128) { - WCHAR wstrLocale[128]; - int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, wstrLocale, chCount); - if (!len) return QString::fromLatin1(DefaultLanguage); - QString locale = QString::fromStdWString(std::wstring(wstrLocale)); - QRegularExpressionMatch m = QRegularExpression("(^|[^a-z])([a-z]{2})-").match(locale); - if (m.hasMatch()) { - return m.captured(2); - } - } - chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, 0, 0); - if (chCount && chCount < 128) { - WCHAR wstrLocale[128]; - int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, wstrLocale, chCount), lngId = 0; - if (len < 5) return QString::fromLatin1(DefaultLanguage); + //int chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, 0, 0); + //if (chCount && chCount < 128) { + // WCHAR wstrLocale[128]; + // int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SNAME, wstrLocale, chCount); + // if (!len) return QString::fromLatin1(DefaultLanguage); + // QString locale = QString::fromStdWString(std::wstring(wstrLocale)); + // QRegularExpressionMatch m = QRegularExpression("(^|[^a-z])([a-z]{2})-").match(locale); + // if (m.hasMatch()) { + // return m.captured(2); + // } + //} + //chCount = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, 0, 0); + //if (chCount && chCount < 128) { + // WCHAR wstrLocale[128]; + // int len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, wstrLocale, chCount), lngId = 0; + // if (len < 5) return QString::fromLatin1(DefaultLanguage); - for (int i = 0; i < 4; ++i) { - WCHAR ch = wstrLocale[i]; - lngId *= 16; - if (ch >= WCHAR('0') && ch <= WCHAR('9')) { - lngId += (ch - WCHAR('0')); - } else if (ch >= WCHAR('A') && ch <= WCHAR('F')) { - lngId += (10 + ch - WCHAR('A')); - } else { - return QString::fromLatin1(DefaultLanguage); - } - } - return langById(lngId); - } + // for (int i = 0; i < 4; ++i) { + // WCHAR ch = wstrLocale[i]; + // lngId *= 16; + // if (ch >= WCHAR('0') && ch <= WCHAR('9')) { + // lngId += (ch - WCHAR('0')); + // } else if (ch >= WCHAR('A') && ch <= WCHAR('F')) { + // lngId += (10 + ch - WCHAR('A')); + // } else { + // return QString::fromLatin1(DefaultLanguage); + // } + // } + // return langById(lngId); + //} return QString::fromLatin1(DefaultLanguage); } QString psAppDataPath() { static const int maxFileLen = MAX_PATH * 10; - WCHAR wstrPath[maxFileLen]; - if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { - QDir appData(QString::fromStdWString(std::wstring(wstrPath))); - return appData.absolutePath() + '/' + QString::fromWCharArray(AppName) + '/'; - } + //WCHAR wstrPath[maxFileLen]; + //if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + // QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + // return appData.absolutePath() + '/' + QString::fromWCharArray(AppName) + '/'; + //} return QString(); } QString psAppDataPathOld() { static const int maxFileLen = MAX_PATH * 10; - WCHAR wstrPath[maxFileLen]; - if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { - QDir appData(QString::fromStdWString(std::wstring(wstrPath))); - return appData.absolutePath() + '/' + QString::fromWCharArray(AppNameOld) + '/'; - } + //WCHAR wstrPath[maxFileLen]; + //if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + // QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + // return appData.absolutePath() + '/' + QString::fromWCharArray(AppNameOld) + '/'; + //} return QString(); } @@ -1850,30 +1863,30 @@ QString psDownloadPath() { } QString psCurrentExeDirectory(int argc, char *argv[]) { - LPWSTR *args; - int argsCount; - args = CommandLineToArgvW(GetCommandLine(), &argsCount); - if (args) { - QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); - if (info.isFile()) { - return info.absoluteDir().absolutePath() + '/'; - } - LocalFree(args); - } + //LPWSTR *args; + //int argsCount; + //args = CommandLineToArgvW(GetCommandLine(), &argsCount); + //if (args) { + // QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); + // if (info.isFile()) { + // return info.absoluteDir().absolutePath() + '/'; + // } + // LocalFree(args); + //} return QString(); } QString psCurrentExeName(int argc, char *argv[]) { - LPWSTR *args; - int argsCount; - args = CommandLineToArgvW(GetCommandLine(), &argsCount); - if (args) { - QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); - if (info.isFile()) { - return info.fileName(); - } - LocalFree(args); - } + //LPWSTR *args; + //int argsCount; + //args = CommandLineToArgvW(GetCommandLine(), &argsCount); + //if (args) { + // QFileInfo info(QDir::fromNativeSeparators(QString::fromWCharArray(args[0]))); + // if (info.isFile()) { + // return info.fileName(); + // } + // LocalFree(args); + //} return QString(); } @@ -1900,50 +1913,50 @@ int psCleanup() { void psDoFixPrevious() { try { - static const int bufSize = 4096; - DWORD checkType, checkSize = bufSize * 2; - WCHAR checkStr[bufSize]; + //static const int bufSize = 4096; + //DWORD checkType, checkSize = bufSize * 2; + //WCHAR checkStr[bufSize]; - QString appId = QString::fromStdWString(AppId); - QString newKeyStr1 = QString("Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); - QString newKeyStr2 = QString("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); - QString oldKeyStr1 = QString("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); - QString oldKeyStr2 = QString("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); - HKEY newKey1, newKey2, oldKey1, oldKey2; - LSTATUS newKeyRes1 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr1.toStdWString().c_str(), 0, KEY_READ, &newKey1); - LSTATUS newKeyRes2 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr2.toStdWString().c_str(), 0, KEY_READ, &newKey2); - LSTATUS oldKeyRes1 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str(), 0, KEY_READ, &oldKey1); - LSTATUS oldKeyRes2 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str(), 0, KEY_READ, &oldKey2); + //QString appId = QString::fromStdWString(AppId); + //QString newKeyStr1 = QString("Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + //QString newKeyStr2 = QString("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + //QString oldKeyStr1 = QString("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + //QString oldKeyStr2 = QString("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%1_is1").arg(appId); + //HKEY newKey1, newKey2, oldKey1, oldKey2; + //LSTATUS newKeyRes1 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr1.toStdWString().c_str(), 0, KEY_READ, &newKey1); + //LSTATUS newKeyRes2 = RegOpenKeyEx(HKEY_CURRENT_USER, newKeyStr2.toStdWString().c_str(), 0, KEY_READ, &newKey2); + //LSTATUS oldKeyRes1 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str(), 0, KEY_READ, &oldKey1); + //LSTATUS oldKeyRes2 = RegOpenKeyEx(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str(), 0, KEY_READ, &oldKey2); - bool existNew1 = (newKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(newKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; - bool existNew2 = (newKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(newKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; - bool existOld1 = (oldKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; - bool existOld2 = (oldKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + //bool existNew1 = (newKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(newKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + //bool existNew2 = (newKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(newKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + //bool existOld1 = (oldKeyRes1 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey1, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; + //bool existOld2 = (oldKeyRes2 == ERROR_SUCCESS) && (RegQueryValueEx(oldKey2, L"InstallDate", 0, &checkType, (BYTE*)checkStr, &checkSize) == ERROR_SUCCESS); checkSize = bufSize * 2; - if (newKeyRes1 == ERROR_SUCCESS) RegCloseKey(newKey1); - if (newKeyRes2 == ERROR_SUCCESS) RegCloseKey(newKey2); - if (oldKeyRes1 == ERROR_SUCCESS) RegCloseKey(oldKey1); - if (oldKeyRes2 == ERROR_SUCCESS) RegCloseKey(oldKey2); + //if (newKeyRes1 == ERROR_SUCCESS) RegCloseKey(newKey1); + //if (newKeyRes2 == ERROR_SUCCESS) RegCloseKey(newKey2); + //if (oldKeyRes1 == ERROR_SUCCESS) RegCloseKey(oldKey1); + //if (oldKeyRes2 == ERROR_SUCCESS) RegCloseKey(oldKey2); - if (existNew1 || existNew2) { - oldKeyRes1 = existOld1 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str()) : ERROR_SUCCESS; - oldKeyRes2 = existOld2 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str()) : ERROR_SUCCESS; - } + //if (existNew1 || existNew2) { + // oldKeyRes1 = existOld1 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr1.toStdWString().c_str()) : ERROR_SUCCESS; + // oldKeyRes2 = existOld2 ? RegDeleteKey(HKEY_LOCAL_MACHINE, oldKeyStr2.toStdWString().c_str()) : ERROR_SUCCESS; + //} - QString userDesktopLnk, commonDesktopLnk; - WCHAR userDesktopFolder[MAX_PATH], commonDesktopFolder[MAX_PATH]; - HRESULT userDesktopRes = SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, userDesktopFolder); - HRESULT commonDesktopRes = SHGetFolderPath(0, CSIDL_COMMON_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, commonDesktopFolder); - if (SUCCEEDED(userDesktopRes)) { - userDesktopLnk = QString::fromWCharArray(userDesktopFolder) + "\\Telegram.lnk"; - } - if (SUCCEEDED(commonDesktopRes)) { - commonDesktopLnk = QString::fromWCharArray(commonDesktopFolder) + "\\Telegram.lnk"; - } - QFile userDesktopFile(userDesktopLnk), commonDesktopFile(commonDesktopLnk); - if (QFile::exists(userDesktopLnk) && QFile::exists(commonDesktopLnk) && userDesktopLnk != commonDesktopLnk) { - bool removed = QFile::remove(commonDesktopLnk); - } + //QString userDesktopLnk, commonDesktopLnk; + //WCHAR userDesktopFolder[MAX_PATH], commonDesktopFolder[MAX_PATH]; + //HRESULT userDesktopRes = SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, userDesktopFolder); + //HRESULT commonDesktopRes = SHGetFolderPath(0, CSIDL_COMMON_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, commonDesktopFolder); + //if (SUCCEEDED(userDesktopRes)) { + // userDesktopLnk = QString::fromWCharArray(userDesktopFolder) + "\\Telegram.lnk"; + //} + //if (SUCCEEDED(commonDesktopRes)) { + // commonDesktopLnk = QString::fromWCharArray(commonDesktopFolder) + "\\Telegram.lnk"; + //} + //QFile userDesktopFile(userDesktopLnk), commonDesktopFile(commonDesktopLnk); + //if (QFile::exists(userDesktopLnk) && QFile::exists(commonDesktopLnk) && userDesktopLnk != commonDesktopLnk) { + // bool removed = QFile::remove(commonDesktopLnk); + //} } catch (...) { } } @@ -1961,176 +1974,176 @@ int psFixPrevious() { } void psPostprocessFile(const QString &name) { - std::wstring zoneFile = QDir::toNativeSeparators(name).toStdWString() + L":Zone.Identifier"; - HANDLE f = CreateFile(zoneFile.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - if (f == INVALID_HANDLE_VALUE) { // :( - return; - } + //std::wstring zoneFile = QDir::toNativeSeparators(name).toStdWString() + L":Zone.Identifier"; + //HANDLE f = CreateFile(zoneFile.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + //if (f == INVALID_HANDLE_VALUE) { // :( + // return; + //} - const char data[] = "[ZoneTransfer]\r\nZoneId=3\r\n"; + //const char data[] = "[ZoneTransfer]\r\nZoneId=3\r\n"; - DWORD written = 0; - BOOL result = WriteFile(f, data, sizeof(data), &written, NULL); - CloseHandle(f); + //DWORD written = 0; + //BOOL result = WriteFile(f, data, sizeof(data), &written, NULL); + //CloseHandle(f); - if (!result || written != sizeof(data)) { // :( - return; - } + //if (!result || written != sizeof(data)) { // :( + // return; + //} } namespace { - struct OpenWithApp { - OpenWithApp(const QString &name, HBITMAP icon, IAssocHandler *handler) : name(name), icon(icon), handler(handler) { - } - OpenWithApp(const QString &name, IAssocHandler *handler) : name(name), icon(0), handler(handler) { - } - void destroy() { - if (icon) DeleteBitmap(icon); - if (handler) handler->Release(); - } - QString name; - HBITMAP icon; - IAssocHandler *handler; - }; + //struct OpenWithApp { + // OpenWithApp(const QString &name, HBITMAP icon, IAssocHandler *handler) : name(name), icon(icon), handler(handler) { + // } + // OpenWithApp(const QString &name, IAssocHandler *handler) : name(name), icon(0), handler(handler) { + // } + // void destroy() { + // if (icon) DeleteBitmap(icon); + // if (handler) handler->Release(); + // } + // QString name; + // HBITMAP icon; + // IAssocHandler *handler; + //}; - bool OpenWithAppLess(const OpenWithApp &a, const OpenWithApp &b) { - return a.name < b.name; - } + //bool OpenWithAppLess(const OpenWithApp &a, const OpenWithApp &b) { + // return a.name < b.name; + //} - HBITMAP _iconToBitmap(LPWSTR icon, int iconindex) { - if (!icon) return 0; - WCHAR tmpIcon[4096]; - if (icon[0] == L'@' && SUCCEEDED(SHLoadIndirectString(icon, tmpIcon, 4096, 0))) { - icon = tmpIcon; - } - int32 w = GetSystemMetrics(SM_CXSMICON), h = GetSystemMetrics(SM_CYSMICON); + //HBITMAP _iconToBitmap(LPWSTR icon, int iconindex) { + // if (!icon) return 0; + // WCHAR tmpIcon[4096]; + // if (icon[0] == L'@' && SUCCEEDED(SHLoadIndirectString(icon, tmpIcon, 4096, 0))) { + // icon = tmpIcon; + // } + // int32 w = GetSystemMetrics(SM_CXSMICON), h = GetSystemMetrics(SM_CYSMICON); - HICON ico = ExtractIcon(0, icon, iconindex); - if (!ico) { - if (!iconindex) { // try to read image - QImage img(QString::fromWCharArray(icon)); - if (!img.isNull()) { - return qt_pixmapToWinHBITMAP(QPixmap::fromImage(img.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)), /* HBitmapAlpha */ 2); - } - } - return 0; - } + // HICON ico = ExtractIcon(0, icon, iconindex); + // if (!ico) { + // if (!iconindex) { // try to read image + // QImage img(QString::fromWCharArray(icon)); + // if (!img.isNull()) { + // return qt_pixmapToWinHBITMAP(QPixmap::fromImage(img.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)), /* HBitmapAlpha */ 2); + // } + // } + // return 0; + // } - HDC screenDC = GetDC(0), hdc = CreateCompatibleDC(screenDC); - HBITMAP result = CreateCompatibleBitmap(screenDC, w, h); - HGDIOBJ was = SelectObject(hdc, result); - DrawIconEx(hdc, 0, 0, ico, w, h, 0, NULL, DI_NORMAL); - SelectObject(hdc, was); - DeleteDC(hdc); - ReleaseDC(0, screenDC); + // HDC screenDC = GetDC(0), hdc = CreateCompatibleDC(screenDC); + // HBITMAP result = CreateCompatibleBitmap(screenDC, w, h); + // HGDIOBJ was = SelectObject(hdc, result); + // DrawIconEx(hdc, 0, 0, ico, w, h, 0, NULL, DI_NORMAL); + // SelectObject(hdc, was); + // DeleteDC(hdc); + // ReleaseDC(0, screenDC); - DestroyIcon(ico); + // DestroyIcon(ico); - return (HBITMAP)CopyImage(result, IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_CREATEDIBSECTION); -// return result; - } + // return (HBITMAP)CopyImage(result, IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_CREATEDIBSECTION); + //} } bool psShowOpenWithMenu(int x, int y, const QString &file) { if (!useOpenWith || !App::wnd()) return false; - bool result = false; - QList handlers; - IShellItem* pItem = nullptr; - if (SUCCEEDED(shCreateItemFromParsingName(QDir::toNativeSeparators(file).toStdWString().c_str(), nullptr, IID_PPV_ARGS(&pItem)))) { - IEnumAssocHandlers *assocHandlers = 0; - if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_EnumAssocHandlers, IID_PPV_ARGS(&assocHandlers)))) { - HRESULT hr = S_FALSE; - do - { - IAssocHandler *handler = 0; - ULONG ulFetched = 0; - hr = assocHandlers->Next(1, &handler, &ulFetched); - if (FAILED(hr) || hr == S_FALSE || !ulFetched) break; + //bool result = false; + //QList handlers; + //IShellItem* pItem = nullptr; + //if (SUCCEEDED(shCreateItemFromParsingName(QDir::toNativeSeparators(file).toStdWString().c_str(), nullptr, IID_PPV_ARGS(&pItem)))) { + // IEnumAssocHandlers *assocHandlers = 0; + // if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_EnumAssocHandlers, IID_PPV_ARGS(&assocHandlers)))) { + // HRESULT hr = S_FALSE; + // do + // { + // IAssocHandler *handler = 0; + // ULONG ulFetched = 0; + // hr = assocHandlers->Next(1, &handler, &ulFetched); + // if (FAILED(hr) || hr == S_FALSE || !ulFetched) break; - LPWSTR name = 0; - if (SUCCEEDED(handler->GetUIName(&name))) { - LPWSTR icon = 0; - int iconindex = 0; - if (SUCCEEDED(handler->GetIconLocation(&icon, &iconindex)) && icon) { - handlers.push_back(OpenWithApp(QString::fromWCharArray(name), _iconToBitmap(icon, iconindex), handler)); - CoTaskMemFree(icon); - } else { - handlers.push_back(OpenWithApp(QString::fromWCharArray(name), handler)); - } - CoTaskMemFree(name); - } else { - handler->Release(); - } - } while (hr != S_FALSE); - assocHandlers->Release(); - } + // LPWSTR name = 0; + // if (SUCCEEDED(handler->GetUIName(&name))) { + // LPWSTR icon = 0; + // int iconindex = 0; + // if (SUCCEEDED(handler->GetIconLocation(&icon, &iconindex)) && icon) { + // handlers.push_back(OpenWithApp(QString::fromWCharArray(name), _iconToBitmap(icon, iconindex), handler)); + // CoTaskMemFree(icon); + // } else { + // handlers.push_back(OpenWithApp(QString::fromWCharArray(name), handler)); + // } + // CoTaskMemFree(name); + // } else { + // handler->Release(); + // } + // } while (hr != S_FALSE); + // assocHandlers->Release(); + // } - if (!handlers.isEmpty()) { - HMENU menu = CreatePopupMenu(); - std::sort(handlers.begin(), handlers.end(), OpenWithAppLess); - for (int32 i = 0, l = handlers.size(); i < l; ++i) { - MENUITEMINFO menuInfo = { 0 }; - menuInfo.cbSize = sizeof(menuInfo); - menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; - menuInfo.fType = MFT_STRING; - menuInfo.wID = i + 1; - if (handlers.at(i).icon) { - menuInfo.fMask |= MIIM_BITMAP; - menuInfo.hbmpItem = handlers.at(i).icon; - } + // if (!handlers.isEmpty()) { + // HMENU menu = CreatePopupMenu(); + // std::sort(handlers.begin(), handlers.end(), OpenWithAppLess); + // for (int32 i = 0, l = handlers.size(); i < l; ++i) { + // MENUITEMINFO menuInfo = { 0 }; + // menuInfo.cbSize = sizeof(menuInfo); + // menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; + // menuInfo.fType = MFT_STRING; + // menuInfo.wID = i + 1; + // if (handlers.at(i).icon) { + // menuInfo.fMask |= MIIM_BITMAP; + // menuInfo.hbmpItem = handlers.at(i).icon; + // } - QString name = handlers.at(i).name; - if (name.size() > 512) name = name.mid(0, 512); - WCHAR nameArr[1024]; - name.toWCharArray(nameArr); - nameArr[name.size()] = 0; - menuInfo.dwTypeData = nameArr; - InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); - } - MENUITEMINFO sepInfo = { 0 }; - sepInfo.cbSize = sizeof(sepInfo); - sepInfo.fMask = MIIM_STRING | MIIM_DATA; - sepInfo.fType = MFT_SEPARATOR; - InsertMenuItem(menu, GetMenuItemCount(menu), true, &sepInfo); + // QString name = handlers.at(i).name; + // if (name.size() > 512) name = name.mid(0, 512); + // WCHAR nameArr[1024]; + // name.toWCharArray(nameArr); + // nameArr[name.size()] = 0; + // menuInfo.dwTypeData = nameArr; + // InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); + // } + // MENUITEMINFO sepInfo = { 0 }; + // sepInfo.cbSize = sizeof(sepInfo); + // sepInfo.fMask = MIIM_STRING | MIIM_DATA; + // sepInfo.fType = MFT_SEPARATOR; + // InsertMenuItem(menu, GetMenuItemCount(menu), true, &sepInfo); - MENUITEMINFO menuInfo = { 0 }; - menuInfo.cbSize = sizeof(menuInfo); - menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; - menuInfo.fType = MFT_STRING; - menuInfo.wID = handlers.size() + 1; + // MENUITEMINFO menuInfo = { 0 }; + // menuInfo.cbSize = sizeof(menuInfo); + // menuInfo.fMask = MIIM_STRING | MIIM_DATA | MIIM_ID; + // menuInfo.fType = MFT_STRING; + // menuInfo.wID = handlers.size() + 1; - QString name = lang(lng_wnd_choose_program_menu); - if (name.size() > 512) name = name.mid(0, 512); - WCHAR nameArr[1024]; - name.toWCharArray(nameArr); - nameArr[name.size()] = 0; - menuInfo.dwTypeData = nameArr; - InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); + // QString name = lang(lng_wnd_choose_program_menu); + // if (name.size() > 512) name = name.mid(0, 512); + // WCHAR nameArr[1024]; + // name.toWCharArray(nameArr); + // nameArr[name.size()] = 0; + // menuInfo.dwTypeData = nameArr; + // InsertMenuItem(menu, GetMenuItemCount(menu), TRUE, &menuInfo); - int sel = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, x, y, 0, App::wnd()->psHwnd(), 0); - DestroyMenu(menu); + // int sel = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD, x, y, 0, App::wnd()->psHwnd(), 0); + // DestroyMenu(menu); - if (sel > 0) { - if (sel <= handlers.size()) { - IDataObject *dataObj = 0; - if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_DataObject, IID_PPV_ARGS(&dataObj))) && dataObj) { - handlers.at(sel - 1).handler->Invoke(dataObj); - dataObj->Release(); - result = true; - } - } - } else { - result = true; - } - for (int i = 0, l = handlers.size(); i < l; ++i) { - handlers[i].destroy(); - } - } + // if (sel > 0) { + // if (sel <= handlers.size()) { + // IDataObject *dataObj = 0; + // if (SUCCEEDED(pItem->BindToHandler(nullptr, BHID_DataObject, IID_PPV_ARGS(&dataObj))) && dataObj) { + // handlers.at(sel - 1).handler->Invoke(dataObj); + // dataObj->Release(); + // result = true; + // } + // } + // } else { + // result = true; + // } + // for (int i = 0, l = handlers.size(); i < l; ++i) { + // handlers[i].destroy(); + // } + // } - pItem->Release(); - } - return result; + // pItem->Release(); + //} + //return result; + return false; } void psOpenFile(const QString &name, bool openWith) { @@ -2138,27 +2151,27 @@ void psOpenFile(const QString &name, bool openWith) { std::wstring wname = mailtoScheme ? name.toStdWString() : QDir::toNativeSeparators(name).toStdWString(); if (openWith && useOpenAs) { - if (shOpenWithDialog) { - OPENASINFO info; - info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC; - if (mailtoScheme) info.oaifInFlags |= OAIF_FILE_IS_URI | OAIF_URL_PROTOCOL; - info.pcszClass = NULL; - info.pcszFile = wname.c_str(); - shOpenWithDialog(0, &info); - } else { - openAs_RunDLL(0, 0, wname.c_str(), SW_SHOWNORMAL); - } + //if (shOpenWithDialog) { + // OPENASINFO info; + // info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC; + // if (mailtoScheme) info.oaifInFlags |= OAIF_FILE_IS_URI | OAIF_URL_PROTOCOL; + // info.pcszClass = NULL; + // info.pcszFile = wname.c_str(); + // shOpenWithDialog(0, &info); + //} else { + // openAs_RunDLL(0, 0, wname.c_str(), SW_SHOWNORMAL); + //} } else { - ShellExecute(0, L"open", wname.c_str(), 0, 0, SW_SHOWNORMAL); + //ShellExecute(0, L"open", wname.c_str(), 0, 0, SW_SHOWNORMAL); } + QDesktopServices::openUrl(QUrl::fromLocalFile(name)); } void psShowInFolder(const QString &name) { - QString nameEscaped = QDir::toNativeSeparators(name).replace('"', qsl("\"\"")); - ShellExecute(0, 0, qsl("explorer").toStdWString().c_str(), (qsl("/select,") + nameEscaped).toStdWString().c_str(), 0, SW_SHOWNORMAL); + //QString nameEscaped = QDir::toNativeSeparators(name).replace('"', qsl("\"\"")); + //ShellExecute(0, 0, qsl("explorer").toStdWString().c_str(), (qsl("/select,") + nameEscaped).toStdWString().c_str(), 0, SW_SHOWNORMAL); } - namespace PlatformSpecific { void start() { @@ -2168,9 +2181,9 @@ namespace PlatformSpecific { delete _psEventFilter; _psEventFilter = 0; - if (ToastImageSavedFlag) { - psDeleteDir(cWorkingDir() + qsl("tdata/temp")); - } + //if (ToastImageSavedFlag) { + // psDeleteDir(cWorkingDir() + qsl("tdata/temp")); + //} } namespace ThirdParty { @@ -2184,74 +2197,74 @@ namespace PlatformSpecific { } namespace { - void _psLogError(const char *str, LSTATUS code) { - LPTSTR errorText = NULL, errorTextDefault = L"(Unknown error)"; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0); - if (!errorText) { - errorText = errorTextDefault; - } - LOG((str).arg(code).arg(QString::fromStdWString(errorText))); - if (errorText != errorTextDefault) { - LocalFree(errorText); - } - } + //void _psLogError(const char *str, LSTATUS code) { + // LPTSTR errorText = NULL, errorTextDefault = L"(Unknown error)"; + // FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0); + // if (!errorText) { + // errorText = errorTextDefault; + // } + // LOG((str).arg(code).arg(QString::fromStdWString(errorText))); + // if (errorText != errorTextDefault) { + // LocalFree(errorText); + // } + //} - bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { - DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); - LSTATUS status = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_QUERY_VALUE | KEY_WRITE, rkey); - if (status != ERROR_SUCCESS) { - if (status == ERROR_FILE_NOT_FOUND) { - status = RegCreateKeyEx(HKEY_CURRENT_USER, key, 0, 0, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE | KEY_WRITE, 0, rkey, 0); - if (status != ERROR_SUCCESS) { - QString msg = qsl("App Error: could not create '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); - _psLogError(msg.toUtf8().constData(), status); - return false; - } - } else { - QString msg = qsl("App Error: could not open '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); - _psLogError(msg.toUtf8().constData(), status); - return false; - } - } - return true; - } + //bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { + // DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + // LSTATUS status = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_QUERY_VALUE | KEY_WRITE, rkey); + // if (status != ERROR_SUCCESS) { + // if (status == ERROR_FILE_NOT_FOUND) { + // status = RegCreateKeyEx(HKEY_CURRENT_USER, key, 0, 0, REG_OPTION_NON_VOLATILE, KEY_QUERY_VALUE | KEY_WRITE, 0, rkey, 0); + // if (status != ERROR_SUCCESS) { + // QString msg = qsl("App Error: could not create '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); + // _psLogError(msg.toUtf8().constData(), status); + // return false; + // } + // } else { + // QString msg = qsl("App Error: could not open '%1' registry key, error %2").arg(QString::fromStdWString(key)).arg(qsl("%1: %2")); + // _psLogError(msg.toUtf8().constData(), status); + // return false; + // } + // } + // return true; + //} - bool _psSetKeyValue(HKEY rkey, LPCWSTR value, QString v) { - static const int bufSize = 4096; - DWORD defaultType, defaultSize = bufSize * 2; - WCHAR defaultStr[bufSize] = { 0 }; - if (RegQueryValueEx(rkey, value, 0, &defaultType, (BYTE*)defaultStr, &defaultSize) != ERROR_SUCCESS || defaultType != REG_SZ || defaultSize != (v.size() + 1) * 2 || QString::fromStdWString(defaultStr) != v) { - WCHAR tmp[bufSize] = { 0 }; - if (!v.isEmpty()) wsprintf(tmp, v.replace(QChar('%'), qsl("%%")).toStdWString().c_str()); - LSTATUS status = RegSetValueEx(rkey, value, 0, REG_SZ, (BYTE*)tmp, (wcslen(tmp) + 1) * sizeof(WCHAR)); - if (status != ERROR_SUCCESS) { - QString msg = qsl("App Error: could not set %1, error %2").arg(value ? ('\'' + QString::fromStdWString(value) + '\'') : qsl("(Default)")).arg("%1: %2"); - _psLogError(msg.toUtf8().constData(), status); - return false; - } - } - return true; - } + //bool _psSetKeyValue(HKEY rkey, LPCWSTR value, QString v) { + // static const int bufSize = 4096; + // DWORD defaultType, defaultSize = bufSize * 2; + // WCHAR defaultStr[bufSize] = { 0 }; + // if (RegQueryValueEx(rkey, value, 0, &defaultType, (BYTE*)defaultStr, &defaultSize) != ERROR_SUCCESS || defaultType != REG_SZ || defaultSize != (v.size() + 1) * 2 || QString::fromStdWString(defaultStr) != v) { + // WCHAR tmp[bufSize] = { 0 }; + // if (!v.isEmpty()) wsprintf(tmp, v.replace(QChar('%'), qsl("%%")).toStdWString().c_str()); + // LSTATUS status = RegSetValueEx(rkey, value, 0, REG_SZ, (BYTE*)tmp, (wcslen(tmp) + 1) * sizeof(WCHAR)); + // if (status != ERROR_SUCCESS) { + // QString msg = qsl("App Error: could not set %1, error %2").arg(value ? ('\'' + QString::fromStdWString(value) + '\'') : qsl("(Default)")).arg("%1: %2"); + // _psLogError(msg.toUtf8().constData(), status); + // return false; + // } + // } + // return true; + //} } void RegisterCustomScheme() { #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); - HKEY rkey; - QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); + //HKEY rkey; + //QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); - if (!_psOpenRegKey(L"Software\\Classes\\tg", &rkey)) return; - if (!_psSetKeyValue(rkey, L"URL Protocol", QString())) return; - if (!_psSetKeyValue(rkey, 0, qsl("URL:Telegram Link"))) return; + //if (!_psOpenRegKey(L"Software\\Classes\\tg", &rkey)) return; + //if (!_psSetKeyValue(rkey, L"URL Protocol", QString())) return; + //if (!_psSetKeyValue(rkey, 0, qsl("URL:Telegram Link"))) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\DefaultIcon", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return; + //if (!_psOpenRegKey(L"Software\\Classes\\tg\\DefaultIcon", &rkey)) return; + //if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return; + //if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell", &rkey)) return; + //if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; + //if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; + //if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return; #endif } @@ -2273,12 +2286,12 @@ void psExecUpdater() { QString updater(QDir::toNativeSeparators(updaterPath)), wdir(QDir::toNativeSeparators(cWorkingDir())); - DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + "Updater.exe").arg(targs)); - HINSTANCE r = ShellExecute(0, cWriteProtected() ? L"runas" : 0, updater.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); - if (long(r) < 32) { - DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(updater).arg(wdir).arg(long(r))); - psDeleteDir(cWorkingDir() + qsl("tupdates/temp")); - } + //DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + "Updater.exe").arg(targs)); + //HINSTANCE r = ShellExecute(0, cWriteProtected() ? L"runas" : 0, updater.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); + //if (long(r) < 32) { + // DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(updater).arg(wdir).arg(long(r))); + // psDeleteDir(cWorkingDir() + qsl("tupdates/temp")); + //} } void psExecTelegram(const QString &crashreport) { @@ -2296,66 +2309,66 @@ void psExecTelegram(const QString &crashreport) { DEBUG_LOG(("Application Info: executing %1 %2").arg(cExeDir() + cExeName()).arg(targs)); Logs::closeMain(); SignalHandlers::finish(); - HINSTANCE r = ShellExecute(0, 0, telegram.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); - if (long(r) < 32) { - DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(telegram).arg(wdir).arg(long(r))); - } + //HINSTANCE r = ShellExecute(0, 0, telegram.toStdWString().c_str(), targs.toStdWString().c_str(), wdir.isEmpty() ? 0 : wdir.toStdWString().c_str(), SW_SHOWNORMAL); + //if (long(r) < 32) { + // DEBUG_LOG(("Application Error: failed to execute %1, working directory: '%2', result: %3").arg(telegram).arg(wdir).arg(long(r))); + //} } void _manageAppLnk(bool create, bool silent, int path_csidl, const wchar_t *args, const wchar_t *description) { - WCHAR startupFolder[MAX_PATH]; - HRESULT hr = SHGetFolderPath(0, path_csidl, 0, SHGFP_TYPE_CURRENT, startupFolder); - if (SUCCEEDED(hr)) { - QString lnk = QString::fromWCharArray(startupFolder) + '\\' + QString::fromWCharArray(AppFile) + qsl(".lnk"); - if (create) { - ComPtr shellLink; - hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); - if (SUCCEEDED(hr)) { - ComPtr persistFile; + //WCHAR startupFolder[MAX_PATH]; + //HRESULT hr = SHGetFolderPath(0, path_csidl, 0, SHGFP_TYPE_CURRENT, startupFolder); + //if (SUCCEEDED(hr)) { + // QString lnk = QString::fromWCharArray(startupFolder) + '\\' + QString::fromWCharArray(AppFile) + qsl(".lnk"); + // if (create) { + // ComPtr shellLink; + // hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + // if (SUCCEEDED(hr)) { + // ComPtr persistFile; - QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()), dir = QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()); - shellLink->SetArguments(args); - shellLink->SetPath(exe.toStdWString().c_str()); - shellLink->SetWorkingDirectory(dir.toStdWString().c_str()); - shellLink->SetDescription(description); + // QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()), dir = QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()); + // shellLink->SetArguments(args); + // shellLink->SetPath(exe.toStdWString().c_str()); + // shellLink->SetWorkingDirectory(dir.toStdWString().c_str()); + // shellLink->SetDescription(description); - ComPtr propertyStore; - hr = shellLink.As(&propertyStore); - if (SUCCEEDED(hr)) { - PROPVARIANT appIdPropVar; - hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); - if (SUCCEEDED(hr)) { - hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); - PropVariantClear(&appIdPropVar); - if (SUCCEEDED(hr)) { - hr = propertyStore->Commit(); - } - } - } + // ComPtr propertyStore; + // hr = shellLink.As(&propertyStore); + // if (SUCCEEDED(hr)) { + // PROPVARIANT appIdPropVar; + // hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + // if (SUCCEEDED(hr)) { + // hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + // PropVariantClear(&appIdPropVar); + // if (SUCCEEDED(hr)) { + // hr = propertyStore->Commit(); + // } + // } + // } - hr = shellLink.As(&persistFile); - if (SUCCEEDED(hr)) { - hr = persistFile->Save(lnk.toStdWString().c_str(), TRUE); - } else { - if (!silent) LOG(("App Error: could not create interface IID_IPersistFile %1").arg(hr)); - } - } else { - if (!silent) LOG(("App Error: could not create instance of IID_IShellLink %1").arg(hr)); - } - } else { - QFile::remove(lnk); - } - } else { - if (!silent) LOG(("App Error: could not get CSIDL %1 folder %2").arg(path_csidl).arg(hr)); - } + // hr = shellLink.As(&persistFile); + // if (SUCCEEDED(hr)) { + // hr = persistFile->Save(lnk.toStdWString().c_str(), TRUE); + // } else { + // if (!silent) LOG(("App Error: could not create interface IID_IPersistFile %1").arg(hr)); + // } + // } else { + // if (!silent) LOG(("App Error: could not create instance of IID_IShellLink %1").arg(hr)); + // } + // } else { + // QFile::remove(lnk); + // } + //} else { + // if (!silent) LOG(("App Error: could not get CSIDL %1 folder %2").arg(path_csidl).arg(hr)); + //} } void psAutoStart(bool start, bool silent) { - _manageAppLnk(start, silent, CSIDL_STARTUP, L"-autostart", L"Telegram autorun link.\nYou can disable autorun in Telegram settings."); + //_manageAppLnk(start, silent, CSIDL_STARTUP, L"-autostart", L"Telegram autorun link.\nYou can disable autorun in Telegram settings."); } void psSendToMenu(bool send, bool silent) { - _manageAppLnk(send, silent, CSIDL_SENDTO, L"-sendpath", L"Telegram send to link.\nYou can disable send to menu item in Telegram settings."); + //_manageAppLnk(send, silent, CSIDL_SENDTO, L"-sendpath", L"Telegram send to link.\nYou can disable send to menu item in Telegram settings."); } void psUpdateOverlayed(TWidget *widget) { @@ -2372,1111 +2385,514 @@ void psUpdateOverlayed(TWidget *widget) { static const WCHAR *_programName = AppName; // folder in APPDATA, if current path is unavailable for writing static const WCHAR *_exeName = L"Telegram.exe"; -// Stack walk code is inspired by http://www.codeproject.com/Articles/11132/Walking-the-callstack - -static const int StackEntryMaxNameLength = MAX_SYM_NAME + 1; - -typedef BOOL(FAR STDAPICALLTYPE *t_SymCleanup)( - _In_ HANDLE hProcess -); -t_SymCleanup symCleanup = 0; - -typedef PVOID (FAR STDAPICALLTYPE *t_SymFunctionTableAccess64)( - _In_ HANDLE hProcess, - _In_ DWORD64 AddrBase -); -t_SymFunctionTableAccess64 symFunctionTableAccess64 = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_SymGetLineFromAddr64)( - _In_ HANDLE hProcess, - _In_ DWORD64 dwAddr, - _Out_ PDWORD pdwDisplacement, - _Out_ PIMAGEHLP_LINEW64 Line -); -t_SymGetLineFromAddr64 symGetLineFromAddr64 = 0; - -typedef DWORD64 (FAR STDAPICALLTYPE *t_SymGetModuleBase64)( - _In_ HANDLE hProcess, - _In_ DWORD64 qwAddr -); -t_SymGetModuleBase64 symGetModuleBase64 = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_SymGetModuleInfo64)( - _In_ HANDLE hProcess, - _In_ DWORD64 qwAddr, - _Out_ PIMAGEHLP_MODULEW64 ModuleInfo -); -t_SymGetModuleInfo64 symGetModuleInfo64 = 0; - -typedef DWORD (FAR STDAPICALLTYPE *t_SymGetOptions)( - VOID -); -t_SymGetOptions symGetOptions = 0; - -typedef DWORD (FAR STDAPICALLTYPE *t_SymSetOptions)( - _In_ DWORD SymOptions -); -t_SymSetOptions symSetOptions = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_SymGetSymFromAddr64)( - IN HANDLE hProcess, - IN DWORD64 dwAddr, - OUT PDWORD64 pdwDisplacement, - OUT PIMAGEHLP_SYMBOL64 Symbol -); -t_SymGetSymFromAddr64 symGetSymFromAddr64 = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_SymInitialize)( - _In_ HANDLE hProcess, - _In_opt_ PCWSTR UserSearchPath, - _In_ BOOL fInvadeProcess -); -t_SymInitialize symInitialize = 0; - -typedef DWORD64 (FAR STDAPICALLTYPE *t_SymLoadModule64)( - _In_ HANDLE hProcess, - _In_opt_ HANDLE hFile, - _In_opt_ PCSTR ImageName, - _In_opt_ PCSTR ModuleName, - _In_ DWORD64 BaseOfDll, - _In_ DWORD SizeOfDll -); -t_SymLoadModule64 symLoadModule64; - -typedef BOOL (FAR STDAPICALLTYPE *t_StackWalk64)( - _In_ DWORD MachineType, - _In_ HANDLE hProcess, - _In_ HANDLE hThread, - _Inout_ LPSTACKFRAME64 StackFrame, - _Inout_ PVOID ContextRecord, - _In_opt_ PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, - _In_opt_ PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, - _In_opt_ PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, - _In_opt_ PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress -); -t_StackWalk64 stackWalk64 = 0; - -typedef DWORD (FAR STDAPICALLTYPE *t_UnDecorateSymbolName)( - PCSTR DecoratedName, - PSTR UnDecoratedName, - DWORD UndecoratedLength, - DWORD Flags -); -t_UnDecorateSymbolName unDecorateSymbolName = 0; - -typedef BOOL(FAR STDAPICALLTYPE *t_SymGetSearchPath)( - _In_ HANDLE hProcess, - _Out_writes_(SearchPathLength) PWSTR SearchPath, - _In_ DWORD SearchPathLength -); -t_SymGetSearchPath symGetSearchPath = 0; - -BOOL __stdcall ReadProcessMemoryRoutine64( - _In_ HANDLE hProcess, - _In_ DWORD64 qwBaseAddress, - _Out_writes_bytes_(nSize) PVOID lpBuffer, - _In_ DWORD nSize, - _Out_ LPDWORD lpNumberOfBytesRead -) { - SIZE_T st; - BOOL bRet = ReadProcessMemory(hProcess, (LPVOID)qwBaseAddress, lpBuffer, nSize, &st); - *lpNumberOfBytesRead = (DWORD)st; - - return bRet; -} - -// **************************************** ToolHelp32 ************************ -#define MAX_MODULE_NAME32 255 -#define TH32CS_SNAPMODULE 0x00000008 -#pragma pack( push, 8 ) -typedef struct tagMODULEENTRY32 -{ - DWORD dwSize; - DWORD th32ModuleID; // This module - DWORD th32ProcessID; // owning process - DWORD GlblcntUsage; // Global usage count on the module - DWORD ProccntUsage; // Module usage count in th32ProcessID's context - BYTE * modBaseAddr; // Base address of module in th32ProcessID's context - DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr - HMODULE hModule; // The hModule of this module in th32ProcessID's context - char szModule[MAX_MODULE_NAME32 + 1]; - char szExePath[MAX_PATH]; -} MODULEENTRY32; -typedef MODULEENTRY32 *PMODULEENTRY32; -typedef MODULEENTRY32 *LPMODULEENTRY32; -#pragma pack( pop ) - -typedef HANDLE (FAR STDAPICALLTYPE *t_CreateToolhelp32Snapshot)(DWORD dwFlags, DWORD th32ProcessID); -t_CreateToolhelp32Snapshot createToolhelp32Snapshot = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_Module32First)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); -t_Module32First module32First = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_Module32Next)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); -t_Module32Next module32Next = 0; - -bool LoadDbgHelp(bool extended = false) { - if (stackWalk64 && (!extended || symInitialize)) return true; - - HMODULE hDll = 0; - - WCHAR szTemp[4096]; - if (GetModuleFileName(NULL, szTemp, 4096) > 0) { - wcscat_s(szTemp, L".local"); - if (GetFileAttributes(szTemp) == INVALID_FILE_ATTRIBUTES) { - // ".local" file does not exist, so we can try to load the dbghelp.dll from the "Debugging Tools for Windows" - if (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0) { - wcscat_s(szTemp, L"\\Debugging Tools for Windows\\dbghelp.dll"); - // now check if the file exists: - if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { - hDll = LoadLibrary(szTemp); - } - } - // Still not found? Then try to load the 64-Bit version: - if (!hDll && (GetEnvironmentVariable(L"ProgramFiles", szTemp, 4096) > 0)) { - wcscat_s(szTemp, L"\\Debugging Tools for Windows 64-Bit\\dbghelp.dll"); - if (GetFileAttributes(szTemp) != INVALID_FILE_ATTRIBUTES) { - hDll = LoadLibrary(szTemp); - } - } - } - } - if (!hDll) { - hDll = LoadLibrary(L"DBGHELP.DLL"); - } - - if (!hDll) return false; - - stackWalk64 = (t_StackWalk64)GetProcAddress(hDll, "StackWalk64"); - symFunctionTableAccess64 = (t_SymFunctionTableAccess64)GetProcAddress(hDll, "SymFunctionTableAccess64"); - symGetModuleBase64 = (t_SymGetModuleBase64)GetProcAddress(hDll, "SymGetModuleBase64"); - - if (!stackWalk64 || - !symFunctionTableAccess64 || - !symGetModuleBase64) { - stackWalk64 = 0; - return false; - } - - if (extended) { - HANDLE hProcess = GetCurrentProcess(); - DWORD dwProcessId = GetCurrentProcessId(); - - symGetLineFromAddr64 = (t_SymGetLineFromAddr64)GetProcAddress(hDll, "SymGetLineFromAddrW64"); - symGetModuleInfo64 = (t_SymGetModuleInfo64)GetProcAddress(hDll, "SymGetModuleInfoW64"); - symGetSymFromAddr64 = (t_SymGetSymFromAddr64)GetProcAddress(hDll, "SymGetSymFromAddr64"); - unDecorateSymbolName = (t_UnDecorateSymbolName)GetProcAddress(hDll, "UnDecorateSymbolName"); - symInitialize = (t_SymInitialize)GetProcAddress(hDll, "SymInitializeW"); - symCleanup = (t_SymCleanup)GetProcAddress(hDll, "SymCleanup"); - symGetSearchPath = (t_SymGetSearchPath)GetProcAddress(hDll, "SymGetSearchPathW"); - symGetOptions = (t_SymGetOptions)GetProcAddress(hDll, "SymGetOptions"); - symSetOptions = (t_SymSetOptions)GetProcAddress(hDll, "SymSetOptions"); - symLoadModule64 = (t_SymLoadModule64)GetProcAddress(hDll, "SymLoadModule64"); - if (!symGetModuleInfo64 || - !symGetLineFromAddr64 || - !symGetSymFromAddr64 || - !unDecorateSymbolName || - !symInitialize || - !symCleanup || - !symGetOptions || - !symSetOptions || - !symLoadModule64) { - symInitialize = 0; - return false; - } - - const size_t nSymPathLen = 10 * MAX_PATH; - WCHAR szSymPath[nSymPathLen] = { 0 }; - - wcscat_s(szSymPath, nSymPathLen, L".;..;"); - - WCHAR szTemp[MAX_PATH + 1] = { 0 }; - if (GetCurrentDirectory(MAX_PATH, szTemp) > 0) { - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - } - - if (GetModuleFileName(NULL, szTemp, MAX_PATH) > 0) { - for (WCHAR *p = (szTemp + wcslen(szTemp) - 1); p >= szTemp; --p) { - if ((*p == '\\') || (*p == '/') || (*p == ':')) { - *p = 0; - break; - } - } - if (wcslen(szTemp) > 0) { - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - } - } - if (GetEnvironmentVariable(L"_NT_SYMBOL_PATH", szTemp, MAX_PATH) > 0) { - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - } - if (GetEnvironmentVariable(L"_NT_ALTERNATE_SYMBOL_PATH", szTemp, MAX_PATH) > 0) { - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - } - if (GetEnvironmentVariable(L"SYSTEMROOT", szTemp, MAX_PATH) > 0) { - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - - // also add the "system32"-directory: - wcscat_s(szTemp, MAX_PATH, L"\\system32"); - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L";"); - } - - if (GetEnvironmentVariable(L"SYSTEMDRIVE", szTemp, MAX_PATH) > 0) { - wcscat_s(szSymPath, nSymPathLen, L"SRV*"); - wcscat_s(szSymPath, nSymPathLen, szTemp); - wcscat_s(szSymPath, nSymPathLen, L"\\websymbols*http://msdl.microsoft.com/download/symbols;"); - } else { - wcscat_s(szSymPath, nSymPathLen, L"SRV*c:\\websymbols*http://msdl.microsoft.com/download/symbols;"); - } - - if (symInitialize(hProcess, szSymPath, FALSE) == FALSE) { - symInitialize = 0; - return false; - } - - DWORD symOptions = symGetOptions(); - symOptions |= SYMOPT_LOAD_LINES; - symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; - symOptions = symSetOptions(symOptions); - - const WCHAR *dllname[] = { L"kernel32.dll", L"tlhelp32.dll" }; - HINSTANCE hToolhelp = NULL; - - HANDLE hSnap; - MODULEENTRY32 me; - me.dwSize = sizeof(me); - BOOL keepGoing; - size_t i; - - for (i = 0; i < (sizeof(dllname) / sizeof(dllname[0])); i++) { - hToolhelp = LoadLibrary(dllname[i]); - if (!hToolhelp) continue; - - createToolhelp32Snapshot = (t_CreateToolhelp32Snapshot)GetProcAddress(hToolhelp, "CreateToolhelp32Snapshot"); - module32First = (t_Module32First)GetProcAddress(hToolhelp, "Module32First"); - module32Next = (t_Module32Next)GetProcAddress(hToolhelp, "Module32Next"); - if (createToolhelp32Snapshot && module32First && module32Next) { - break; // found the functions! - } - FreeLibrary(hToolhelp); - hToolhelp = NULL; - } - - if (hToolhelp == NULL) { - return false; - } - - hSnap = createToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId); - if (hSnap == (HANDLE)-1) - return FALSE; - - keepGoing = !!module32First(hSnap, &me); - int cnt = 0; - while (keepGoing) { - symLoadModule64(hProcess, 0, me.szExePath, me.szModule, (DWORD64)me.modBaseAddr, me.modBaseSize); - ++cnt; - keepGoing = !!module32Next(hSnap, &me); - } - CloseHandle(hSnap); - FreeLibrary(hToolhelp); - - return (cnt > 0); - } - - return true; -} - -struct StackEntry { - DWORD64 offset; // if 0, we have no valid entry - CHAR name[StackEntryMaxNameLength]; - CHAR undName[StackEntryMaxNameLength]; - CHAR undFullName[StackEntryMaxNameLength]; - DWORD64 offsetFromSmybol; - DWORD offsetFromLine; - DWORD lineNumber; - WCHAR lineFileName[StackEntryMaxNameLength]; - DWORD symType; - LPCSTR symTypeString; - WCHAR moduleName[StackEntryMaxNameLength]; - DWORD64 baseOfImage; - WCHAR loadedImageName[StackEntryMaxNameLength]; -}; - -enum StackEntryType { - StackEntryFirst, - StackEntryNext, - StackEntryLast, -}; - -char GetModuleInfoData[2 * sizeof(IMAGEHLP_MODULEW64)]; -BOOL _getModuleInfo(HANDLE hProcess, DWORD64 baseAddr, IMAGEHLP_MODULEW64 *pModuleInfo) { - pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULEW64); - - memcpy(GetModuleInfoData, pModuleInfo, sizeof(IMAGEHLP_MODULEW64)); - if (symGetModuleInfo64(hProcess, baseAddr, (IMAGEHLP_MODULEW64*)GetModuleInfoData) != FALSE) { - // only copy as much memory as is reserved... - memcpy(pModuleInfo, GetModuleInfoData, sizeof(IMAGEHLP_MODULEW64)); - pModuleInfo->SizeOfStruct = sizeof(IMAGEHLP_MODULEW64); - return TRUE; - } - return FALSE; -} - void psWriteDump() { } -char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; -QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile) { - if (!LoadDbgHelp(true)) { - return qsl("ERROR: could not init dbghelp.dll!"); - } - - HANDLE hProcess = GetCurrentProcess(); - - QString initial = QString::fromUtf8(crashdump), result; - QStringList lines = initial.split('\n'); - result.reserve(initial.size()); - int32 i = 0, l = lines.size(); - QString versionstr; - uint64 version = 0, betaversion = 0; - for (; i < l; ++i) { - result.append(lines.at(i)).append('\n'); - QString line = lines.at(i).trimmed(); - if (line.startsWith(qstr("Version: "))) { - versionstr = line.mid(qstr("Version: ").size()).trimmed(); - version = versionstr.toULongLong(); - if (versionstr.endsWith(qstr("beta"))) { - if (version % 1000) { - betaversion = version; - } else { - version /= 1000; - } - } - ++i; - break; - } - } - - // maybe need to launch another executable - QString tolaunch; - if ((betaversion && betaversion != cBetaVersion()) || (!betaversion && version && version != AppVersion)) { - QString path = cExeDir(); - QRegularExpressionMatch m = QRegularExpression("deploy/\\d+\\.\\d+/\\d+\\.\\d+\\.\\d+(/|\\.dev/|_\\d+/)(Telegram/)?$").match(path); - if (m.hasMatch()) { - QString base = path.mid(0, m.capturedStart()) + qstr("deploy/"); - int32 major = version / 1000000, minor = (version % 1000000) / 1000, micro = (version % 1000); - base += qsl("%1.%2/%3.%4.%5").arg(major).arg(minor).arg(major).arg(minor).arg(micro); - if (betaversion) { - base += qsl("_%1").arg(betaversion); - } else if (QDir(base + qstr(".dev")).exists()) { - base += qstr(".dev"); - } - if (QFile(base + qstr("/Telegram/Telegram.exe")).exists()) { - base += qstr("/Telegram"); - } - tolaunch = base + qstr("Telegram.exe"); - } - } - if (!tolaunch.isEmpty()) { - result.append(qsl("ERROR: for this crashdump executable '%1' should be used!").arg(tolaunch)); - } - - while (i < l) { - for (; i < l; ++i) { - result.append(lines.at(i)).append('\n'); - QString line = lines.at(i).trimmed(); - if (line == qstr("Backtrace:")) { - ++i; - break; - } - } - - IMAGEHLP_SYMBOL64 *pSym = NULL; - IMAGEHLP_MODULEW64 Module; - IMAGEHLP_LINEW64 Line; - - pSym = (IMAGEHLP_SYMBOL64*)ImageHlpSymbol64; - memset(pSym, 0, sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength); - pSym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); - pSym->MaxNameLength = StackEntryMaxNameLength; - - memset(&Line, 0, sizeof(Line)); - Line.SizeOfStruct = sizeof(Line); - - memset(&Module, 0, sizeof(Module)); - Module.SizeOfStruct = sizeof(Module); - - StackEntry csEntry; - for (int32 start = i; i < l; ++i) { - QString line = lines.at(i).trimmed(); - if (line.isEmpty()) break; - - result.append(qsl("%1. ").arg(i + 1 - start)); - if (!QRegularExpression(qsl("^\\d+$")).match(line).hasMatch()) { - if (!lines.at(i).startsWith(qstr("ERROR: "))) { - result.append(qstr("BAD LINE: ")); - } - result.append(line).append('\n'); - continue; - } - - DWORD64 address = line.toULongLong(); - - csEntry.offset = address; - csEntry.name[0] = 0; - csEntry.undName[0] = 0; - csEntry.undFullName[0] = 0; - csEntry.offsetFromSmybol = 0; - csEntry.offsetFromLine = 0; - csEntry.lineFileName[0] = 0; - csEntry.lineNumber = 0; - csEntry.loadedImageName[0] = 0; - csEntry.moduleName[0] = 0; - - if (symGetSymFromAddr64(hProcess, address, &(csEntry.offsetFromSmybol), pSym) != FALSE) { - // TODO: Mache dies sicher...! - strcpy_s(csEntry.name, pSym->Name); - - unDecorateSymbolName(pSym->Name, csEntry.undName, StackEntryMaxNameLength, UNDNAME_NAME_ONLY); - unDecorateSymbolName(pSym->Name, csEntry.undFullName, StackEntryMaxNameLength, UNDNAME_COMPLETE); - - if (symGetLineFromAddr64) { - if (symGetLineFromAddr64(hProcess, address, &(csEntry.offsetFromLine), &Line) != FALSE) { - csEntry.lineNumber = Line.LineNumber; - - // TODO: Mache dies sicher...! - wcscpy_s(csEntry.lineFileName, Line.FileName); - } - } - } else { - result.append("ERROR: could not get Sym from Addr! for ").append(QString::number(address)).append('\n'); - continue; - } - - if (_getModuleInfo(hProcess, address, &Module) != FALSE) { - // TODO: Mache dies sicher...! - wcscpy_s(csEntry.moduleName, Module.ModuleName); - } - if (csEntry.name[0] == 0) { - strcpy_s(csEntry.name, "(function-name not available)"); - } - if (csEntry.undName[0] != 0) { - strcpy_s(csEntry.name, csEntry.undName); - } - if (csEntry.undFullName[0] != 0) { - strcpy_s(csEntry.name, csEntry.undFullName); - } - if (csEntry.lineFileName[0] == 0) { - if (csEntry.moduleName[0] == 0) { - wcscpy_s(csEntry.moduleName, L"module-name not available"); - } - result.append(csEntry.name).append(qsl(" (%1) 0x%3").arg(QString::fromWCharArray(csEntry.moduleName)).arg(address, 0, 16)).append('\n'); - } else { - QString file = QString::fromWCharArray(csEntry.lineFileName).toLower(); - int32 index = file.indexOf(qstr("tbuild\\tdesktop\\telegram\\")); - if (index >= 0) { - file = file.mid(index + qstr("tbuild\\tdesktop\\telegram\\").size()); - if (file.startsWith(qstr("sourcefiles\\"))) { - file = file.mid(qstr("sourcefiles\\").size()); - } - } - result.append(csEntry.name).append(qsl(" (%1 - %2) 0x%3").arg(file).arg(csEntry.lineNumber).arg(address, 0, 16)).append('\n'); - } - } - } - - symCleanup(hProcess); - return result; -} - -void psWriteStackTrace() { - if (!LoadDbgHelp()) { - SignalHandlers::dump() << "ERROR: Could not load dbghelp.dll!\n"; - return; - } - - HANDLE hThread = GetCurrentThread(), hProcess = GetCurrentProcess(); - const CONTEXT *context = NULL; - LPVOID pUserData = NULL; - - CONTEXT c; - int frameNum; - - memset(&c, 0, sizeof(CONTEXT)); - c.ContextFlags = CONTEXT_FULL; - RtlCaptureContext(&c); - - // init STACKFRAME for first call - STACKFRAME64 s; // in/out stackframe - memset(&s, 0, sizeof(s)); - DWORD imageType; -#ifdef _M_IX86 - // normally, call ImageNtHeader() and use machine info from PE header - imageType = IMAGE_FILE_MACHINE_I386; - s.AddrPC.Offset = c.Eip; - s.AddrPC.Mode = AddrModeFlat; - s.AddrFrame.Offset = c.Ebp; - s.AddrFrame.Mode = AddrModeFlat; - s.AddrStack.Offset = c.Esp; - s.AddrStack.Mode = AddrModeFlat; -#elif _M_X64 - imageType = IMAGE_FILE_MACHINE_AMD64; - s.AddrPC.Offset = c.Rip; - s.AddrPC.Mode = AddrModeFlat; - s.AddrFrame.Offset = c.Rsp; - s.AddrFrame.Mode = AddrModeFlat; - s.AddrStack.Offset = c.Rsp; - s.AddrStack.Mode = AddrModeFlat; -#elif _M_IA64 - imageType = IMAGE_FILE_MACHINE_IA64; - s.AddrPC.Offset = c.StIIP; - s.AddrPC.Mode = AddrModeFlat; - s.AddrFrame.Offset = c.IntSp; - s.AddrFrame.Mode = AddrModeFlat; - s.AddrBStore.Offset = c.RsBSP; - s.AddrBStore.Mode = AddrModeFlat; - s.AddrStack.Offset = c.IntSp; - s.AddrStack.Mode = AddrModeFlat; -#else -#error "Platform not supported!" -#endif - - for (frameNum = 0; frameNum < 1024; ++frameNum) { - // get next stack frame (StackWalk64(), SymFunctionTableAccess64(), SymGetModuleBase64()) - // if this returns ERROR_INVALID_ADDRESS (487) or ERROR_NOACCESS (998), you can - // assume that either you are done, or that the stack is so hosed that the next - // deeper frame could not be found. - // CONTEXT need not to be suplied if imageTyp is IMAGE_FILE_MACHINE_I386! - if (!stackWalk64(imageType, hProcess, hThread, &s, &c, ReadProcessMemoryRoutine64, symFunctionTableAccess64, symGetModuleBase64, NULL)) { - SignalHandlers::dump() << "ERROR: Call to StackWalk64() failed!\n"; - return; - } - - if (s.AddrPC.Offset == s.AddrReturn.Offset) { - SignalHandlers::dump() << s.AddrPC.Offset << "\n"; - SignalHandlers::dump() << "ERROR: StackWalk64() endless callstack!"; - return; - } - if (s.AddrPC.Offset != 0) { // we seem to have a valid PC - SignalHandlers::dump() << s.AddrPC.Offset << "\n"; - } - - if (s.AddrReturn.Offset == 0) { - break; - } - } -} - -class StringReferenceWrapper { -public: - - StringReferenceWrapper(_In_reads_(length) PCWSTR stringRef, _In_ UINT32 length) throw() { - HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); - if (!SUCCEEDED(hr)) { - RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); - } - } - - ~StringReferenceWrapper() { - windowsDeleteString(_hstring); - } - - template - StringReferenceWrapper(_In_reads_(N) wchar_t const (&stringRef)[N]) throw() { - UINT32 length = N - 1; - HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); - if (!SUCCEEDED(hr)) { - RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); - } - } - - template - StringReferenceWrapper(_In_reads_(_) wchar_t(&stringRef)[_]) throw() { - UINT32 length; - HRESULT hr = SizeTToUInt32(wcslen(stringRef), &length); - if (!SUCCEEDED(hr)) { - RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); - } - - windowsCreateStringReference(stringRef, length, &_header, &_hstring); - } - - HSTRING Get() const throw() { - return _hstring; - } - -private: - HSTRING _hstring; - HSTRING_HEADER _header; - -}; - -HRESULT SetNodeValueString(_In_ HSTRING inputString, _In_ IXmlNode *node, _In_ IXmlDocument *xml) { - ComPtr inputText; - - HRESULT hr = xml->CreateTextNode(inputString, &inputText); - if (!SUCCEEDED(hr)) return hr; - ComPtr inputTextNode; - - hr = inputText.As(&inputTextNode); - if (!SUCCEEDED(hr)) return hr; - - ComPtr pAppendedChild; - return node->AppendChild(inputTextNode.Get(), &pAppendedChild); -} - -HRESULT SetAudioSilent(_In_ IXmlDocument *toastXml) { - ComPtr nodeList; - HRESULT hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"audio").Get(), &nodeList); - if (!SUCCEEDED(hr)) return hr; - - ComPtr audioNode; - hr = nodeList->Item(0, &audioNode); - if (!SUCCEEDED(hr)) return hr; - - if (audioNode) { - ComPtr audioElement; - hr = audioNode.As(&audioElement); - if (!SUCCEEDED(hr)) return hr; - - hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); - if (!SUCCEEDED(hr)) return hr; - } else { - ComPtr audioElement; - hr = toastXml->CreateElement(StringReferenceWrapper(L"audio").Get(), &audioElement); - if (!SUCCEEDED(hr)) return hr; - - hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); - if (!SUCCEEDED(hr)) return hr; - - ComPtr audioNode; - hr = audioElement.As(&audioNode); - if (!SUCCEEDED(hr)) return hr; - - ComPtr nodeList; - hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"toast").Get(), &nodeList); - if (!SUCCEEDED(hr)) return hr; - - ComPtr toastNode; - hr = nodeList->Item(0, &toastNode); - if (!SUCCEEDED(hr)) return hr; - - ComPtr appendedNode; - hr = toastNode->AppendChild(audioNode.Get(), &appendedNode); - } - return hr; -} - -HRESULT SetImageSrc(_In_z_ const wchar_t *imagePath, _In_ IXmlDocument *toastXml) { - wchar_t imageSrc[MAX_PATH] = L"file:///"; - HRESULT hr = StringCchCat(imageSrc, ARRAYSIZE(imageSrc), imagePath); - if (!SUCCEEDED(hr)) return hr; - - ComPtr nodeList; - hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"image").Get(), &nodeList); - if (!SUCCEEDED(hr)) return hr; - - ComPtr imageNode; - hr = nodeList->Item(0, &imageNode); - if (!SUCCEEDED(hr)) return hr; - - ComPtr attributes; - hr = imageNode->get_Attributes(&attributes); - if (!SUCCEEDED(hr)) return hr; - - ComPtr srcAttribute; - hr = attributes->GetNamedItem(StringReferenceWrapper(L"src").Get(), &srcAttribute); - if (!SUCCEEDED(hr)) return hr; - - return SetNodeValueString(StringReferenceWrapper(imageSrc).Get(), srcAttribute.Get(), toastXml); -} - -typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastActivatedEventHandler; -typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastDismissedEventHandler; -typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastFailedEventHandler; - -class ToastEventHandler : public Implements { -public: - - ToastEventHandler::ToastEventHandler(const PeerId &peer, MsgId msg) : _ref(1), _peerId(peer), _msgId(msg) { - } - ~ToastEventHandler() { - } - - // DesktopToastActivatedEventHandler - IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IInspectable* args) { - ToastNotifications::iterator i = toastNotifications.find(_peerId); - if (i != toastNotifications.cend()) { - i.value().remove(_msgId); - if (i.value().isEmpty()) { - toastNotifications.erase(i); - } - } - if (App::wnd()) { - History *history = App::history(_peerId); - - App::wnd()->showFromTray(); - if (App::passcoded()) { - App::wnd()->setInnerFocus(); - App::wnd()->notifyClear(); - } else { - App::wnd()->hideSettings(); - bool tomsg = !history->peer->isUser() && (_msgId > 0); - if (tomsg) { - HistoryItem *item = App::histItemById(peerToChannel(_peerId), _msgId); - if (!item || !item->mentionsMe()) { - tomsg = false; - } - } - Ui::showPeerHistory(history, tomsg ? _msgId : ShowAtUnreadMsgId); - App::wnd()->notifyClear(history); - } - SetForegroundWindow(App::wnd()->psHwnd()); - } - return S_OK; - } - - // DesktopToastDismissedEventHandler - IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastDismissedEventArgs *e) { - ToastDismissalReason tdr; - if (SUCCEEDED(e->get_Reason(&tdr))) { - switch (tdr) { - case ToastDismissalReason_ApplicationHidden: - break; - case ToastDismissalReason_UserCanceled: - case ToastDismissalReason_TimedOut: - default: - ToastNotifications::iterator i = toastNotifications.find(_peerId); - if (i != toastNotifications.cend()) { - i.value().remove(_msgId); - if (i.value().isEmpty()) { - toastNotifications.erase(i); - } - } - break; - } - } - return S_OK; - } - - // DesktopToastFailedEventHandler - IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastFailedEventArgs *e) { - ToastNotifications::iterator i = toastNotifications.find(_peerId); - if (i != toastNotifications.cend()) { - i.value().remove(_msgId); - if (i.value().isEmpty()) { - toastNotifications.erase(i); - } - } - return S_OK; - } - - // IUnknown - IFACEMETHODIMP_(ULONG) AddRef() { - return InterlockedIncrement(&_ref); - } - - IFACEMETHODIMP_(ULONG) Release() { - ULONG l = InterlockedDecrement(&_ref); - if (l == 0) delete this; - return l; - } - - IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _COM_Outptr_ void **ppv) { - if (IsEqualIID(riid, IID_IUnknown)) - *ppv = static_cast(static_cast(this)); - else if (IsEqualIID(riid, __uuidof(DesktopToastActivatedEventHandler))) - *ppv = static_cast(this); - else if (IsEqualIID(riid, __uuidof(DesktopToastDismissedEventHandler))) - *ppv = static_cast(this); - else if (IsEqualIID(riid, __uuidof(DesktopToastFailedEventHandler))) - *ppv = static_cast(this); - else *ppv = nullptr; - - if (*ppv) { - reinterpret_cast(*ppv)->AddRef(); - return S_OK; - } - - return E_NOINTERFACE; - } - -private: - - ULONG _ref; - PeerId _peerId; - MsgId _msgId; -}; - -template -_Check_return_ __inline HRESULT _1_GetActivationFactory(_In_ HSTRING activatableClassId, _COM_Outptr_ T** factory) { - return roGetActivationFactory(activatableClassId, IID_INS_ARGS(factory)); -} - -template -inline HRESULT wrap_GetActivationFactory(_In_ HSTRING activatableClassId, _Inout_ Details::ComPtrRef factory) throw() { - return _1_GetActivationFactory(activatableClassId, factory.ReleaseAndGetAddressOf()); -} - -QString toastImage(const StorageKey &key, PeerData *peer) { - uint64 ms = getms(true); - ToastImages::iterator i = toastImages.find(key); - if (i != toastImages.cend()) { - if (i->until) { - i->until = ms + NotifyDeletePhotoAfter; - if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); - } - } else { - ToastImage v; - if (key.first) { - v.until = ms + NotifyDeletePhotoAfter; - if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); - } else { - v.until = 0; - } - v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); - if (key.first || key.second) { - peer->saveUserpic(v.path); - } else { - App::wnd()->iconLarge().save(v.path, "PNG"); - } - i = toastImages.insert(key, v); - ToastImageSavedFlag = true; - } - return i->path; -} - -bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg) { - if (!useToast || !toastNotificationManager || !toastNotifier || !toastNotificationFactory) return false; - - ComPtr toastXml; - bool withSubtitle = !subtitle.isEmpty(); - - HRESULT hr = toastNotificationManager->GetTemplateContent(withSubtitle ? ToastTemplateType_ToastImageAndText04 : ToastTemplateType_ToastImageAndText02, &toastXml); - if (!SUCCEEDED(hr)) return false; - - hr = SetAudioSilent(toastXml.Get()); - if (!SUCCEEDED(hr)) return false; - - StorageKey key; - QString imagePath; - if (showpix) { - key = peer->userpicUniqueKey(); - } else { - key = StorageKey(0, 0); - } - QString image = toastImage(key, peer); - std::wstring wimage = QDir::toNativeSeparators(image).toStdWString(); - - hr = SetImageSrc(wimage.c_str(), toastXml.Get()); - if (!SUCCEEDED(hr)) return false; - - ComPtr nodeList; - hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"text").Get(), &nodeList); - if (!SUCCEEDED(hr)) return false; - - UINT32 nodeListLength; - hr = nodeList->get_Length(&nodeListLength); - if (!SUCCEEDED(hr)) return false; - - if (nodeListLength < (withSubtitle ? 3U : 2U)) return false; - - { - ComPtr textNode; - hr = nodeList->Item(0, &textNode); - if (!SUCCEEDED(hr)) return false; - - std::wstring wtitle = title.toStdWString(); - hr = SetNodeValueString(StringReferenceWrapper(wtitle.data(), wtitle.size()).Get(), textNode.Get(), toastXml.Get()); - if (!SUCCEEDED(hr)) return false; - } - if (withSubtitle) { - ComPtr textNode; - hr = nodeList->Item(1, &textNode); - if (!SUCCEEDED(hr)) return false; - - std::wstring wsubtitle = subtitle.toStdWString(); - hr = SetNodeValueString(StringReferenceWrapper(wsubtitle.data(), wsubtitle.size()).Get(), textNode.Get(), toastXml.Get()); - if (!SUCCEEDED(hr)) return false; - } - { - ComPtr textNode; - hr = nodeList->Item(withSubtitle ? 2 : 1, &textNode); - if (!SUCCEEDED(hr)) return false; - - std::wstring wmsg = msg.toStdWString(); - hr = SetNodeValueString(StringReferenceWrapper(wmsg.data(), wmsg.size()).Get(), textNode.Get(), toastXml.Get()); - if (!SUCCEEDED(hr)) return false; - } - - ComPtr toast; - hr = toastNotificationFactory->CreateToastNotification(toastXml.Get(), &toast); - if (!SUCCEEDED(hr)) return false; - - EventRegistrationToken activatedToken, dismissedToken, failedToken; - ComPtr eventHandler(new ToastEventHandler(peer->id, msgId)); - - hr = toast->add_Activated(eventHandler.Get(), &activatedToken); - if (!SUCCEEDED(hr)) return false; - - hr = toast->add_Dismissed(eventHandler.Get(), &dismissedToken); - if (!SUCCEEDED(hr)) return false; - - hr = toast->add_Failed(eventHandler.Get(), &failedToken); - if (!SUCCEEDED(hr)) return false; - - ToastNotifications::iterator i = toastNotifications.find(peer->id); - if (i != toastNotifications.cend()) { - QMap::iterator j = i->find(msgId); - if (j != i->cend()) { - ComPtr notify = j->p; - i->erase(j); - toastNotifier->Hide(notify.Get()); - i = toastNotifications.find(peer->id); - } - } - if (i == toastNotifications.cend()) { - i = toastNotifications.insert(peer->id, QMap()); - } - hr = toastNotifier->Show(toast.Get()); - if (!SUCCEEDED(hr)) { - i = toastNotifications.find(peer->id); - if (i != toastNotifications.cend() && i->isEmpty()) toastNotifications.erase(i); - return false; - } - toastNotifications[peer->id].insert(msgId, toast); - - return true; -} +//class StringReferenceWrapper { +//public: +// +// StringReferenceWrapper(_In_reads_(length) PCWSTR stringRef, _In_ UINT32 length) throw() { +// HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); +// if (!SUCCEEDED(hr)) { +// RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); +// } +// } +// +// ~StringReferenceWrapper() { +// windowsDeleteString(_hstring); +// } +// +// template +// StringReferenceWrapper(_In_reads_(N) wchar_t const (&stringRef)[N]) throw() { +// UINT32 length = N - 1; +// HRESULT hr = windowsCreateStringReference(stringRef, length, &_header, &_hstring); +// if (!SUCCEEDED(hr)) { +// RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); +// } +// } +// +// template +// StringReferenceWrapper(_In_reads_(_) wchar_t(&stringRef)[_]) throw() { +// UINT32 length; +// HRESULT hr = SizeTToUInt32(wcslen(stringRef), &length); +// if (!SUCCEEDED(hr)) { +// RaiseException(static_cast(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr); +// } +// +// windowsCreateStringReference(stringRef, length, &_header, &_hstring); +// } +// +// HSTRING Get() const throw() { +// return _hstring; +// } +// +//private: +// HSTRING _hstring; +// HSTRING_HEADER _header; +// +//}; + +//HRESULT SetNodeValueString(_In_ HSTRING inputString, _In_ IXmlNode *node, _In_ IXmlDocument *xml) { +// ComPtr inputText; +// +// HRESULT hr = xml->CreateTextNode(inputString, &inputText); +// if (!SUCCEEDED(hr)) return hr; +// ComPtr inputTextNode; +// +// hr = inputText.As(&inputTextNode); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr pAppendedChild; +// return node->AppendChild(inputTextNode.Get(), &pAppendedChild); +//} + +//HRESULT SetAudioSilent(_In_ IXmlDocument *toastXml) { +// ComPtr nodeList; +// HRESULT hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"audio").Get(), &nodeList); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr audioNode; +// hr = nodeList->Item(0, &audioNode); +// if (!SUCCEEDED(hr)) return hr; +// +// if (audioNode) { +// ComPtr audioElement; +// hr = audioNode.As(&audioElement); +// if (!SUCCEEDED(hr)) return hr; +// +// hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); +// if (!SUCCEEDED(hr)) return hr; +// } else { +// ComPtr audioElement; +// hr = toastXml->CreateElement(StringReferenceWrapper(L"audio").Get(), &audioElement); +// if (!SUCCEEDED(hr)) return hr; +// +// hr = audioElement->SetAttribute(StringReferenceWrapper(L"silent").Get(), StringReferenceWrapper(L"true").Get()); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr audioNode; +// hr = audioElement.As(&audioNode); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr nodeList; +// hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"toast").Get(), &nodeList); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr toastNode; +// hr = nodeList->Item(0, &toastNode); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr appendedNode; +// hr = toastNode->AppendChild(audioNode.Get(), &appendedNode); +// } +// return hr; +//} + +//HRESULT SetImageSrc(_In_z_ const wchar_t *imagePath, _In_ IXmlDocument *toastXml) { +// wchar_t imageSrc[MAX_PATH] = L"file:///"; +// HRESULT hr = StringCchCat(imageSrc, ARRAYSIZE(imageSrc), imagePath); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr nodeList; +// hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"image").Get(), &nodeList); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr imageNode; +// hr = nodeList->Item(0, &imageNode); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr attributes; +// hr = imageNode->get_Attributes(&attributes); +// if (!SUCCEEDED(hr)) return hr; +// +// ComPtr srcAttribute; +// hr = attributes->GetNamedItem(StringReferenceWrapper(L"src").Get(), &srcAttribute); +// if (!SUCCEEDED(hr)) return hr; +// +// return SetNodeValueString(StringReferenceWrapper(imageSrc).Get(), srcAttribute.Get(), toastXml); +//} + +//typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastActivatedEventHandler; +//typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastDismissedEventHandler; +//typedef ABI::Windows::Foundation::ITypedEventHandler DesktopToastFailedEventHandler; + +//class ToastEventHandler : public Implements { +//public: +// +// ToastEventHandler::ToastEventHandler(const PeerId &peer, MsgId msg) : _ref(1), _peerId(peer), _msgId(msg) { +// } +// ~ToastEventHandler() { +// } +// +// // DesktopToastActivatedEventHandler +// IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IInspectable* args) { +// ToastNotifications::iterator i = toastNotifications.find(_peerId); +// if (i != toastNotifications.cend()) { +// i.value().remove(_msgId); +// if (i.value().isEmpty()) { +// toastNotifications.erase(i); +// } +// } +// if (App::wnd()) { +// History *history = App::history(_peerId); +// +// App::wnd()->showFromTray(); +// if (App::passcoded()) { +// App::wnd()->setInnerFocus(); +// App::wnd()->notifyClear(); +// } else { +// App::wnd()->hideSettings(); +// bool tomsg = !history->peer->isUser() && (_msgId > 0); +// if (tomsg) { +// HistoryItem *item = App::histItemById(peerToChannel(_peerId), _msgId); +// if (!item || !item->mentionsMe()) { +// tomsg = false; +// } +// } +// Ui::showPeerHistory(history, tomsg ? _msgId : ShowAtUnreadMsgId); +// App::wnd()->notifyClear(history); +// } +// //SetForegroundWindow(App::wnd()->psHwnd()); +// } +// return S_OK; +// } +// +// // DesktopToastDismissedEventHandler +// IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastDismissedEventArgs *e) { +// ToastDismissalReason tdr; +// if (SUCCEEDED(e->get_Reason(&tdr))) { +// switch (tdr) { +// case ToastDismissalReason_ApplicationHidden: +// break; +// case ToastDismissalReason_UserCanceled: +// case ToastDismissalReason_TimedOut: +// default: +// ToastNotifications::iterator i = toastNotifications.find(_peerId); +// if (i != toastNotifications.cend()) { +// i.value().remove(_msgId); +// if (i.value().isEmpty()) { +// toastNotifications.erase(i); +// } +// } +// break; +// } +// } +// return S_OK; +// } +// +// // DesktopToastFailedEventHandler +// IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IToastFailedEventArgs *e) { +// ToastNotifications::iterator i = toastNotifications.find(_peerId); +// if (i != toastNotifications.cend()) { +// i.value().remove(_msgId); +// if (i.value().isEmpty()) { +// toastNotifications.erase(i); +// } +// } +// return S_OK; +// } +// +// // IUnknown +// IFACEMETHODIMP_(ULONG) AddRef() { +// return InterlockedIncrement(&_ref); +// } +// +// IFACEMETHODIMP_(ULONG) Release() { +// ULONG l = InterlockedDecrement(&_ref); +// if (l == 0) delete this; +// return l; +// } +// +// IFACEMETHODIMP QueryInterface(_In_ REFIID riid, _COM_Outptr_ void **ppv) { +// if (IsEqualIID(riid, IID_IUnknown)) +// *ppv = static_cast(static_cast(this)); +// else if (IsEqualIID(riid, __uuidof(DesktopToastActivatedEventHandler))) +// *ppv = static_cast(this); +// else if (IsEqualIID(riid, __uuidof(DesktopToastDismissedEventHandler))) +// *ppv = static_cast(this); +// else if (IsEqualIID(riid, __uuidof(DesktopToastFailedEventHandler))) +// *ppv = static_cast(this); +// else *ppv = nullptr; +// +// if (*ppv) { +// reinterpret_cast(*ppv)->AddRef(); +// return S_OK; +// } +// +// return E_NOINTERFACE; +// } +// +//private: +// +// ULONG _ref; +// PeerId _peerId; +// MsgId _msgId; +//}; +// +//template +//_Check_return_ __inline HRESULT _1_GetActivationFactory(_In_ HSTRING activatableClassId, _COM_Outptr_ T** factory) { +// return roGetActivationFactory(activatableClassId, IID_INS_ARGS(factory)); +//} +// +//template +//inline HRESULT wrap_GetActivationFactory(_In_ HSTRING activatableClassId, _Inout_ Details::ComPtrRef factory) throw() { +// return _1_GetActivationFactory(activatableClassId, factory.ReleaseAndGetAddressOf()); +//} + +//QString toastImage(const StorageKey &key, PeerData *peer) { +// uint64 ms = getms(true); +// ToastImages::iterator i = toastImages.find(key); +// if (i != toastImages.cend()) { +// if (i->until) { +// i->until = ms + NotifyDeletePhotoAfter; +// if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); +// } +// } else { +// ToastImage v; +// if (key.first) { +// v.until = ms + NotifyDeletePhotoAfter; +// if (App::wnd()) App::wnd()->psCleanNotifyPhotosIn(-NotifyDeletePhotoAfter); +// } else { +// v.until = 0; +// } +// v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); +// if (key.first || key.second) { +// peer->saveUserpic(v.path); +// } else { +// App::wnd()->iconLarge().save(v.path, "PNG"); +// } +// i = toastImages.insert(key, v); +// ToastImageSavedFlag = true; +// } +// return i->path; +//} + +//bool CreateToast(PeerData *peer, int32 msgId, bool showpix, const QString &title, const QString &subtitle, const QString &msg) { +// if (!useToast || !toastNotificationManager || !toastNotifier || !toastNotificationFactory) return false; +// +// ComPtr toastXml; +// bool withSubtitle = !subtitle.isEmpty(); +// +// HRESULT hr = toastNotificationManager->GetTemplateContent(withSubtitle ? ToastTemplateType_ToastImageAndText04 : ToastTemplateType_ToastImageAndText02, &toastXml); +// if (!SUCCEEDED(hr)) return false; +// +// //hr = SetAudioSilent(toastXml.Get()); +// //if (!SUCCEEDED(hr)) return false; +// +// StorageKey key; +// QString imagePath; +// if (showpix) { +// key = peer->userpicUniqueKey(); +// } else { +// key = StorageKey(0, 0); +// } +// QString image = toastImage(key, peer); +// std::wstring wimage = QDir::toNativeSeparators(image).toStdWString(); +// +// //hr = SetImageSrc(wimage.c_str(), toastXml.Get()); +// //if (!SUCCEEDED(hr)) return false; +// +// ComPtr nodeList; +// //hr = toastXml->GetElementsByTagName(StringReferenceWrapper(L"text").Get(), &nodeList); +// //if (!SUCCEEDED(hr)) return false; +// +// UINT32 nodeListLength; +// hr = nodeList->get_Length(&nodeListLength); +// if (!SUCCEEDED(hr)) return false; +// +// if (nodeListLength < (withSubtitle ? 3U : 2U)) return false; +// +// { +// ComPtr textNode; +// hr = nodeList->Item(0, &textNode); +// if (!SUCCEEDED(hr)) return false; +// +// std::wstring wtitle = title.toStdWString(); +// //hr = SetNodeValueString(StringReferenceWrapper(wtitle.data(), wtitle.size()).Get(), textNode.Get(), toastXml.Get()); +// //if (!SUCCEEDED(hr)) return false; +// } +// if (withSubtitle) { +// ComPtr textNode; +// hr = nodeList->Item(1, &textNode); +// if (!SUCCEEDED(hr)) return false; +// +// std::wstring wsubtitle = subtitle.toStdWString(); +// //hr = SetNodeValueString(StringReferenceWrapper(wsubtitle.data(), wsubtitle.size()).Get(), textNode.Get(), toastXml.Get()); +// //if (!SUCCEEDED(hr)) return false; +// } +// { +// ComPtr textNode; +// hr = nodeList->Item(withSubtitle ? 2 : 1, &textNode); +// if (!SUCCEEDED(hr)) return false; +// +// std::wstring wmsg = msg.toStdWString(); +// //hr = SetNodeValueString(StringReferenceWrapper(wmsg.data(), wmsg.size()).Get(), textNode.Get(), toastXml.Get()); +// //if (!SUCCEEDED(hr)) return false; +// } +// +// ComPtr toast; +// hr = toastNotificationFactory->CreateToastNotification(toastXml.Get(), &toast); +// if (!SUCCEEDED(hr)) return false; +// +// //EventRegistrationToken activatedToken, dismissedToken, failedToken; +// //ComPtr eventHandler(new ToastEventHandler(peer->id, msgId)); +// +// //hr = toast->add_Activated(eventHandler.Get(), &activatedToken); +// //if (!SUCCEEDED(hr)) return false; +// +// //hr = toast->add_Dismissed(eventHandler.Get(), &dismissedToken); +// //if (!SUCCEEDED(hr)) return false; +// +// //hr = toast->add_Failed(eventHandler.Get(), &failedToken); +// //if (!SUCCEEDED(hr)) return false; +// +// ToastNotifications::iterator i = toastNotifications.find(peer->id); +// if (i != toastNotifications.cend()) { +// QMap::iterator j = i->find(msgId); +// if (j != i->cend()) { +// ComPtr notify = j->p; +// i->erase(j); +// toastNotifier->Hide(notify.Get()); +// i = toastNotifications.find(peer->id); +// } +// } +// if (i == toastNotifications.cend()) { +// i = toastNotifications.insert(peer->id, QMap()); +// } +// hr = toastNotifier->Show(toast.Get()); +// if (!SUCCEEDED(hr)) { +// i = toastNotifications.find(peer->id); +// if (i != toastNotifications.cend() && i->isEmpty()) toastNotifications.erase(i); +// return false; +// } +// toastNotifications[peer->id].insert(msgId, toast); +// +// return true; +//} QString pinnedPath() { - static const int maxFileLen = MAX_PATH * 10; - WCHAR wstrPath[maxFileLen]; - if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { - QDir appData(QString::fromStdWString(std::wstring(wstrPath))); - return appData.absolutePath() + qsl("/Microsoft/Internet Explorer/Quick Launch/User Pinned/TaskBar/"); - } + //static const int maxFileLen = MAX_PATH * 10; + //WCHAR wstrPath[maxFileLen]; + //if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + // QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + // return appData.absolutePath() + qsl("/Microsoft/Internet Explo7rer/Quick Launch/User Pinned/TaskBar/"); + //} return QString(); } void CheckPinnedAppUserModelId() { - if (!propVariantToString) return; + //if (!propVariantToString) return; - static const int maxFileLen = MAX_PATH * 10; + //static const int maxFileLen = MAX_PATH * 10; - HRESULT hr = CoInitialize(0); - if (!SUCCEEDED(hr)) return; + //HRESULT hr = CoInitialize(0); + //if (!SUCCEEDED(hr)) return; - QString path = pinnedPath(); - std::wstring p = QDir::toNativeSeparators(path).toStdWString(); + //QString path = pinnedPath(); + //std::wstring p = QDir::toNativeSeparators(path).toStdWString(); - WCHAR src[MAX_PATH]; - GetModuleFileName(GetModuleHandle(0), src, MAX_PATH); - BY_HANDLE_FILE_INFORMATION srcinfo = { 0 }; - HANDLE srcfile = CreateFile(src, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (srcfile == INVALID_HANDLE_VALUE) return; - BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); - CloseHandle(srcfile); - if (!srcres) return; - LOG(("Checking..")); - WIN32_FIND_DATA findData; - HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); - if (findHandle == INVALID_HANDLE_VALUE) { - LOG(("Init Error: could not find files in pinned folder")); - return; - } - do { - std::wstring fname = p + findData.cFileName; - LOG(("Checking %1").arg(QString::fromStdWString(fname))); - if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - continue; - } else { - DWORD attributes = GetFileAttributes(fname.c_str()); - if (attributes >= 0xFFFFFFF) continue; // file does not exist + //WCHAR src[MAX_PATH]; + //GetModuleFileName(GetModuleHandle(0), src, MAX_PATH); + //BY_HANDLE_FILE_INFORMATION srcinfo = { 0 }; + //HANDLE srcfile = CreateFile(src, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + //if (srcfile == INVALID_HANDLE_VALUE) return; + //BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); + //CloseHandle(srcfile); + //if (!srcres) return; + //LOG(("Checking..")); + //WIN32_FIND_DATA findData; + //HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); + //if (findHandle == INVALID_HANDLE_VALUE) { + // LOG(("Init Error: could not find files in pinned folder")); + // return; + //} + //do { + // std::wstring fname = p + findData.cFileName; + // LOG(("Checking %1").arg(QString::fromStdWString(fname))); + // if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + // continue; + // } else { + // DWORD attributes = GetFileAttributes(fname.c_str()); + // if (attributes >= 0xFFFFFFF) continue; // file does not exist - ComPtr shellLink; - HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); - if (!SUCCEEDED(hr)) continue; + // ComPtr shellLink; + // HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + // if (!SUCCEEDED(hr)) continue; - ComPtr persistFile; - hr = shellLink.As(&persistFile); - if (!SUCCEEDED(hr)) continue; + // ComPtr persistFile; + // hr = shellLink.As(&persistFile); + // if (!SUCCEEDED(hr)) continue; - hr = persistFile->Load(fname.c_str(), STGM_READWRITE); - if (!SUCCEEDED(hr)) continue; + // hr = persistFile->Load(fname.c_str(), STGM_READWRITE); + // if (!SUCCEEDED(hr)) continue; - WCHAR dst[MAX_PATH]; - hr = shellLink->GetPath(dst, MAX_PATH, 0, 0); - if (!SUCCEEDED(hr)) continue; + // WCHAR dst[MAX_PATH]; + // hr = shellLink->GetPath(dst, MAX_PATH, 0, 0); + // if (!SUCCEEDED(hr)) continue; - BY_HANDLE_FILE_INFORMATION dstinfo = { 0 }; - HANDLE dstfile = CreateFile(dst, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (dstfile == INVALID_HANDLE_VALUE) continue; - BOOL dstres = GetFileInformationByHandle(dstfile, &dstinfo); - CloseHandle(dstfile); - if (!dstres) continue; + // BY_HANDLE_FILE_INFORMATION dstinfo = { 0 }; + // HANDLE dstfile = CreateFile(dst, 0x00, 0x00, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + // if (dstfile == INVALID_HANDLE_VALUE) continue; + // BOOL dstres = GetFileInformationByHandle(dstfile, &dstinfo); + // CloseHandle(dstfile); + // if (!dstres) continue; - if (srcinfo.dwVolumeSerialNumber == dstinfo.dwVolumeSerialNumber && srcinfo.nFileIndexLow == dstinfo.nFileIndexLow && srcinfo.nFileIndexHigh == dstinfo.nFileIndexHigh) { - ComPtr propertyStore; - hr = shellLink.As(&propertyStore); - if (!SUCCEEDED(hr)) return; + // if (srcinfo.dwVolumeSerialNumber == dstinfo.dwVolumeSerialNumber && srcinfo.nFileIndexLow == dstinfo.nFileIndexLow && srcinfo.nFileIndexHigh == dstinfo.nFileIndexHigh) { + // ComPtr propertyStore; + // hr = shellLink.As(&propertyStore); + // if (!SUCCEEDED(hr)) return; - PROPVARIANT appIdPropVar; - hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); - if (!SUCCEEDED(hr)) return; - LOG(("Reading..")); - WCHAR already[MAX_PATH]; - hr = propVariantToString(appIdPropVar, already, MAX_PATH); - if (SUCCEEDED(hr)) { - if (std::wstring(AppUserModelId()) == already) { - LOG(("Already!")); - PropVariantClear(&appIdPropVar); - return; - } - } - if (appIdPropVar.vt != VT_EMPTY) { - PropVariantClear(&appIdPropVar); - return; - } - PropVariantClear(&appIdPropVar); + // PROPVARIANT appIdPropVar; + // hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); + // if (!SUCCEEDED(hr)) return; + // LOG(("Reading..")); + // WCHAR already[MAX_PATH]; + // hr = propVariantToString(appIdPropVar, already, MAX_PATH); + // if (SUCCEEDED(hr)) { + // if (std::wstring(AppUserModelId()) == already) { + // LOG(("Already!")); + // PropVariantClear(&appIdPropVar); + // return; + // } + // } + // if (appIdPropVar.vt != VT_EMPTY) { + // PropVariantClear(&appIdPropVar); + // return; + // } + // PropVariantClear(&appIdPropVar); - hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); - if (!SUCCEEDED(hr)) return; + // hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + // if (!SUCCEEDED(hr)) return; - hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); - PropVariantClear(&appIdPropVar); - if (!SUCCEEDED(hr)) return; + // hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + // PropVariantClear(&appIdPropVar); + // if (!SUCCEEDED(hr)) return; - hr = propertyStore->Commit(); - if (!SUCCEEDED(hr)) return; + // hr = propertyStore->Commit(); + // if (!SUCCEEDED(hr)) return; - if (persistFile->IsDirty() == S_OK) { - persistFile->Save(fname.c_str(), TRUE); - } - return; - } - } - } while (FindNextFile(findHandle, &findData)); - DWORD errorCode = GetLastError(); - if (errorCode && errorCode != ERROR_NO_MORE_FILES) { // everything is found - LOG(("Init Error: could not find some files in pinned folder")); - return; - } - FindClose(findHandle); + // if (persistFile->IsDirty() == S_OK) { + // persistFile->Save(fname.c_str(), TRUE); + // } + // return; + // } + // } + //} while (FindNextFile(findHandle, &findData)); + //DWORD errorCode = GetLastError(); + //if (errorCode && errorCode != ERROR_NO_MORE_FILES) { // everything is found + // LOG(("Init Error: could not find some files in pinned folder")); + // return; + //} + //FindClose(findHandle); } QString systemShortcutPath() { - static const int maxFileLen = MAX_PATH * 10; - WCHAR wstrPath[maxFileLen]; - if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { - QDir appData(QString::fromStdWString(std::wstring(wstrPath))); - return appData.absolutePath() + qsl("/Microsoft/Windows/Start Menu/Programs/"); - } + //static const int maxFileLen = MAX_PATH * 10; + //WCHAR wstrPath[maxFileLen]; + //if (GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { + // QDir appData(QString::fromStdWString(std::wstring(wstrPath))); + // return appData.absolutePath() + qsl("/Microsoft/Windows/Start Menu/Programs/"); + //} return QString(); } @@ -3486,28 +2902,28 @@ void CleanupAppUserModelIdShortcut() { QString path = systemShortcutPath() + qsl("Telegram.lnk"); std::wstring p = QDir::toNativeSeparators(path).toStdWString(); - DWORD attributes = GetFileAttributes(p.c_str()); - if (attributes >= 0xFFFFFFF) return; // file does not exist + //DWORD attributes = GetFileAttributes(p.c_str()); + //if (attributes >= 0xFFFFFFF) return; // file does not exist - ComPtr shellLink; - HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); - if (!SUCCEEDED(hr)) return; + //ComPtr shellLink; + //HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + //if (!SUCCEEDED(hr)) return; - ComPtr persistFile; - hr = shellLink.As(&persistFile); - if (!SUCCEEDED(hr)) return; + //ComPtr persistFile; + //hr = shellLink.As(&persistFile); + //if (!SUCCEEDED(hr)) return; - hr = persistFile->Load(p.c_str(), STGM_READWRITE); - if (!SUCCEEDED(hr)) return; + //hr = persistFile->Load(p.c_str(), STGM_READWRITE); + //if (!SUCCEEDED(hr)) return; - WCHAR szGotPath[MAX_PATH]; - WIN32_FIND_DATA wfd; - hr = shellLink->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH); - if (!SUCCEEDED(hr)) return; + //WCHAR szGotPath[MAX_PATH]; + //WIN32_FIND_DATA wfd; + //hr = shellLink->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH); + //if (!SUCCEEDED(hr)) return; - if (QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString() == szGotPath) { - QFile().remove(path); - } + //if (QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString() == szGotPath) { + // QFile().remove(path); + //} } bool ValidateAppUserModelIdShortcutAt(const QString &path) { @@ -3515,55 +2931,55 @@ bool ValidateAppUserModelIdShortcutAt(const QString &path) { std::wstring p = QDir::toNativeSeparators(path).toStdWString(); - DWORD attributes = GetFileAttributes(p.c_str()); - if (attributes >= 0xFFFFFFF) return false; // file does not exist + //DWORD attributes = GetFileAttributes(p.c_str()); + //if (attributes >= 0xFFFFFFF) return false; // file does not exist - ComPtr shellLink; - HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); - if (!SUCCEEDED(hr)) return false; + //ComPtr shellLink; + //HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + //if (!SUCCEEDED(hr)) return false; - ComPtr persistFile; - hr = shellLink.As(&persistFile); - if (!SUCCEEDED(hr)) return false; + //ComPtr persistFile; + //hr = shellLink.As(&persistFile); + //if (!SUCCEEDED(hr)) return false; - hr = persistFile->Load(p.c_str(), STGM_READWRITE); - if (!SUCCEEDED(hr)) return false; + //hr = persistFile->Load(p.c_str(), STGM_READWRITE); + //if (!SUCCEEDED(hr)) return false; - ComPtr propertyStore; - hr = shellLink.As(&propertyStore); - if (!SUCCEEDED(hr)) return false; + //ComPtr propertyStore; + //hr = shellLink.As(&propertyStore); + //if (!SUCCEEDED(hr)) return false; - PROPVARIANT appIdPropVar; - hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); - if (!SUCCEEDED(hr)) return false; + //PROPVARIANT appIdPropVar; + //hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); + //if (!SUCCEEDED(hr)) return false; - WCHAR already[MAX_PATH]; - hr = propVariantToString(appIdPropVar, already, MAX_PATH); - if (SUCCEEDED(hr)) { - if (std::wstring(AppUserModelId()) == already) { - PropVariantClear(&appIdPropVar); - return true; - } - } - if (appIdPropVar.vt != VT_EMPTY) { - PropVariantClear(&appIdPropVar); - return false; - } - PropVariantClear(&appIdPropVar); + //WCHAR already[MAX_PATH]; + //hr = propVariantToString(appIdPropVar, already, MAX_PATH); + //if (SUCCEEDED(hr)) { + // if (std::wstring(AppUserModelId()) == already) { + // PropVariantClear(&appIdPropVar); + // return true; + // } + //} + //if (appIdPropVar.vt != VT_EMPTY) { + // PropVariantClear(&appIdPropVar); + // return false; + //} + //PropVariantClear(&appIdPropVar); - hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); - if (!SUCCEEDED(hr)) return false; + //hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + //if (!SUCCEEDED(hr)) return false; - hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); - PropVariantClear(&appIdPropVar); - if (!SUCCEEDED(hr)) return false; + //hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + //PropVariantClear(&appIdPropVar); + //if (!SUCCEEDED(hr)) return false; - hr = propertyStore->Commit(); - if (!SUCCEEDED(hr)) return false; + //hr = propertyStore->Commit(); + //if (!SUCCEEDED(hr)) return false; - if (persistFile->IsDirty() == S_OK) { - persistFile->Save(p.c_str(), TRUE); - } + //if (persistFile->IsDirty() == S_OK) { + // persistFile->Save(p.c_str(), TRUE); + //} return true; } @@ -3585,66 +3001,66 @@ bool ValidateAppUserModelIdShortcut() { if (ValidateAppUserModelIdShortcutAt(path)) return true; } - ComPtr shellLink; - HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); - if (!SUCCEEDED(hr)) return false; + //ComPtr shellLink; + //HRESULT hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&shellLink)); + //if (!SUCCEEDED(hr)) return false; - hr = shellLink->SetPath(QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString().c_str()); - if (!SUCCEEDED(hr)) return false; + //hr = shellLink->SetPath(QDir::toNativeSeparators(cExeDir() + cExeName()).toStdWString().c_str()); + //if (!SUCCEEDED(hr)) return false; - hr = shellLink->SetArguments(L""); - if (!SUCCEEDED(hr)) return false; + //hr = shellLink->SetArguments(L""); + //if (!SUCCEEDED(hr)) return false; - hr = shellLink->SetWorkingDirectory(QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()).toStdWString().c_str()); - if (!SUCCEEDED(hr)) return false; + //hr = shellLink->SetWorkingDirectory(QDir::toNativeSeparators(QDir(cWorkingDir()).absolutePath()).toStdWString().c_str()); + //if (!SUCCEEDED(hr)) return false; - ComPtr propertyStore; - hr = shellLink.As(&propertyStore); - if (!SUCCEEDED(hr)) return false; + //ComPtr propertyStore; + //hr = shellLink.As(&propertyStore); + //if (!SUCCEEDED(hr)) return false; - PROPVARIANT appIdPropVar; - hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); - if (!SUCCEEDED(hr)) return false; + //PROPVARIANT appIdPropVar; + //hr = InitPropVariantFromString(AppUserModelId(), &appIdPropVar); + //if (!SUCCEEDED(hr)) return false; - hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); - PropVariantClear(&appIdPropVar); - if (!SUCCEEDED(hr)) return false; + //hr = propertyStore->SetValue(pkey_AppUserModel_ID, appIdPropVar); + //PropVariantClear(&appIdPropVar); + //if (!SUCCEEDED(hr)) return false; - PROPVARIANT startPinPropVar; - hr = InitPropVariantFromUInt32(APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL, &startPinPropVar); - if (!SUCCEEDED(hr)) return false; + //PROPVARIANT startPinPropVar; + //hr = InitPropVariantFromUInt32(APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL, &startPinPropVar); + //if (!SUCCEEDED(hr)) return false; - hr = propertyStore->SetValue(pkey_AppUserModel_StartPinOption, startPinPropVar); - PropVariantClear(&startPinPropVar); - if (!SUCCEEDED(hr)) return false; + //hr = propertyStore->SetValue(pkey_AppUserModel_StartPinOption, startPinPropVar); + //PropVariantClear(&startPinPropVar); + //if (!SUCCEEDED(hr)) return false; - hr = propertyStore->Commit(); - if (!SUCCEEDED(hr)) return false; + //hr = propertyStore->Commit(); + //if (!SUCCEEDED(hr)) return false; - ComPtr persistFile; - hr = shellLink.As(&persistFile); - if (!SUCCEEDED(hr)) return false; + //ComPtr persistFile; + //hr = shellLink.As(&persistFile); + //if (!SUCCEEDED(hr)) return false; - hr = persistFile->Save(QDir::toNativeSeparators(path).toStdWString().c_str(), TRUE); - if (!SUCCEEDED(hr)) return false; + //hr = persistFile->Save(QDir::toNativeSeparators(path).toStdWString().c_str(), TRUE); + //if (!SUCCEEDED(hr)) return false; return true; } bool InitToastManager() { if (!useToast || !ValidateAppUserModelIdShortcut()) return false; - if (!SUCCEEDED(setCurrentProcessExplicitAppUserModelID(AppUserModelId()))) { - return false; - } - if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), &toastNotificationManager))) { - return false; - } - if (!SUCCEEDED(toastNotificationManager->CreateToastNotifierWithId(StringReferenceWrapper(AppUserModelId(), wcslen(AppUserModelId())).Get(), &toastNotifier))) { - return false; - } - if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(), &toastNotificationFactory))) { - return false; - } + //if (!SUCCEEDED(setCurrentProcessExplicitAppUserModelID(AppUserModelId()))) { + // return false; + //} + //if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), &toastNotificationManager))) { + // return false; + //} + //if (!SUCCEEDED(toastNotificationManager->CreateToastNotifierWithId(StringReferenceWrapper(AppUserModelId(), wcslen(AppUserModelId())).Get(), &toastNotifier))) { + // return false; + //} + //if (!SUCCEEDED(wrap_GetActivationFactory(StringReferenceWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotification).Get(), &toastNotificationFactory))) { + // return false; + //} QDir().mkpath(cWorkingDir() + qsl("tdata/temp")); return true; } @@ -3652,3 +3068,7 @@ bool InitToastManager() { bool psLaunchMaps(const LocationCoords &coords) { return QDesktopServices::openUrl(qsl("bingmaps:?lvl=16&collection=point.%1_%2_Point").arg(coords.lat).arg(coords.lon)); } + +bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *ev) { + return QCoreApplication::sendSpontaneousEvent(receiver, ev); +} diff --git a/Telegram/SourceFiles/pspecific_winrt.h b/Telegram/SourceFiles/pspecific_winrt.h index 0f149ad29..75238b789 100644 --- a/Telegram/SourceFiles/pspecific_winrt.h +++ b/Telegram/SourceFiles/pspecific_winrt.h @@ -104,7 +104,7 @@ protected: private: HWND ps_hWnd; - HWND ps_tbHider_hWnd; +// HWND ps_tbHider_hWnd; HMENU ps_menu; HICON ps_iconBig, ps_iconSmall, ps_iconOverlay; @@ -115,7 +115,6 @@ private: void psWriteDump(); void psWriteStackTrace(); -QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/stdafx.cpp b/Telegram/SourceFiles/stdafx.cpp index 53a464500..987153bf2 100644 --- a/Telegram/SourceFiles/stdafx.cpp +++ b/Telegram/SourceFiles/stdafx.cpp @@ -21,10 +21,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "stdafx.h" #include -#ifdef Q_OS_WIN +#ifdef Q_OS_WINRT +//Q_IMPORT_PLUGIN(QWinRTIntegrationPlugin) +//Q_IMPORT_PLUGIN(QWbmpPlugin) +#elif defined Q_OS_WIN // Q_OS_WINRT Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) Q_IMPORT_PLUGIN(QWebpPlugin) -#elif defined Q_OS_MAC +#elif defined Q_OS_MAC // Q_OS_WIN Q_IMPORT_PLUGIN(QGenericEnginePlugin) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) Q_IMPORT_PLUGIN(QDDSPlugin) @@ -36,7 +39,7 @@ Q_IMPORT_PLUGIN(QTgaPlugin) Q_IMPORT_PLUGIN(QTiffPlugin) Q_IMPORT_PLUGIN(QWbmpPlugin) Q_IMPORT_PLUGIN(QWebpPlugin) -#elif defined Q_OS_LINUX +#elif defined Q_OS_LINUX // Q_OS_LINUX Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin) Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin) diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 22bc15115..da667bb39 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -18,11 +18,20 @@ to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ +#ifdef TDESKTOP_WINRT + +#include +#include + +#else // TDESKTOP_WINRT + #define __HUGE #define PSAPI_VERSION 1 // fix WinXP #define __STDC_FORMAT_MACROS // fix breakpad for mac +#endif // else of TDESKTOP_WINRT + #ifdef __cplusplus #include @@ -43,9 +52,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #ifdef Q_OS_WIN // use Lzma SDK for win #include -#else +#else // Q_OS_WIN #include -#endif +#endif // else of Q_OS_WIN extern "C" { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index b14e63cef..ff088c269 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -82,9 +82,9 @@ NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : , history(msg->history()) , item(msg) , fwdCount(fwdCount) -#ifdef Q_OS_WIN +#if defined Q_OS_WIN && !defined Q_OS_WINRT , started(GetTickCount()) -#endif +#endif // Q_OS_WIN && !Q_OS_WINRT , close(this, st::notifyClose) , alphaDuration(st::notifyFastAnim) , posDuration(st::notifyFastAnim) @@ -126,7 +126,7 @@ NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : } void NotifyWindow::checkLastInput() { -#ifdef Q_OS_WIN +#if defined Q_OS_WIN && !defined Q_OS_WINRT LASTINPUTINFO lii; lii.cbSize = sizeof(LASTINPUTINFO); BOOL res = GetLastInputInfo(&lii); @@ -135,14 +135,14 @@ void NotifyWindow::checkLastInput() { } else { inputTimer.start(300); } -#else +#else // Q_OS_WIN && !Q_OS_WINRT // TODO if (true) { hideTimer.start(st::notifyWaitLongHide); } else { inputTimer.start(300); } -#endif +#endif // else for Q_OS_WIN && !Q_OS_WINRT } void NotifyWindow::moveTo(int32 x, int32 y, int32 index) { @@ -3096,6 +3096,7 @@ void ShowCrashReportWindow::closeEvent(QCloseEvent *e) { deleteLater(); } +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS int showCrashReportWindow(const QString &crashdump) { QString text; @@ -3120,3 +3121,4 @@ int showCrashReportWindow(const QString &crashdump) { ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); return app.exec(); } +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 29b8566f9..cecad8cf7 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -98,9 +98,9 @@ public slots: private: -#ifdef Q_OS_WIN +#if defined Q_OS_WIN && !defined Q_OS_WINRT DWORD started; -#endif +#endif // Q_OS_WIN && !Q_OS_WINRT History *history; HistoryItem *item; int32 fwdCount; @@ -573,4 +573,6 @@ private: }; +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS int showCrashReportWindow(const QString &crashdump); +#endif // !TDESKTOP_DISABLE_CRASH_REPORTS From 84e67b8ec07092b129e006b5f105ea9f946e38f7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 21 Mar 2016 21:40:00 +0300 Subject: [PATCH 10/10] scrollTop counted relative to the last scrollTop item, attachedToPrevious messages support added, service messages now display date and unreadbar --- Telegram/Resources/style.txt | 5 +- Telegram/SourceFiles/config.h | 3 + Telegram/SourceFiles/history.cpp | 649 +++++++++++--------- Telegram/SourceFiles/history.h | 139 ++++- Telegram/SourceFiles/historywidget.cpp | 201 +++--- Telegram/SourceFiles/historywidget.h | 24 +- Telegram/SourceFiles/mainwidget.cpp | 5 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 5 +- Telegram/SourceFiles/structs.cpp | 5 +- 9 files changed, 636 insertions(+), 400 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 1e45af88d..f1a219040 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1049,10 +1049,11 @@ msgServiceNameFont: semiboldFont; msgServicePhotoWidth: 100px; msgDateFont: font(13px); msgMinWidth: 190px; -msgPhotoSize: 30px; +msgPhotoSize: 35px; msgPhotoSkip: 40px; msgPadding: margins(13px, 7px, 13px, 8px); -msgMargin: margins(13px, 4px, 53px, 4px); +msgMargin: margins(13px, 6px, 53px, 2px); +msgMarginTopAttached: 2px; msgLnkPadding: 2px; // for media open / save links msgBorder: #f0f0f0; msgInBg: #fff; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index e52f18572..d627e8683 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -101,6 +101,9 @@ enum { MediaOverviewStartPerPage = 5, MediaOverviewPreloadCount = 4, + // a new message from the same sender is attached to previous within 30 seconds + AttachMessageToPreviousSecondsDelta = 30, + AudioVoiceMsgSimultaneously = 4, AudioSongSimultaneously = 4, AudioCheckPositionTimeout = 100, // 100ms per check audio pos diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index ad6c2ead0..d205c1184 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -268,17 +268,17 @@ History::History(const PeerId &peerId) : width(0), height(0) , unreadCount(0) , inboxReadBefore(1) , outboxReadBefore(1) -, showFrom(0) -, unreadBar(0) +, showFrom(nullptr) +, unreadBar(nullptr) , peer(App::peer(peerId)) , oldLoaded(false) , newLoaded(true) , lastMsg(0) , msgDraft(0) , editDraft(0) -, lastWidth(0) -, lastScrollTop(ScrollMax) -, lastShowAtMsgId(ShowAtUnreadMsgId) +, showAtMsgId(ShowAtUnreadMsgId) +, scrollTopItem(nullptr) +, scrollTopOffset(0) , mute(isNotifyMuted(peer->notify)) , lastKeyboardInited(false) , lastKeyboardUsed(false) @@ -472,13 +472,9 @@ void ChannelHistory::getSwitchReadyFor(MsgId switchId, MsgId &fixInScrollMsgId, switchMode(); } else { clear(true); - newLoaded = oldLoaded = false; - lastWidth = 0; } } else { clear(true); - newLoaded = oldLoaded = false; - lastWidth = 0; } } else { _otherList.clear(); @@ -576,18 +572,20 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { if (onlyImportant()) { if (newLoaded) { - HistoryItem *prev = blocks.isEmpty() ? nullptr : blocks.back()->items.back(); - HistoryBlock *to = nullptr; - bool newBlock = blocks.isEmpty(); - if (newBlock) { - to = new HistoryBlock(this); - to->y = height; + HistoryBlock *block = blocks.isEmpty() ? nullptr : blocks.back(); + HistoryItem *prev = nullptr; + if (block) { + prev = block->items.back(); } else { - to = blocks.back(); - height -= to->height; + block = new HistoryBlock(this); + block->setIndexInHistory(blocks.size()); + blocks.push_back(block); + } + prev = addMessageGroupAfterPrevToBlock(d, prev, block); + if (block->items.isEmpty()) { + blocks.pop_back(); + delete block; } - prev = addMessageGroupAfterPrevToBlock(d, prev, to); - height += to->height; } } else { setNotLoadedAtBottom(); @@ -631,9 +629,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { ++itemIndex; _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); - if (!addNewInTheMiddle(_joinedMessage, blockIndex, itemIndex)) { - _joinedMessage = nullptr; - } + addNewInTheMiddle(_joinedMessage, blockIndex, itemIndex); if (lastMsgDate.isNull() || inviteDate >= lastMsgDate) { setLastMessage(_joinedMessage); if (unread) { @@ -767,16 +763,18 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp } if (!isImportant && onlyImportant()) { - HistoryItem *item = addToHistory(msg), *prev = isEmpty() ? 0 : blocks.back()->items.back(); - HistoryItem *group = addMessageGroupAfterPrev(item, prev); - if (group && group != prev) { - height += group->height(); - } + HistoryItem *item = addToHistory(msg), *prev = isEmpty() ? nullptr : blocks.back()->items.back(); + addMessageGroupAfterPrev(item, prev); return item; } + // when we are receiving channel dialog rows we get one important and one not important + // message for each history, adding all of them with type == NewMessageLast + // if we get a second (not important) message of this two we need to clear the history + // because a lot of messages in between those two are skipped if (!isImportantFlags && !onlyImportant() && !isEmpty() && type == NewMessageLast) { clear(true); + newLoaded = true; // adding the last message } return addNewToLastBlock(msg, type); @@ -849,7 +847,9 @@ void ChannelHistory::switchMode() { _onlyImportant = !_onlyImportant; - lastWidth = 0; + // scroll to the bottom if nothing special is intended + // (like scrolling to the collapse item) + scrollTopItem = nullptr; checkJoinedMessage(); } @@ -956,17 +956,17 @@ HistoryGroup *ChannelHistory::findGroupInOther(MsgId msgId) const { // find mess } } HistoryItem *item = _otherList.at(otherIndex); - if (item->type() != HistoryItemGroup) return 0; + if (item->type() != HistoryItemGroup) return nullptr; + HistoryGroup *result = static_cast(item); - return (result->minId() < msgId && result->maxId() > msgId) ? result : 0; + return (result->minId() < msgId && result->maxId() > msgId) ? result : nullptr; } HistoryItem *ChannelHistory::findPrevItem(HistoryItem *item) const { - if (item->detached()) return 0; - int32 itemIndex = item->block()->items.indexOf(item); - int32 blockIndex = blocks.indexOf(item->block()); - if (itemIndex < 0 || blockIndex < 0) return 0; + if (item->detached()) return nullptr; + int32 itemIndex = item->indexInBlock(); + int32 blockIndex = item->block()->indexInHistory(); for (++blockIndex, ++itemIndex; blockIndex > 0;) { --blockIndex; HistoryBlock *block = blocks.at(blockIndex); @@ -978,14 +978,14 @@ HistoryItem *ChannelHistory::findPrevItem(HistoryItem *item) const { } } } - return 0; + return nullptr; } void ChannelHistory::messageDetached(HistoryItem *msg) { if (_collapseMessage == msg) { - _collapseMessage = 0; + _collapseMessage = nullptr; } else if (_joinedMessage == msg) { - _joinedMessage = 0; + _joinedMessage = nullptr; } } @@ -1233,7 +1233,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, switch (msg.type()) { case mtpc_messageEmpty: - result = HistoryServiceMsg::create(this, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); + result = HistoryServiceMessage::create(this, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); break; case mtpc_message: { @@ -1287,7 +1287,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, entities.push_front(EntityInText(EntityInTextItalic, 0, text.size())); result = HistoryMessage::create(this, m.vid.v, m.vflags.v, m.vvia_bot_id.v, date(m.vdate), m.vfrom_id.v, text, entities); } else if (badMedia) { - result = HistoryServiceMsg::create(this, m.vid.v, date(m.vdate), lang(lng_message_empty), m.vflags.v, nullptr, m.has_from_id() ? m.vfrom_id.v : 0); + result = HistoryServiceMessage::create(this, m.vid.v, date(m.vdate), lang(lng_message_empty), m.vflags.v, nullptr, m.has_from_id() ? m.vfrom_id.v : 0); } else { if (m.has_reply_to_msg_id() && m.vreply_to_msg_id.v > 0) { result = HistoryReply::create(this, m); @@ -1302,7 +1302,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, case mtpc_messageService: { const MTPDmessageService &d(msg.c_messageService()); - result = HistoryServiceMsg::create(this, d); + result = HistoryServiceMessage::create(this, d); if (applyServiceAction) { const MTPmessageAction &action(d.vaction); @@ -1467,7 +1467,7 @@ HistoryItem *History::createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 } HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags, HistoryMedia *media, bool newMsg) { - return addNewItem(HistoryServiceMsg::create(this, msgId, date, text, flags, media), newMsg); + return addNewItem(HistoryServiceMessage::create(this, msgId, date, text, flags, media), newMsg); } HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) { @@ -1708,9 +1708,6 @@ HistoryItem *History::addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem if (!block) { block = new HistoryBlock(this); blocks.push_back(block); - if (width) { - block->y = height; - } } return addItemAfterPrevToBlock(HistoryGroup::create(this, newItem, date), prev, block); } @@ -2073,26 +2070,99 @@ void History::getNextShowFrom(HistoryBlock *block, int32 i) { if (i >= 0) { int32 l = block->items.size(); for (++i; i < l; ++i) { - if (block->items[i]->type() == HistoryItemMsg) { - showFrom = block->items[i]; + if (block->items.at(i)->type() == HistoryItemMsg) { + showFrom = block->items.at(i); return; } } } - int32 j = blocks.indexOf(block), s = blocks.size(); - if (j >= 0) { - for (++j; j < s; ++j) { - block = blocks[j]; - for (int32 i = 0, l = block->items.size(); i < l; ++i) { - if (block->items[i]->type() == HistoryItemMsg) { - showFrom = block->items[i]; - return; - } + for (int32 j = block->indexInHistory() + 1, s = blocks.size(); j < s; ++j) { + block = blocks.at(j); + for_const (HistoryItem *item, block->items) { + if (item->type() == HistoryItemMsg) { + showFrom = item; + return; } } } - showFrom = 0; + showFrom = nullptr; +} + +void History::countScrollState(int top) { + countScrollTopItem(top); + if (scrollTopItem) { + scrollTopOffset = (top - scrollTopItem->block()->y - scrollTopItem->y); + } +} + +void History::countScrollTopItem(int top) { + if (isEmpty()) { + forgetScrollState(); + return; + } + + int itemIndex = 0, blockIndex = 0, itemTop = 0; + if (scrollTopItem && !scrollTopItem->detached()) { + itemIndex = scrollTopItem->indexInBlock(); + blockIndex = scrollTopItem->block()->indexInHistory(); + itemTop = blocks.at(blockIndex)->y + scrollTopItem->y; + } + if (itemTop > top) { + // go backward through history while we don't find an item that starts above + do { + HistoryBlock *block = blocks.at(blockIndex); + for (--itemIndex; itemIndex >= 0; --itemIndex) { + HistoryItem *item = block->items.at(itemIndex); + itemTop = block->y + item->y; + if (itemTop <= top) { + scrollTopItem = item; + return; + } + } + if (--blockIndex >= 0) { + itemIndex = blocks.at(blockIndex)->items.size(); + } else { + break; + } + } while (true); + + scrollTopItem = blocks.front()->items.front(); + } else { + // go forward through history while we don't find the last item that starts above + for (int blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) { + HistoryBlock *block = blocks.at(blockIndex); + for (int itemsCount = block->items.size(); itemIndex < itemsCount; ++itemIndex) { + HistoryItem *item = block->items.at(itemIndex); + itemTop = block->y + item->y; + if (itemTop > top) { + t_assert(itemIndex > 0 || blockIndex > 0); + if (itemIndex > 0) { + scrollTopItem = block->items.at(itemIndex - 1); + } else { + scrollTopItem = blocks.at(blockIndex - 1)->items.back(); + } + return; + } + } + itemIndex = 0; + } + scrollTopItem = blocks.back()->items.back(); + } +} + +void History::getNextScrollTopItem(HistoryBlock *block, int32 i) { + ++i; + if (i > 0 && i < block->items.size()) { + scrollTopItem = block->items.at(i); + return; + } + int j = block->indexInHistory() + 1; + if (j > 0 && j < blocks.size()) { + scrollTopItem = blocks.at(j)->items.front(); + return; + } + scrollTopItem = nullptr; } void History::addUnreadBar() { @@ -2115,13 +2185,12 @@ void History::destroyUnreadBar() { } HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex) { - if (blockIndex < 0 || itemIndex < 0 || blockIndex >= blocks.size() || itemIndex > blocks.at(blockIndex)->items.size()) { - delete newItem; - return 0; - } + t_assert(blockIndex >= 0); + t_assert(blockIndex < blocks.size()); + t_assert(itemIndex >= 0); + t_assert(itemIndex <= blocks.at(blockIndex)->items.size()); HistoryBlock *block = blocks.at(blockIndex); - newItem->y = (itemIndex < block->items.size()) ? block->items.at(itemIndex)->y : block->height; newItem->attachToBlock(block, itemIndex); block->items.insert(itemIndex, newItem); @@ -2129,18 +2198,10 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, for (int i = itemIndex + 1, l = block->items.size(); i < l; ++i) { block->items.at(i)->setIndexInBlock(i); } - - if (width) { - int32 dh = newItem->resize(width), l = block->items.size(); - for (++itemIndex; itemIndex < l; ++itemIndex) { - block->items[itemIndex]->y += dh; - } - block->height += dh; - for (++blockIndex, l = blocks.size(); blockIndex < l; ++blockIndex) { - blocks[blockIndex]->y += dh; - } - height += dh; + if (itemIndex + 1 < block->items.size()) { + block->items.at(itemIndex + 1)->previousItemChanged(); } + return newItem; } @@ -2195,8 +2256,6 @@ void History::getReadyFor(MsgId msgId, MsgId &fixInScrollMsgId, int32 &fixInScro h->getReadyFor(-msgId, fixInScrollMsgId, fixInScrollMsgTop); if (h->isEmpty()) { clear(true); - newLoaded = oldLoaded = false; - lastWidth = 0; } return; } @@ -2207,8 +2266,6 @@ void History::getReadyFor(MsgId msgId, MsgId &fixInScrollMsgId, int32 &fixInScro if (History *h = App::historyLoaded(peer->migrateFrom()->id)) { if (h->unreadCount) { clear(true); - newLoaded = oldLoaded = false; - lastWidth = 0; h->getReadyFor(msgId, fixInScrollMsgId, fixInScrollMsgTop); return; } @@ -2216,9 +2273,9 @@ void History::getReadyFor(MsgId msgId, MsgId &fixInScrollMsgId, int32 &fixInScro } if (!isReadyFor(msgId, fixInScrollMsgId, fixInScrollMsgTop)) { clear(true); - newLoaded = (msgId == ShowAtTheEndMsgId); - oldLoaded = false; - lastWidth = 0; + if (msgId == ShowAtTheEndMsgId) { + newLoaded = true; + } } } @@ -2296,29 +2353,21 @@ MsgId History::msgIdForRead() const { return result; } -int32 History::resize(int32 newWidth, int32 *ytransform) { - if (width != newWidth) _flags |= Flag::f_pending_resize; - bool force = (_flags | Flag::f_pending_resize); +int History::resizeGetHeight(int newWidth) { + bool resizeAllItems = (_flags | Flag::f_pending_resize) || (width != newWidth); + + if (!resizeAllItems && !hasPendingResizedItems()) { + return height; + } _flags &= ~(Flag::f_pending_resize | Flag::f_has_pending_resized_items); - if (force || hasPendingResizedItems()) { - width = newWidth; - int32 y = 0; - for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { - HistoryBlock *block = *i; - bool updTransform = ytransform && (*ytransform >= block->y) && (*ytransform < block->y + block->height); - if (updTransform) *ytransform -= block->y; - if (block->y != y) { - block->y = y; - } - y += block->resize(newWidth, ytransform, force); - if (updTransform) { - *ytransform += block->y; - ytransform = 0; - } - } - height = y; + width = newWidth; + int y = 0; + for_const (HistoryBlock *block, blocks) { + block->y = y; + y += block->resizeGetHeight(newWidth, resizeAllItems); } + height = y; return height; } @@ -2337,6 +2386,9 @@ void History::clear(bool leaveItems) { if (showFrom) { showFrom = nullptr; } + if (scrollTopItem) { + forgetScrollState(); + } if (!leaveItems) { setLastMessage(nullptr); } @@ -2360,8 +2412,11 @@ void History::clear(bool leaveItems) { } else { setUnreadCount(0); } - height = 0; - oldLoaded = false; + setPendingResize(); + + newLoaded = oldLoaded = false; + forgetScrollState(); + if (peer->isChat()) { peer->asChat()->lastAuthors.clear(); peer->asChat()->markupSenders.clear(); @@ -2522,16 +2577,15 @@ void History::changeMsgId(MsgId oldId, MsgId newId) { } void History::removeBlock(HistoryBlock *block) { - int index = blocks.indexOf(block); - if (index >= 0) { - setPendingResize(); - blocks.removeAt(index); - for (int i = index, l = blocks.size(); i < l; ++i) { - blocks.at(i)->setIndexInHistory(i); - } - if (index < blocks.size()) { - blocks.at(index)->items.front()->previousItemChanged(); - } + setPendingResize(); + + int index = block->indexInHistory(); + blocks.removeAt(index); + for (int i = index, l = blocks.size(); i < l; ++i) { + blocks.at(i)->setIndexInHistory(i); + } + if (index < blocks.size()) { + blocks.at(index)->items.front()->previousItemChanged(); } delete block; } @@ -2542,21 +2596,15 @@ History::~History() { deleteAndMark(editDraft); } -int32 HistoryBlock::resize(int32 newWidth, int32 *ytransform, bool force) { - int32 y = 0; - for_const (HistoryItem *item , items) { - bool updTransform = ytransform && (*ytransform >= item->y) && (*ytransform < item->y + item->height()); - if (updTransform) *ytransform -= item->y; +int HistoryBlock::resizeGetHeight(int newWidth, bool resizeAllItems) { + int y = 0; + for_const (HistoryItem *item, items) { item->y = y; - if (force || item->pendingResize()) { - y += item->resize(newWidth); + if (resizeAllItems || item->pendingResize()) { + y += item->resizeGetHeight(newWidth); } else { y += item->height(); } - if (updTransform) { - *ytransform += item->y; - ytransform = 0; - } } height = y; return height; @@ -2578,15 +2626,17 @@ void HistoryBlock::clear(bool leaveItems) { } void HistoryBlock::removeItem(HistoryItem *item) { - int32 index = items.indexOf(item), dh = 0; + t_assert(item->block() == this); + + int32 itemIndex = item->indexInBlock(); if (history->showFrom == item) { - history->getNextShowFrom(this, index); + history->getNextShowFrom(this, itemIndex); } if (history->unreadBar == item) { history->unreadBar = nullptr; } - if (index < 0) { - return; + if (history->scrollTopItem == item) { + history->getNextScrollTopItem(this, itemIndex); } int32 myIndex = history->blocks.indexOf(this); @@ -2595,7 +2645,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { HistoryGroup *nextGroup = 0, *prevGroup = 0; HistoryCollapse *nextCollapse = 0; HistoryItem *prevItem = 0; - for (int32 nextBlock = myIndex, nextIndex = qMin(items.size(), index + 1); nextBlock < history->blocks.size(); ++nextBlock) { + for (int32 nextBlock = myIndex, nextIndex = qMin(items.size(), itemIndex + 1); nextBlock < history->blocks.size(); ++nextBlock) { HistoryBlock *block = history->blocks.at(nextBlock); for (; nextIndex < block->items.size(); ++nextIndex) { HistoryItem *item = block->items.at(nextIndex); @@ -2615,7 +2665,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { break; } } - for (int32 prevBlock = myIndex + 1, prevIndex = qMax(1, index); prevBlock > 0;) { + for (int32 prevBlock = myIndex + 1, prevIndex = qMax(1, itemIndex); prevBlock > 0;) { --prevBlock; HistoryBlock *block = history->blocks.at(prevBlock); if (!prevIndex) prevIndex = block->items.size(); @@ -2646,22 +2696,21 @@ void HistoryBlock::removeItem(HistoryItem *item) { } // myIndex can be invalid now, because of destroying previous blocks - items.remove(index); + items.remove(itemIndex); + for (int i = itemIndex, l = items.size(); i < l; ++i) { + items.at(i)->setIndexInBlock(i); + } + if (itemIndex < items.size()) { + items.at(itemIndex)->previousItemChanged(); + } else if (_indexInHistory + 1 < history->blocks.size()) { + history->blocks.at(_indexInHistory + 1)->items.front()->previousItemChanged(); + } + if ((!item->out() || item->isPost()) && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); } - History *h = history; - if (int l = items.size()) { - for (int i = index; i < l; ++i) { - items.at(i)->setIndexInBlock(i); - } - if (index < items.size()) { - items.at(index)->previousItemChanged(); - } else if (_indexInHistory + 1 < history->blocks.size()) { - history->blocks.at(_indexInHistory + 1)->items.front()->previousItemChanged(); - } - } else { + if (items.isEmpty()) { history->removeBlock(this); } } @@ -2690,6 +2739,14 @@ void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const { p.fillRect(0, y + st::unreadBarHeight - st::lineWidth, w, st::lineWidth, st::unreadBarBorder); p.setFont(st::unreadBarFont); p.setPen(st::unreadBarColor); + + int left = st::msgServiceMargin.left(); + int maxwidth = w; + if (Adaptive::Wide()) { + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); + } + w = maxwidth; + p.drawText((w - _width) / 2, y + (st::unreadBarHeight - st::lineWidth - st::unreadBarFont->height) / 2 + st::unreadBarFont->ascent, _text); } @@ -2706,7 +2763,14 @@ int HistoryMessageDate::height() const { } void HistoryMessageDate::paint(Painter &p, int y, int w) const { - int left = (w - _width - st::msgServicePadding.left() - st::msgServicePadding.right()) / 2; + int left = st::msgServiceMargin.left(); + int maxwidth = w; + if (Adaptive::Wide()) { + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); + } + w = maxwidth - st::msgServiceMargin.left() - st::msgServiceMargin.left(); + + left += (w - _width - st::msgServicePadding.left() - st::msgServicePadding.right()) / 2; int height = st::msgServicePadding.top() + st::msgServiceFont->height + st::msgServicePadding.bottom(); App::roundRect(p, left, y + st::msgServiceMargin.top(), _width + st::msgServicePadding.left() + st::msgServicePadding.left(), height, App::msgServiceBg(), ServiceCorners); @@ -2750,27 +2814,20 @@ void HistoryItem::destroy() { } void HistoryItem::detach() { - if (_history->unreadBar == this) { - _history->unreadBar = 0; - } + if (detached()) return; + if (_history->isChannel()) { _history->asChannelHistory()->messageDetached(this); } - if (_block) { - _block->removeItem(this); - detachFast(); - App::historyItemDetached(this); + _block->removeItem(this); + detachFast(); + App::historyItemDetached(this); - _history->setPendingResize(); - } else { - if (_history->showFrom == this) { - _history->showFrom = 0; - } - } + _history->setPendingResize(); } void HistoryItem::detachFast() { - _block = 0; + _block = nullptr; _indexInBlock = -1; } @@ -2785,6 +2842,24 @@ void HistoryItem::previousItemChanged() { RemoveInterfaces(HistoryMessageDate::Bit()); setPendingInitDimensions(); } + + recountAttachToPrevious(); +} + +void HistoryItem::recountAttachToPrevious() { + bool attach = false; + if (!isPost() && !Is() && !Is()) { + if (HistoryItem *prev = previous()) { + attach = !prev->isPost() && !prev->serviceMsg() && prev->from() == from()/* && qAbs(prev->date.secsTo(date)) < AttachMessageToPreviousSecondsDelta*/; + } + } + if (attach && !(_flags & MTPDmessage_ClientFlag::f_attach_to_previous)) { + _flags |= MTPDmessage_ClientFlag::f_attach_to_previous; + setPendingInitDimensions(); + } else if (!attach && (_flags & MTPDmessage_ClientFlag::f_attach_to_previous)) { + _flags &= ~MTPDmessage_ClientFlag::f_attach_to_previous; + setPendingInitDimensions(); + } } void HistoryItem::setId(MsgId newId) { @@ -2793,6 +2868,10 @@ void HistoryItem::setId(MsgId newId) { } bool HistoryItem::displayFromPhoto() const { + return hasFromPhoto() && !isAttachedToPrevious(); +} + +bool HistoryItem::hasFromPhoto() const { return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !isPost(); } @@ -2831,6 +2910,8 @@ void HistoryItem::destroyUnreadBar() { if (_history->unreadBar == this) { _history->unreadBar = nullptr; } + + recountAttachToPrevious(); } } @@ -2840,6 +2921,9 @@ void HistoryItem::setUnreadBarCount(int count) { if (!Is()) { AddInterfaces(HistoryMessageUnreadBar::Bit()); setPendingInitDimensions(); + + recountAttachToPrevious(); + bar = Get(); } else { bar = Get(); @@ -6234,7 +6318,7 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { } left = (!isPost() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); - if (displayFromPhoto()) { + if (hasFromPhoto()) { left += st::msgPhotoSkip; // } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { // left += st::msgPhotoSkip - (hmaxwidth - hwidth); @@ -6487,8 +6571,6 @@ void HistoryMessage::setId(MsgId newId) { void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { bool outbg = out() && !isPost(), bubble = drawBubble(), selected = (selection == FullSelection); - textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); - int left = 0, width = 0, height = _height; countPositionAndSize(left, width); if (width < 1) return; @@ -6497,15 +6579,14 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (auto *date = Get()) { dateh = date->height(); date->paint(p, 0, _history->width); - p.translate(0, dateh); - height -= dateh; } if (auto *unreadbar = Get()) { unreadbarh = unreadbar->height(); + p.translate(0, dateh); unreadbar->paint(p, 0, _history->width); - p.translate(0, unreadbarh); - height -= unreadbarh; + p.translate(0, -dateh); } + int skiph = dateh + unreadbarh; uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0; if (animms > 0 && animms <= ms) { @@ -6516,14 +6597,16 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m float64 dt = (animms > st::activeFadeInDuration) ? (1 - (animms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (animms / float64(st::activeFadeInDuration)); float64 o = p.opacity(); p.setOpacity(o * dt); - p.fillRect(0, 0, _history->width, height, textstyleCurrent()->selectOverlay->b); + p.fillRect(0, skiph, _history->width, height - skiph, textstyleCurrent()->selectOverlay->b); p.setOpacity(o); } } + textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); + if (displayFromPhoto()) { int32 photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - author()->paintUserpic(p, st::msgPhotoSize, photoleft, height - st::msgMargin.bottom() - st::msgPhotoSize); + author()->paintUserpic(p, st::msgPhotoSize, photoleft, marginTop()); } if (bubble) { @@ -6533,7 +6616,8 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m fromNameUpdated(width); } - QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); + int32 top = marginTop(); + QRect r(left, top, width, height - top - marginBottom()); style::color bg(selected ? (outbg ? st::msgOutBgSelected : st::msgInBgSelected) : (outbg ? st::msgOutBg : st::msgInBg)); style::color sh(selected ? (outbg ? st::msgOutShadowSelected : st::msgInShadowSelected) : (outbg ? st::msgOutShadow : st::msgInShadow)); @@ -6559,7 +6643,7 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m drawMessageText(p, trect, selection); if (_media && _media->isDisplayed()) { - int32 top = height - st::msgMargin.bottom() - _media->height(); + int32 top = height - marginBottom() - _media->height(); p.translate(left, top); _media->draw(p, this, r.translated(-left, -top), selected, ms); p.translate(-left, -top); @@ -6570,14 +6654,11 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m HistoryMessage::drawInfo(p, r.x() + r.width(), r.y() + r.height(), 2 * r.x() + r.width(), selected, InfoDisplayDefault); } } else { - int32 top = st::msgMargin.top(); + int32 top = marginTop(); p.translate(left, top); _media->draw(p, this, r.translated(-left, -top), selected, ms); p.translate(-left, -top); } - if (int skiph = dateh + unreadbarh) { - p.translate(0, -skiph); - } textstyleRestore(); } @@ -6621,7 +6702,7 @@ void HistoryMessage::destroy() { HistoryItem::destroy(); } -int HistoryMessage::resizeImpl(int width) { +int HistoryMessage::resizeGetHeight_(int width) { if (width < st::msgMinWidth) return _height; width -= st::msgMargin.left() + st::msgMargin.right(); @@ -6688,13 +6769,7 @@ int HistoryMessage::resizeImpl(int width) { } else { _height = _media->resize(width, this); } - _height += st::msgMargin.top() + st::msgMargin.bottom(); - if (auto *date = Get()) { - _height += date->height(); - } - if (auto *unreadbar = Get()) { - _height += unreadbar->height(); - } + _height += marginTop() + marginBottom(); return _height; } @@ -6703,22 +6778,12 @@ bool HistoryMessage::hasPoint(int32 x, int32 y) const { countPositionAndSize(left, width); if (width < 1) return false; - if (auto *date = Get()) { - int dateh = date->height(); - y -= dateh; - height -= dateh; - } - if (auto *unreadbar = Get()) { - int unreadbarh = unreadbar->height(); - y -= unreadbarh; - height -= unreadbarh; - } - if (drawBubble()) { - QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); + int top = marginTop(); + QRect r(left, top, width, height - top - marginBottom()); return r.contains(x, y); } else { - return _media->hasPoint(x - left, y - st::msgMargin.top(), this); + return _media->hasPoint(x - left, y - marginTop(), this); } } @@ -6746,20 +6811,9 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 int left = 0, width = 0, height = _height; countPositionAndSize(left, width); - if (auto *date = Get()) { - int dateh = date->height(); - y -= dateh; - height -= dateh; - } - if (auto *unreadbar = Get()) { - int unreadbarh = unreadbar->height(); - y -= unreadbarh; - height -= unreadbarh; - } - if (displayFromPhoto()) { int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= height - st::msgMargin.bottom() - st::msgPhotoSize && y < height - st::msgMargin.bottom()) { + if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= marginTop() && y < height - marginBottom()) { lnk = author()->lnk; return; } @@ -6770,7 +6824,8 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 const HistoryMessageForwarded *fwd = Get(); const HistoryMessageVia *via = Get(); - QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); + int top = marginTop(); + QRect r(left, top, width, height - top - marginBottom()); if (displayFromName()) { // from user left name if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + st::msgNameFont->height) { if (x >= r.left() + st::msgPadding.left() && x < r.left() + r.width() - st::msgPadding.right() && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth()) { @@ -6803,7 +6858,7 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 } getStateFromMessageText(lnk, state, x, y, r); } else { - _media->getState(lnk, state, x - left, y - st::msgMargin.top(), this); + _media->getState(lnk, state, x - left, y - marginTop(), this); } } @@ -6861,21 +6916,11 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, countPositionAndSize(left, width); if (width < 1) return; - if (auto *date = Get()) { - int dateh = date->height(); - y -= dateh; - height -= dateh; - } - if (auto *unreadbar = Get()) { - int unreadbarh = unreadbar->height(); - y -= unreadbarh; - height -= unreadbarh; - } - const HistoryMessageForwarded *fwd = Get(); const HistoryMessageVia *via = Get(); - QRect r(left, st::msgMargin.top(), width, height - st::msgMargin.top() - st::msgMargin.bottom()); + int top = marginTop(); + QRect r(left, top, width, height - top - marginBottom()); if (displayFromName()) { // from user left name r.setTop(r.top() + st::msgNameFont->height); } else if (via && !fwd) { @@ -7148,8 +7193,8 @@ void HistoryReply::drawMessageText(Painter &p, QRect trect, uint32 selection) co HistoryMessage::drawMessageText(p, trect, selection); } -int32 HistoryReply::resizeImpl(int32 width) { - HistoryMessage::resizeImpl(width); +int32 HistoryReply::resizeGetHeight_(int32 width) { + HistoryMessage::resizeGetHeight_(width); if (drawBubble()) { if (emptyText() && !displayFromName() && !Is()) { @@ -7174,18 +7219,6 @@ void HistoryReply::resizeVia(int32 w) const { _replyToVia->resize(w - st::msgReplyBarSkip - previewSkip - replyToName.maxWidth() - st::msgServiceFont->spacew); } -bool HistoryReply::hasPoint(int32 x, int32 y) const { - if (drawBubble()) { - int32 left = 0, width = 0; - countPositionAndSize(left, width); - if (width < 1) return false; - - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); - return r.contains(x, y); - } - return HistoryMessage::hasPoint(x, y); -} - void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { lnk = TextLinkPtr(); state = HistoryDefaultCursorState; @@ -7201,7 +7234,8 @@ void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x } if (width < 1) return; - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + int top = marginTop(); + QRect r(left, top, width, _height - top - marginBottom()); if (displayFromName()) { style::font nameFont(st::msgNameFont); if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + nameFont->height) { @@ -7241,7 +7275,8 @@ void HistoryReply::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, i countPositionAndSize(left, width); if (width < 1) return; - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + int top = marginTop(); + QRect r(left, top, width, _height - top - marginBottom()); if (displayFromName()) { style::font nameFont(st::msgNameFont); if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + nameFont->height) { @@ -7269,7 +7304,7 @@ HistoryServicePinned::HistoryServicePinned(Interfaces *) , msg(0) { } -void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { +void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { QList links; LangString text = lang(lng_message_empty); QString from = textcmdLink(1, _from->name); @@ -7417,7 +7452,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } } -bool HistoryServiceMsg::updatePinned(bool force) { +bool HistoryServiceMessage::updatePinned(bool force) { HistoryServicePinned *pinned = Get(); t_assert(pinned != nullptr); @@ -7456,7 +7491,7 @@ bool HistoryServiceMsg::updatePinned(bool force) { return (pinned->msg || !pinned->msgId); } -bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { +bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptext) { bool result = false; QString from, text; if (pfrom) { @@ -7528,7 +7563,7 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { return result; } -HistoryServiceMsg::HistoryServiceMsg(History *history, const MTPDmessageService &msg) : +HistoryServiceMessage::HistoryServiceMessage(History *history, const MTPDmessageService &msg) : HistoryItem(history, msg.vid.v, mtpCastFlags(msg.vflags.v), ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) , _text(st::msgMinWidth) , _media(0) { @@ -7542,50 +7577,68 @@ HistoryServiceMsg::HistoryServiceMsg(History *history, const MTPDmessageService setMessageByAction(msg.vaction); } -HistoryServiceMsg::HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags, HistoryMedia *media, int32 from) : +HistoryServiceMessage::HistoryServiceMessage(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags, HistoryMedia *media, int32 from) : HistoryItem(history, msgId, flags, date, from) , _text(st::msgServiceFont, msg, _historySrvOptions, st::dlgMinWidth) , _media(media) { } -void HistoryServiceMsg::initDimensions() { +void HistoryServiceMessage::initDimensions() { _maxw = _text.maxWidth() + st::msgServicePadding.left() + st::msgServicePadding.right(); _minh = _text.minHeight(); if (_media) _media->initDimensions(this); } -void HistoryServiceMsg::countPositionAndSize(int32 &left, int32 &width) const { +void HistoryServiceMessage::countPositionAndSize(int32 &left, int32 &width) const { left = st::msgServiceMargin.left(); int32 maxwidth = _history->width; if (Adaptive::Wide()) { - maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); } width = maxwidth - st::msgServiceMargin.left() - st::msgServiceMargin.left(); } -QString HistoryServiceMsg::selectedText(uint32 selection) const { +QString HistoryServiceMessage::selectedText(uint32 selection) const { uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; uint16 selectedTo = (selection == FullSelection) ? 0xFFFF : (selection & 0xFFFF); return _text.original(selectedFrom, selectedTo); } -QString HistoryServiceMsg::inDialogsText() const { +QString HistoryServiceMessage::inDialogsText() const { return _text.original(0, 0xFFFF, Text::ExpandLinksNone); } -QString HistoryServiceMsg::inReplyText() const { - QString result = HistoryServiceMsg::inDialogsText(); +QString HistoryServiceMessage::inReplyText() const { + QString result = HistoryServiceMessage::inDialogsText(); return result.trimmed().startsWith(author()->name) ? result.trimmed().mid(author()->name.size()).trimmed() : result; } -void HistoryServiceMsg::setServiceText(const QString &text) { +void HistoryServiceMessage::setServiceText(const QString &text) { textstyleSet(&st::serviceTextStyle); _text.setText(st::msgServiceFont, text, _historySrvOptions); textstyleRestore(); initDimensions(); } -void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { +void HistoryServiceMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { + int left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + countPositionAndSize(left, width); + if (width < 1) return; + + int dateh = 0, unreadbarh = 0; + if (auto *date = Get()) { + dateh = date->height(); + date->paint(p, 0, _history->width); + p.translate(0, dateh); + height -= dateh; + } + if (auto *unreadbar = Get()) { + unreadbarh = unreadbar->height(); + unreadbar->paint(p, 0, _history->width); + p.translate(0, unreadbarh); + height -= unreadbarh; + } + uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0; if (animms > 0 && animms <= ms) { animms = ms - animms; @@ -7601,19 +7654,12 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 } } - textstyleSet(&st::serviceTextStyle); - - int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins - countPositionAndSize(left, width); - if (width < 1) return; - if (_media) { height -= st::msgServiceMargin.top() + _media->height(); - p.save(); int32 left = st::msgServiceMargin.left() + (width - _media->maxWidth()) / 2, top = st::msgServiceMargin.top() + height + st::msgServiceMargin.top(); p.translate(left, top); _media->draw(p, this, r.translated(-left, -top), selection == FullSelection, ms); - p.restore(); + p.translate(-left, -top); } QRect trect(QRect(left, st::msgServiceMargin.top(), width, height).marginsAdded(-st::msgServicePadding)); @@ -7624,19 +7670,26 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 } App::roundRect(p, left, st::msgServiceMargin.top(), width, height, App::msgServiceBg(), (selection == FullSelection) ? ServiceSelectedCorners : ServiceCorners); + textstyleSet(&st::serviceTextStyle); + p.setBrush(Qt::NoBrush); p.setPen(st::msgServiceColor); p.setFont(st::msgServiceFont); uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; uint16 selectedTo = (selection == FullSelection) ? 0 : selection & 0xFFFF; _text.draw(p, trect.x(), trect.y(), trect.width(), Qt::AlignCenter, 0, -1, selectedFrom, selectedTo); + textstyleRestore(); + + if (int skiph = dateh + unreadbarh) { + p.translate(0, -skiph); + } } -int32 HistoryServiceMsg::resizeImpl(int32 width) { +int32 HistoryServiceMessage::resizeGetHeight_(int32 width) { int32 maxwidth = _history->width; if (Adaptive::Wide()) { - maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); } if (width > maxwidth) width = maxwidth; width -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins @@ -7658,28 +7711,52 @@ int32 HistoryServiceMsg::resizeImpl(int32 width) { if (_media) { _height += st::msgServiceMargin.top() + _media->resize(_media->currentWidth(), this); } + _height += displayedDateHeight(); + if (auto *unreadbar = Get()) { + _height += unreadbar->height(); + } return _height; } -bool HistoryServiceMsg::hasPoint(int32 x, int32 y) const { - int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins +bool HistoryServiceMessage::hasPoint(int32 x, int32 y) const { + int left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins countPositionAndSize(left, width); if (width < 1) return false; + if (int dateh = displayedDateHeight()) { + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + if (_media) { height -= st::msgServiceMargin.top() + _media->height(); } return QRect(left, st::msgServiceMargin.top(), width, height).contains(x, y); } -void HistoryServiceMsg::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { +void HistoryServiceMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { lnk = TextLinkPtr(); state = HistoryDefaultCursorState; - int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + int left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins countPositionAndSize(left, width); if (width < 1) return; + if (int dateh = displayedDateHeight()) { + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + if (_media) { height -= st::msgServiceMargin.top() + _media->height(); } @@ -7695,15 +7772,25 @@ void HistoryServiceMsg::getState(TextLinkPtr &lnk, HistoryCursorState &state, in } } -void HistoryServiceMsg::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { +void HistoryServiceMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { symbol = 0; after = false; upon = false; - int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + int left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins countPositionAndSize(left, width); if (width < 1) return; + if (int dateh = displayedDateHeight()) { + y -= dateh; + height -= dateh; + } + if (auto *unreadbar = Get()) { + int unreadbarh = unreadbar->height(); + y -= unreadbarh; + height -= unreadbarh; + } + if (_media) { height -= st::msgServiceMargin.top() + _media->height(); } @@ -7713,7 +7800,7 @@ void HistoryServiceMsg::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 textstyleRestore(); } -void HistoryServiceMsg::drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const { +void HistoryServiceMessage::drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const { if (cacheFor != this) { cacheFor = this; cache.setText(st::dlgHistFont, inDialogsText(), _textDlgOptions); @@ -7723,17 +7810,17 @@ void HistoryServiceMsg::drawInDialog(Painter &p, const QRect &r, bool act, const cache.drawElided(p, tr.left(), tr.top(), tr.width(), tr.height() / st::dlgHistFont->height); } -QString HistoryServiceMsg::notificationText() const { +QString HistoryServiceMessage::notificationText() const { QString msg = _text.original(); if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl(".."); return msg; } -HistoryMedia *HistoryServiceMsg::getMedia(bool inOverview) const { +HistoryMedia *HistoryServiceMessage::getMedia(bool inOverview) const { return inOverview ? 0 : _media; } -HistoryServiceMsg::~HistoryServiceMsg() { +HistoryServiceMessage::~HistoryServiceMessage() { if (auto pinned = Get()) { if (pinned->msg) { App::historyUnregDependency(this, pinned->msg); @@ -7745,14 +7832,20 @@ HistoryServiceMsg::~HistoryServiceMsg() { } } -HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, const QDateTime &date) : -HistoryServiceMsg(history, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 .. %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/), -_minId(group.vmin_id.v), _maxId(group.vmax_id.v), _count(group.vcount.v), _lnk(new CommentsLink(this)) { +HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, const QDateTime &date) + : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 .. %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/) + , _minId(group.vmin_id.v) + , _maxId(group.vmax_id.v) + , _count(group.vcount.v) + , _lnk(new CommentsLink(this)) { } -HistoryGroup::HistoryGroup(History *history, HistoryItem *newItem, const QDateTime &date) : -HistoryServiceMsg(history, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 .. %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/), -_minId(newItem->id - 1), _maxId(newItem->id + 1), _count(1), _lnk(new CommentsLink(this)) { +HistoryGroup::HistoryGroup(History *history, HistoryItem *newItem, const QDateTime &date) + : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 .. %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/) + , _minId(newItem->id - 1) + , _maxId(newItem->id + 1) + , _count(1) + , _lnk(new CommentsLink(this)) { } void HistoryGroup::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { @@ -7817,9 +7910,9 @@ void HistoryGroup::updateText() { setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/); } -HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) : -HistoryServiceMsg(history, clientMsgId(), date, qsl("-")), -_wasMinId(wasMinId) { +HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) + : HistoryServiceMessage(history, clientMsgId(), date, qsl("-")) + , _wasMinId(wasMinId) { } void HistoryCollapse::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { @@ -7830,8 +7923,8 @@ void HistoryCollapse::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 state = HistoryDefaultCursorState; } -HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, MTPDmessage::Flags flags) : -HistoryServiceMsg(history, clientMsgId(), inviteDate, QString(), flags) { +HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, MTPDmessage::Flags flags) + : HistoryServiceMessage(history, clientMsgId(), inviteDate, QString(), flags) { textstyleSet(&st::serviceTextStyle); if (peerToUser(inviter->id) == MTP::authedId()) { _text.setText(st::msgServiceFont, lang(history->isMegagroup() ? lng_action_you_joined_group : lng_action_you_joined), _historySrvOptions); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index da98d2955..cec01a29d 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -303,7 +303,7 @@ public: MsgId maxMsgId() const; MsgId msgIdForRead() const; - int resize(int newWidth, int32 *ytransform = nullptr); // return new size + int resizeGetHeight(int newWidth); void removeNotification(HistoryItem *item) { if (!notifies.isEmpty()) { @@ -373,8 +373,38 @@ public: editDraft = draft; } - int32 lastWidth, lastScrollTop; - MsgId lastShowAtMsgId; + // some fields below are a property of a currently displayed instance of this + // conversation history not a property of the conversation history itself +public: + // we save the last showAtMsgId to restore the state when switching + // between different conversation histories + MsgId showAtMsgId; + + // we save a pointer of the history item at the top of the displayed window + // together with an offset from the window top to the top of this message + // resulting scrollTop = top(scrollTopItem) + scrollTopOffset + HistoryItem *scrollTopItem; + int scrollTopOffset; + void forgetScrollState() { + scrollTopItem = nullptr; + } + + // find the correct scrollTopItem and scrollTopOffset using given top + // of the displayed window relative to the history start coord + void countScrollState(int top); + +protected: + // when this item is destroyed scrollTopItem just points to the next one + // and scrollTopOffset remains the same + // if we are at the bottom of the window scrollTopItem == nullptr and + // scrollTopOffset is undefined + void getNextScrollTopItem(HistoryBlock *block, int32 i); + + // helper method for countScrollState(int top) + void countScrollTopItem(int top); + +public: + bool mute; bool lastKeyboardInited, lastKeyboardUsed; @@ -468,10 +498,10 @@ private: HistoryItem *createItemPhoto(MsgId id, MTPDmessage::Flags flags, int32 viaBotId, MsgId replyTo, QDateTime date, int32 from, PhotoData *photo, const QString &caption); HistoryItem *addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block); - HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); HistoryItem *addNewItem(HistoryItem *adding, bool newMsg); HistoryItem *addMessageGroupAfterPrevToBlock(const MTPDmessageGroup &group, HistoryItem *prev, HistoryBlock *block); HistoryItem *addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev); + HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); History(const History &) = delete; History &operator=(const History &) = delete; @@ -844,16 +874,24 @@ public: } void removeItem(HistoryItem *item); - int resize(int newWidth, int *ytransform, bool force); // return new size + int resizeGetHeight(int newWidth, bool resizeAllItems); int32 y, height; History *history; HistoryBlock *previous() const { + t_assert(_indexInHistory >= 0); + return (_indexInHistory > 0) ? history->blocks.at(_indexInHistory - 1) : nullptr; } void setIndexInHistory(int index) { _indexInHistory = index; } + int indexInHistory() const { + t_assert(_indexInHistory >= 0); + t_assert(history->blocks.at(_indexInHistory) == this); + + return _indexInHistory; + } protected: @@ -1002,7 +1040,7 @@ public: HistoryItem(const HistoryItem &) = delete; HistoryItem &operator=(const HistoryItem &) = delete; - int resize(int width) { + int resizeGetHeight(int width) { if (_flags & MTPDmessage_ClientFlag::f_pending_init_dimensions) { _flags &= ~MTPDmessage_ClientFlag::f_pending_init_dimensions; initDimensions(); @@ -1010,7 +1048,7 @@ public: if (_flags & MTPDmessage_ClientFlag::f_pending_resize) { _flags &= ~MTPDmessage_ClientFlag::f_pending_resize; } - return resizeImpl(width); + return resizeGetHeight_(width); } virtual void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const = 0; @@ -1060,6 +1098,16 @@ public: void setIndexInBlock(int index) { _indexInBlock = index; } + int indexInBlock() const { + if (_indexInBlock >= 0) { + t_assert(_block != nullptr); + t_assert(_block->items.at(_indexInBlock) == this); + } else if (_block != nullptr) { + t_assert(_indexInBlock >= 0); + t_assert(_block->items.at(_indexInBlock) == this); + } + return _indexInBlock; + } bool out() const { return _flags & MTPDmessage::Flag::f_out; } @@ -1163,9 +1211,6 @@ public: virtual void setViewsCount(int32 count) { } virtual void setId(MsgId newId); - virtual void setDate(const QDateTime &date) { // for date items - this->date = date; - } virtual void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const = 0; virtual QString notificationHeader() const { return QString(); @@ -1272,7 +1317,6 @@ public: PeerData *author() const { return isPost() ? history()->peer : _from; } - bool displayFromPhoto() const; PeerData *fromOriginal() const { if (const HistoryMessageForwarded *fwd = Get()) { @@ -1315,6 +1359,29 @@ public: setPendingResize(); } + int displayedDateHeight() const { + if (auto *date = Get()) { + return date->height(); + } + return 0; + } + int marginTop() const { + int result = 0; + if (isAttachedToPrevious()) { + result += st::msgMarginTopAttached; + } else { + result += st::msgMargin.top(); + } + result += displayedDateHeight(); + if (auto *unreadbar = Get()) { + result += unreadbar->height(); + } + return result; + } + int marginBottom() const { + return st::msgMargin.bottom(); + } + void clipCallback(ClipReaderNotification notification); virtual ~HistoryItem(); @@ -1327,9 +1394,10 @@ protected: // a virtual method, it can not be done from constructor virtual void finishCreate(); - // called from resize() when MTPDmessage_ClientFlag::f_pending_init_dimensions is set + // called from resizeGetHeight() when MTPDmessage_ClientFlag::f_pending_init_dimensions is set virtual void initDimensions() = 0; - virtual int resizeImpl(int width) = 0; + + virtual int resizeGetHeight_(int width) = 0; PeerData *_from; History *_history; @@ -1359,6 +1427,19 @@ protected: return true; } + // this should be used only in previousItemChanged() or when + // HistoryMessageDate or HistoryMessageUnreadBar bit is changed in the Interfaces mask + // then the result should be cached in a client side flag MTPDmessage_ClientFlag::f_attach_to_previous + void recountAttachToPrevious(); + bool isAttachedToPrevious() const { + return _flags & MTPDmessage_ClientFlag::f_attach_to_previous; + } + + // hasFromPhoto() returns true even if we don't display the photo + // but we need to skip a place at the left side for this photo + bool displayFromPhoto() const; + bool hasFromPhoto() const; + }; // make all the constructors in HistoryItem children protected @@ -2313,7 +2394,10 @@ public: return drawBubble(); } bool displayFromName() const { - return hasFromName() && (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || Is() || viaBot() || !_media->hideFromName()); + if (!hasFromName()) return false; + if (isAttachedToPrevious()) return false; + + return (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || Is() || viaBot() || !_media->hideFromName()); } bool uploading() const { return _media && _media->uploading(); @@ -2420,7 +2504,7 @@ protected: friend class HistoryItemInstantiated; void initDimensions() override; - int resizeImpl(int width) override; + int resizeGetHeight_(int width) override; void createInterfaces(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); @@ -2473,7 +2557,6 @@ public: void drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selected, bool likeService = false) const; void drawMessageText(Painter &p, QRect trect, uint32 selection) const override; void resizeVia(int32 w) const; - bool hasPoint(int32 x, int32 y) const override; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const override; void getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const override; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const override; @@ -2501,7 +2584,7 @@ protected: friend class HistoryItemInstantiated; void initDimensions() override; - int resizeImpl(int width) override; + int resizeGetHeight_(int width) override; bool updateReplyTo(bool force = false); void replyToNameUpdated() const; @@ -2555,13 +2638,13 @@ struct HistoryServicePinned : public BasicInterface { TextLinkPtr lnk; }; -class HistoryServiceMsg : public HistoryItem, private HistoryItemInstantiated { +class HistoryServiceMessage : public HistoryItem, private HistoryItemInstantiated { public: - static HistoryServiceMsg *create(History *history, const MTPDmessageService &msg) { + static HistoryServiceMessage *create(History *history, const MTPDmessageService &msg) { return _create(history, msg); } - static HistoryServiceMsg *create(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0) { + static HistoryServiceMessage *create(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0) { return _create(history, msgId, date, msg, flags, media, from); } @@ -2615,16 +2698,16 @@ public: void setServiceText(const QString &text); - ~HistoryServiceMsg(); + ~HistoryServiceMessage(); protected: - HistoryServiceMsg(History *history, const MTPDmessageService &msg); - HistoryServiceMsg(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0); - friend class HistoryItemInstantiated; + HistoryServiceMessage(History *history, const MTPDmessageService &msg); + HistoryServiceMessage(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0); + friend class HistoryItemInstantiated; void initDimensions() override; - int resizeImpl(int width) override; + int resizeGetHeight_(int width) override; void setMessageByAction(const MTPmessageAction &action); bool updatePinned(bool force = false); @@ -2636,7 +2719,7 @@ protected: int32 _textWidth, _textHeight; }; -class HistoryGroup : public HistoryServiceMsg, private HistoryItemInstantiated { +class HistoryGroup : public HistoryServiceMessage, private HistoryItemInstantiated { public: static HistoryGroup *create(History *history, const MTPDmessageGroup &group, const QDateTime &date) { @@ -2692,7 +2775,7 @@ private: }; -class HistoryCollapse : public HistoryServiceMsg, private HistoryItemInstantiated { +class HistoryCollapse : public HistoryServiceMessage, private HistoryItemInstantiated { public: static HistoryCollapse *create(History *history, MsgId wasMinId, const QDateTime &date) { @@ -2727,7 +2810,7 @@ private: }; -class HistoryJoined : public HistoryServiceMsg, private HistoryItemInstantiated { +class HistoryJoined : public HistoryServiceMessage, private HistoryItemInstantiated { public: static HistoryJoined *create(History *history, const QDateTime &date, UserData *from, MTPDmessage::Flags flags) { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 0ebf050ae..4e886df4c 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -926,8 +926,6 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { bool canForward = (item && item->type() == HistoryItemMsg) && (item->id > 0) && !item->serviceMsg(); HistoryMessage *msg = dynamic_cast(item); - HistoryServiceMsg *srv = dynamic_cast(item); - if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); if (item && item->id > 0 && isUponSelected != 2) { @@ -1211,40 +1209,37 @@ void HistoryInner::keyPressEvent(QKeyEvent *e) { } } -int32 HistoryInner::recountHeight() { - int32 htop = historyTop(), mtop = migratedTop(); - int32 st1 = (htop >= 0) ? (_history->lastScrollTop - htop) : -1, st2 = (_migrated && mtop >= 0) ? (_history->lastScrollTop - mtop) : -1; +void HistoryInner::recountHeight() { + int htop = historyTop(), mtop = migratedTop(); - int32 ph = _scroll->height(), minadd = 0; - int32 wasYSkip = ph - historyHeight() - st::historyPadding; + int ph = _scroll->height(), minadd = 0; + int wasYSkip = ph - historyHeight() - st::historyPadding; if (_botInfo && !_botInfo->text.isEmpty()) { minadd = st::msgMargin.top() + st::msgMargin.bottom() + st::msgPadding.top() + st::msgPadding.bottom() + st::msgNameFont->height + st::botDescSkip + _botDescHeight; } if (wasYSkip < minadd) wasYSkip = minadd; - _history->resize(_scroll->width(), &st1); + _history->resizeGetHeight(_scroll->width()); if (_migrated) { - _migrated->resize(_scroll->width(), &st2); + _migrated->resizeGetHeight(_scroll->width()); } - int32 skip = 0; - if (_migrated) { // check first messages of _history - maybe no need to display them + // with migrated history we perhaps do not need to display first _history message + // (if last _migrated message and first _history message are both isGroupMigrate) + // or at least we don't need to display first _history date (just skip it by height) + _historySkipHeight = 0; + if (_migrated) { if (!_migrated->isEmpty() && !_history->isEmpty() && _migrated->loadedAtBottom() && _history->loadedAtTop()) { if (_migrated->blocks.back()->items.back()->date.date() == _history->blocks.front()->items.front()->date.date()) { - skip += _history->blocks.front()->items.front()->height(); - if (_migrated->blocks.back()->items.back()->isGroupMigrate() && _history->blocks.front()->items.size() == 1 && _history->blocks.size() > 1 && _history->blocks.at(1)->items.front()->isGroupMigrate()) { - skip += _history->blocks.at(1)->items.at(0)->height(); + if (_migrated->blocks.back()->items.back()->isGroupMigrate() && _history->blocks.front()->items.front()->isGroupMigrate()) { + _historySkipHeight += _history->blocks.front()->items.front()->height(); + } else { + _historySkipHeight += _history->blocks.front()->items.front()->displayedDateHeight(); } } - if (skip > migratedTop() + _migrated->height) { - skip = migratedTop() + _migrated->height; // should not happen, just check.. we need historyTop() >= 0 - } } } - if (skip != _historySkipHeight) { - if (st1 >= 0) st1 -= (skip - _historySkipHeight); - _historySkipHeight = skip; - } + updateBotInfo(false); if (_botInfo && !_botInfo->text.isEmpty()) { int32 tw = _scroll->width() - st::msgMargin.left() - st::msgMargin.right(); @@ -1257,7 +1252,11 @@ int32 HistoryInner::recountHeight() { _botDescHeight = _botInfo->text.countHeight(_botDescWidth); int32 descH = st::msgMargin.top() + st::msgPadding.top() + st::msgNameFont->height + st::botDescSkip + _botDescHeight + st::msgPadding.bottom() + st::msgMargin.bottom(); - int32 descAtX = (_scroll->width() - _botDescWidth) / 2 - st::msgPadding.left(); + int32 descMaxWidth = _scroll->width(); + if (Adaptive::Wide()) { + descMaxWidth = qMin(descMaxWidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); + } + int32 descAtX = (descMaxWidth - _botDescWidth) / 2 - st::msgPadding.left(); int32 descAtY = qMin(_historyOffset - descH, qMax(0, (_scroll->height() - descH) / 2)) + st::msgMargin.top(); _botDescRect = QRect(descAtX, descAtY, _botDescWidth + st::msgPadding.left() + st::msgPadding.right(), descH - st::msgMargin.top() - st::msgMargin.bottom()); @@ -1272,7 +1271,13 @@ int32 HistoryInner::recountHeight() { } if (newYSkip < minadd) newYSkip = minadd; - return ((st1 >= 0 || st2 < 0) ? (st1 + htop) : (st2 + mtop)) + (newYSkip - wasYSkip); + if (newYSkip != wasYSkip) { + if (_history->scrollTopItem) { + _history->scrollTopOffset += (newYSkip - wasYSkip); + } else if (_migrated && _migrated->scrollTopItem) { + _migrated->scrollTopOffset += (newYSkip - wasYSkip); + } + } } void HistoryInner::updateBotInfo(bool recount) { @@ -1353,6 +1358,38 @@ HistoryItem *HistoryInner::atTopImportantMsg(int32 top, int32 height, int32 &bot return 0; } +void HistoryInner::visibleAreaUpdated(int top, int bottom) { + // if history has pending resize events we should not update scrollTopItem + if (_history->hasPendingResizedItems()) { + return; + } else if (_migrated && _migrated->hasPendingResizedItems()) { + return; + } + + if (bottom >= historyHeight()) { + _history->forgetScrollState(); + if (_migrated) { + _migrated->forgetScrollState(); + } + } else { + int htop = historyTop(), mtop = migratedTop(); + if ((htop >= 0 && top >= htop) || mtop < 0) { + _history->countScrollState(top - htop); + if (_migrated) { + _migrated->forgetScrollState(); + } + } else if (mtop >= 0 && top >= mtop) { + _history->forgetScrollState(); + _migrated->countScrollState(top - mtop); + } else { + _history->countScrollState(top - htop); + if (_migrated) { + _migrated->forgetScrollState(); + } + } + } +} + void HistoryInner::updateSize() { int32 ph = _scroll->height(), minadd = 0; int32 newYSkip = ph - historyHeight() - st::historyPadding; @@ -1363,7 +1400,11 @@ void HistoryInner::updateSize() { if (_botDescHeight > 0) { int32 descH = st::msgMargin.top() + st::msgPadding.top() + st::msgNameFont->height + st::botDescSkip + _botDescHeight + st::msgPadding.bottom() + st::msgMargin.bottom(); - int32 descAtX = (_scroll->width() - _botDescWidth) / 2 - st::msgPadding.left(); + int32 descMaxWidth = _scroll->width(); + if (Adaptive::Wide()) { + descMaxWidth = qMin(descMaxWidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); + } + int32 descAtX = (descMaxWidth - _botDescWidth) / 2 - st::msgPadding.left(); int32 descAtY = qMin(newYSkip - descH, qMax(0, (_scroll->height() - descH) / 2)) + st::msgMargin.top(); _botDescRect = QRect(descAtX, descAtY, _botDescWidth + st::msgPadding.left() + st::msgPadding.right(), descH - st::msgMargin.top() - st::msgMargin.bottom()); @@ -1665,22 +1706,22 @@ void HistoryInner::onUpdateSelected() { HistoryItem *dragSelFrom = _dragItem, *dragSelTo = item; if (!dragSelFrom->hasPoint(_dragStartPos.x(), _dragStartPos.y())) { // maybe exclude dragSelFrom if (selectingDown) { - if (_dragStartPos.y() >= dragSelFrom->height() - st::msgMargin.bottom() || ((item == dragSelFrom) && (m.y() < _dragStartPos.y() + QApplication::startDragDistance()))) { + if (_dragStartPos.y() >= dragSelFrom->height() - dragSelFrom->marginBottom() || ((item == dragSelFrom) && (m.y() < _dragStartPos.y() + QApplication::startDragDistance() || m.y() < dragSelFrom->marginTop()))) { dragSelFrom = (dragSelFrom == dragSelTo) ? 0 : nextItem(dragSelFrom); } } else { - if (_dragStartPos.y() < st::msgMargin.top() || ((item == dragSelFrom) && (m.y() >= _dragStartPos.y() - QApplication::startDragDistance()))) { + if (_dragStartPos.y() < dragSelFrom->marginTop() || ((item == dragSelFrom) && (m.y() >= _dragStartPos.y() - QApplication::startDragDistance() || m.y() >= dragSelFrom->height() - dragSelFrom->marginBottom()))) { dragSelFrom = (dragSelFrom == dragSelTo) ? 0 : prevItem(dragSelFrom); } } } if (_dragItem != item) { // maybe exclude dragSelTo if (selectingDown) { - if (m.y() < st::msgMargin.top()) { + if (m.y() < dragSelTo->marginTop()) { dragSelTo = (dragSelFrom == dragSelTo) ? 0 : prevItem(dragSelTo); } } else { - if (m.y() >= dragSelTo->height() - st::msgMargin.bottom()) { + if (m.y() >= dragSelTo->height() - dragSelTo->marginBottom()) { dragSelTo = (dragSelFrom == dragSelTo) ? 0 : nextItem(dragSelTo); } } @@ -1739,8 +1780,8 @@ void HistoryInner::updateDragSelection(HistoryItem *dragSelFrom, HistoryItem *dr update(); } -int32 HistoryInner::historyHeight() const { - int32 result = 0; +int HistoryInner::historyHeight() const { + int result = 0; if (!_history || _history->isEmpty()) { result += _migrated ? _migrated->height : 0; } else { @@ -1749,25 +1790,38 @@ int32 HistoryInner::historyHeight() const { return result; } -int32 HistoryInner::migratedTop() const { +int HistoryInner::historyScrollTop() const { + int htop = historyTop(), mtop = migratedTop(); + if (htop >= 0 && _history->scrollTopItem) { + t_assert(!_history->scrollTopItem->detached()); + return htop + _history->scrollTopItem->block()->y + _history->scrollTopItem->y + _history->scrollTopOffset; + } + if (mtop >= 0 && _migrated->scrollTopItem) { + t_assert(!_migrated->scrollTopItem->detached()); + return mtop + _migrated->scrollTopItem->block()->y + _migrated->scrollTopItem->y + _migrated->scrollTopOffset; + } + return ScrollMax; +} + +int HistoryInner::migratedTop() const { return (_migrated && !_migrated->isEmpty()) ? _historyOffset : -1; } -int32 HistoryInner::historyTop() const { - int32 mig = migratedTop(); +int HistoryInner::historyTop() const { + int mig = migratedTop(); return (_history && !_history->isEmpty()) ? (mig >= 0 ? (mig + _migrated->height - _historySkipHeight) : _historyOffset) : -1; } -int32 HistoryInner::historyDrawTop() const { - int32 his = historyTop(); +int HistoryInner::historyDrawTop() const { + int his = historyTop(); return (his >= 0) ? (his + _historySkipHeight) : -1; } -int32 HistoryInner::itemTop(const HistoryItem *item) const { // -1 if should not be visible, -2 if bad history() +int HistoryInner::itemTop(const HistoryItem *item) const { // -1 if should not be visible, -2 if bad history() if (!item) return -2; if (item->detached()) return -1; - int32 top = (item->history() == _history) ? historyTop() : (item->history() == _migrated ? migratedTop() : -2); + int top = (item->history() == _history) ? historyTop() : (item->history() == _migrated ? migratedTop() : -2); return (top < 0) ? top : (top + item->y + item->block()->y); } @@ -2729,7 +2783,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) setAcceptDrops(true); connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(updateField())); - connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll())); + connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll())); connect(&_reportSpamPanel, SIGNAL(reportClicked()), this, SLOT(onReportSpamClicked())); connect(&_reportSpamPanel, SIGNAL(hideClicked()), this, SLOT(onReportSpamHide())); connect(&_reportSpamPanel, SIGNAL(clearClicked()), this, SLOT(onReportSpamClear())); @@ -2753,7 +2807,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) connect(&_field, SIGNAL(changed()), this, SLOT(onTextChange())); connect(&_field, SIGNAL(spacedReturnedPasted()), this, SLOT(onPreviewParse())); connect(&_field, SIGNAL(linksChanged()), this, SLOT(onPreviewCheck())); - connect(App::wnd()->windowHandle(), SIGNAL(visibleChanged(bool)), this, SLOT(onVisibleChanged())); + connect(App::wnd()->windowHandle(), SIGNAL(visibleChanged(bool)), this, SLOT(onWindowVisibleChanged())); connect(&_scrollTimer, SIGNAL(timeout()), this, SLOT(onScrollTimer())); connect(&_emojiPan, SIGNAL(emojiSelected(EmojiPtr)), &_field, SLOT(onEmojiInsert(EmojiPtr))); connect(&_emojiPan, SIGNAL(stickerSelected(DocumentData*)), this, SLOT(onStickerSend(DocumentData*))); @@ -3516,7 +3570,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re if (_history) { if (_peer->id == peerId && !reload) { - _history->lastWidth = 0; + _history->forgetScrollState(); bool wasOnlyImportant = _history->isChannel() ? _history->asChannelHistory()->onlyImportant() : true; @@ -3582,14 +3636,8 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re writeDrafts(&_history->msgDraft, &_history->editDraft); - if (_scroll.scrollTop() + 1 <= _scroll.scrollTopMax()) { - _history->lastWidth = _list->width(); - _history->lastShowAtMsgId = _showAtMsgId; - } else { - _history->lastWidth = 0; - _history->lastShowAtMsgId = ShowAtUnreadMsgId; - } - _history->lastScrollTop = _scroll.scrollTop(); + _history->showAtMsgId = _showAtMsgId; + destroyUnreadBar(); if (_pinnedBar) destroyPinnedBar(); _history = _migrated = nullptr; @@ -3662,11 +3710,11 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re } if (_showAtMsgId == ShowAtUnreadMsgId) { - if (_history->lastWidth) { - _showAtMsgId = _history->lastShowAtMsgId; + if (_history->scrollTopItem) { + _showAtMsgId = _history->showAtMsgId; } } else { - _history->lastWidth = 0; + _history->forgetScrollState(); } _list = new HistoryInner(this, &_scroll, _history); @@ -3678,7 +3726,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _updateHistoryItems.stop(); pinnedMsgVisibilityUpdated(); - if (_history->lastWidth || _history->isReadyFor(_showAtMsgId, _fixedInScrollMsgId, _fixedInScrollMsgTop)) { + if (_history->scrollTopItem || _history->isReadyFor(_showAtMsgId, _fixedInScrollMsgId, _fixedInScrollMsgTop)) { _fixedInScrollMsgId = 0; _fixedInScrollMsgTop = 0; historyLoaded(); @@ -4142,7 +4190,7 @@ void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) { } void HistoryWidget::historyToDown(History *history) { - history->lastScrollTop = ScrollMax; + history->forgetScrollState(); if (history == _history) { _scroll.scrollToY(_scroll.scrollTopMax()); } @@ -4231,7 +4279,7 @@ void HistoryWidget::messagesReceived(PeerData *peer, const MTPmessages_Messages if (_preloadRequest == requestId) { addMessagesToFront(peer, *histList, histCollapsed); _preloadRequest = 0; - onListScroll(); + preloadHistoryIfNeeded(); if (_reportSpamStatus == dbiprsUnknown) { updateReportSpamStatus(); if (_reportSpamStatus != dbiprsUnknown) updateControlsVisibility(); @@ -4239,7 +4287,7 @@ void HistoryWidget::messagesReceived(PeerData *peer, const MTPmessages_Messages } else if (_preloadDownRequest == requestId) { addMessagesToBack(peer, *histList, histCollapsed); _preloadDownRequest = 0; - onListScroll(); + preloadHistoryIfNeeded(); if (_history->loadedAtBottom() && App::wnd()) App::wnd()->checkHistoryActivation(); } else if (_firstLoadRequest == requestId) { if (toMigrated) { @@ -4516,8 +4564,17 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) { } } -void HistoryWidget::onListScroll() { +void HistoryWidget::onScroll() { App::checkImageCacheSize(); + preloadHistoryIfNeeded(); + + if (_list && !_scroll.isHidden()) { + int st = _scroll.scrollTop(); + _list->visibleAreaUpdated(st, st + _scroll.height()); + } +} + +void HistoryWidget::preloadHistoryIfNeeded() { if (_firstLoadRequest || _scroll.isHidden() || !_peer) return; updateToEndVisibility(); @@ -4550,8 +4607,8 @@ void HistoryWidget::onListScroll() { } } -void HistoryWidget::onVisibleChanged() { - QTimer::singleShot(0, this, SLOT(onListScroll())); +void HistoryWidget::onWindowVisibleChanged() { + QTimer::singleShot(0, this, SLOT(preloadHistoryIfNeeded())); } void HistoryWidget::onHistoryToEnd() { @@ -4937,7 +4994,7 @@ void HistoryWidget::doneShow() { updateBotKeyboard(); updateControlsVisibility(); updateListSize(true); - onListScroll(); + preloadHistoryIfNeeded(); if (App::wnd()) { App::wnd()->checkHistoryActivation(); App::wnd()->setInnerFocus(); @@ -6322,16 +6379,13 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh updateCollapseCommentsVisibility(); } - if (!initial) { - _history->lastScrollTop = _scroll.scrollTop(); - } - int32 newSt = _list->recountHeight(); + _list->recountHeight(); + bool washidden = _scroll.isHidden(); if (washidden) { _scroll.show(); } _list->updateSize(); - int32 historyTop = _list->historyTop(), migratedTop = _list->migratedTop(); if (washidden) { _scroll.hide(); } @@ -6343,7 +6397,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } else if (change.type == ScrollChangeOldHistoryHeight) { addToY = _list->historyHeight() - change.value; } - _scroll.scrollToY(newSt + addToY); + _scroll.scrollToY(_list->historyScrollTop() + addToY); return; } @@ -6352,9 +6406,8 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } int32 toY = ScrollMax; - if (initial && _history->lastWidth) { - toY = newSt; - _history->lastWidth = 0; + if (initial && _history->scrollTopItem) { + toY = _list->historyScrollTop(); } else if (initial && _migrated && _showAtMsgId < 0 && -_showAtMsgId < ServerMaxMsgId) { HistoryItem *item = App::histItemById(0, -_showAtMsgId); int32 iy = _list->itemTop(item); @@ -6454,7 +6507,7 @@ void HistoryWidget::addMessagesToFront(PeerData *peer, const QVector int oldH = _list->historyHeight(); _list->messagesReceived(peer, messages, collapsed); if (!_firstLoadRequest) { - updateListSize(false, false, { ScrollChangeOldHistoryHeight, oldH }); + updateListSize(); if (_animActiveTimer.isActive() && _activeAnimMsgId > 0 && _migrated && !_migrated->isEmpty() && _migrated->loadedAtBottom() && _migrated->blocks.back()->items.back()->isGroupMigrate() && _list->historyTop() != _list->historyDrawTop() && _history) { HistoryItem *animActiveItem = App::histItemById(_history->channelId(), _activeAnimMsgId); if (animActiveItem && animActiveItem->isGroupMigrate()) { @@ -7406,7 +7459,6 @@ void HistoryWidget::onCancel() { } void HistoryWidget::onFullPeerUpdated(PeerData *data) { - int32 newScrollTop = _scroll.scrollTop(); if (_list && data == _peer) { bool newCanSendMessages = canSendMessages(_peer); if (newCanSendMessages != _canSendMessages) { @@ -7418,9 +7470,7 @@ void HistoryWidget::onFullPeerUpdated(PeerData *data) { } onCheckMentionDropdown(); updateReportSpamStatus(); - int32 lh = _list->height(), st = _scroll.scrollTop(); _list->updateBotInfo(); - newScrollTop = st + _list->height() - lh; } if (updateCmdStartShown()) { updateControlsVisibility(); @@ -7430,13 +7480,6 @@ void HistoryWidget::onFullPeerUpdated(PeerData *data) { updateControlsVisibility(); resizeEvent(0); } - if (newScrollTop != _scroll.scrollTop()) { - if (_scroll.isVisible()) { - _scroll.scrollToY(newScrollTop); - } else { - _history->lastScrollTop = newScrollTop; - } - } } void HistoryWidget::peerUpdated(PeerData *data) { diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index c9b38f485..ab5647a9c 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -66,7 +66,7 @@ public: void touchScrollUpdated(const QPoint &screenPos); QPoint mapMouseToItem(QPoint p, HistoryItem *item); - int32 recountHeight(); + void recountHeight(); void updateSize(); void repaintItem(const HistoryItem *item); @@ -88,11 +88,15 @@ public: HistoryItem *atTopImportantMsg(int32 top, int32 height, int32 &bottomUnderScrollTop) const; - int32 historyHeight() const; - int32 migratedTop() const; - int32 historyTop() const; - int32 historyDrawTop() const; - int32 itemTop(const HistoryItem *item) const; // -1 if should not be visible, -2 if bad history() + // updates history->scrollTopItem/scrollTopOffset + void visibleAreaUpdated(int top, int bottom); + + int historyHeight() const; + int historyScrollTop() const; + int migratedTop() const; + int historyTop() const; + int historyDrawTop() const; + int itemTop(const HistoryItem *item) const; // -1 if should not be visible, -2 if bad history() void notifyIsBotChanged(); void notifyMigrateUpdated(); @@ -646,7 +650,7 @@ public slots: void onReportSpamHide(); void onReportSpamClear(); - void onListScroll(); + void onScroll(); void onHistoryToEnd(); void onCollapseComments(); void onSend(bool ctrlShiftEnter = false, MsgId replyTo = -1); @@ -676,7 +680,7 @@ public slots: void onPhotoSend(PhotoData *photo); void onInlineResultSend(InlineResult *result, UserData *bot); - void onVisibleChanged(); + void onWindowVisibleChanged(); void deleteMessage(); void forwardMessage(); @@ -709,6 +713,10 @@ public slots: void onUpdateHistoryItems(); + // checks if we are too close to the top or to the bottom + // in the scroll area and preloads history if needed + void preloadHistoryIfNeeded(); + private: MsgId _replyToId; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 5fc4200ac..690bf327b 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -3012,7 +3012,7 @@ void MainWidget::gotChannelDifference(ChannelData *channel, const MTPupdates_Cha } if (history.peer() == channel) { history.updateToEndVisibility(); - history.onListScroll(); + history.preloadHistoryIfNeeded(); } h->asChannelHistory()->getRangeDifference(); } @@ -3412,8 +3412,7 @@ void MainWidget::getChannelDifference(ChannelData *channel, GetChannelDifference int32 fixInScrollMsgTop = 0; history->asChannelHistory()->getSwitchReadyFor(SwitchAtTopMsgId, fixInScrollMsgId, fixInScrollMsgTop); history->getReadyFor(ShowAtTheEndMsgId, fixInScrollMsgId, fixInScrollMsgTop); - history->lastWidth = 0; - history->lastScrollTop = INT_MAX; + history->forgetScrollState(); } } } diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index b87938ab9..c8a3f2b32 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -1036,8 +1036,11 @@ enum class MTPDmessage_ClientFlag : int32 { // message needs paint() f_pending_paint = (1 << 26), + // message is attached to previous one when displaying the history + f_attach_to_previous = (1 << 25), + // update this when adding new client side flags - MIN_FIELD = (1 << 26), + MIN_FIELD = (1 << 25), }; DEFINE_MTP_CLIENT_FLAGS(MTPDmessage) diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 9be7d77c1..3f7022ac7 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -161,7 +161,10 @@ void PeerData::setUserpic(ImagePtr userpic) { ImagePtr PeerData::currentUserpic() const { if (_userpic->loaded()) { return _userpic; - } else if (isUser()) { + } + _userpic->load(); + + if (isUser()) { return userDefPhoto(colorIndex); } else if (isMegagroup() || isChat()) { return chatDefPhoto(colorIndex);